Category Archives: CommandLine

Symfony2 command line and Doctrine

<?php namespace ProjectName\TestBundle\Command; use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use PDO; class TestCommand extends ContainerAwareCommand { protected $em = NULL; protected function configure() { $this ->setName(‘testcommandlineapp’) ->setDescription(‘Blabla’) ->setDefinition(array()); } protected function execute(InputInterface $input, OutputInterface $output) { $output->writeln( ‘Working…’ … Continue reading

Posted in CommandLine, Doctrine, Symfony2 | Leave a comment