W CommandConsole mam taki kodzik:
<?php namespace Acme\Console\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Command\Command; class CronCommand extends Command { protected function configure() { $this ->setName('fetch:new') ->setDescription('Fetch new products') ; } /** * @param InputInterface $input * @param OutputInterface $output */ protected function execute(InputInterface $input, OutputInterface $output) { $service = new CronTaskProduct; $s = $service->init(); $output->writeln($s); } }
I jest problem bo pluję się że w do seriwsu nie jest wstrzyknięty doctrine. Macie jakies pomysły jak to rozwiązać?
Dodam że przy korzystaniu z ContainerAwareCommand wywali mi to : PHP Fatal error: Call to undefined method Symfony\Component\Console\Application::getKernel()