/** * Execute the command. * * @return void * @access protected * @author Etienne de Longeaux <*****@*****.**> */ protected function execute(InputInterface $input, OutputInterface $output) { //-----we initialize the logger----- $this->_logger = $this->getContainer()->get('sfynx.tool.log_manager'); $this->_logger->setPath($this->getContainer()->getParameter("kernel.logs_dir")); $this->_logger->setInit('log_userbundle_route', date("YmdH")); $this->_logger->setInfo(date("Y-m-d H:i:s") . " [LOG ROUTE] Begin launch :"); foreach ($this->getAllRoutes() as $name => $route) { $output->writeln(sprintf('<comment>></comment> <info>parsing route : </info>')); // $output->writeln(sprintf('<info>pattern %s </info>', $route->getPattern() )); $output->writeln(sprintf('<info>regex %s </info>', $route->getRegex())); // $output->writeln(sprintf('<info>route %s </info>', $route->getRoute())); $output->writeln(sprintf('<info>static prefix %s </info>', $route->getStaticPrefix())); // $output->writeln(sprintf('<info>tokens %s </info>', implode('- ', $route->getTokens()) )); $output->writeln(sprintf('<info>variables %s </info>', implode('- ', $route->getVariables()))); // $output->writeln(sprintf('<info>options %s </info>', implode('- ',$route->getOptions()) )); // $output->writeln(sprintf('<info>defaults %s </info>', implode('- ',$route->getDefaults()) )); // $output->writeln(sprintf('<info>requirements %s </info>', implode('- ',$route->getRequirements()) )); $output->writeln(sprintf('<info></info>')); } $output->writeln(sprintf('Command completed successfully')); //-----we close the logger----- $this->_logger->setInfo(date("Y-m-d H:i:s") . " [END] End launch"); $this->_logger->save(); }
/** * configure the command. * * @return void * @access protected * @author Etienne de Longeaux <*****@*****.**> */ protected function getGenerator($bundle = null) { //-----we initialize the logger----- $this->_logger = $this->getContainer()->get('sfynx.tool.log_manager'); $this->_logger->setPath($this->getContainer()->getParameter("kernel.logs_dir")); $this->_logger->setInit('log_corebundle_crud', date("YmdH")); $this->_logger->setInfo(date("Y-m-d H:i:s") . " [LOG CRUD] Begin launch :"); $generator_crud = new DoctrineCrudGenerator($this->getContainer()->get('filesystem'), __DIR__ . '/../Resources/views/skeleton/crud'); $this->setGenerator($generator_crud); $generator_form = new DoctrineFormGenerator($this->getContainer()->get('filesystem'), __DIR__ . '/../Resources/views/skeleton/form'); $this->setFormGenerator($generator_form); //-----we close the logger----- $this->_logger->setInfo(date("Y-m-d H:i:s") . " [END] End launch"); $this->_logger->save(); return parent::getGenerator(); }
/** * Execute the command. * * @return void * @access protected * @author Etienne de Longeaux <*****@*****.**> */ protected function execute(InputInterface $input, OutputInterface $output) { //-----we initialize the logger----- $this->_logger = $this->getContainer()->get('sfynx.tool.log_manager'); $this->_logger->setPath($this->getContainer()->getParameter("kernel.logs_dir")); $this->_logger->setInit('log_databasebundle_restore', date("YmdH")); $this->_logger->setInfo(date("Y-m-d H:i:s") . " [LOG RESTORE] Begin launch :"); $path = $input->getArgument('path'); $fileName = $input->getArgument('filename') ? $input->getArgument('filename') : null; $container = $this->getContainer(); $DatabaseManager = $container->get('bootstrap.database.factory'); $output = $DatabaseManager->getRestoreFactory()->run($output, array('path' => $path, 'filename' => $fileName)); //-----we close the logger----- $this->_logger->setInfo(date("Y-m-d H:i:s") . " [END] End launch"); $this->_logger->save(); }