本文整理汇总了PHP中Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP ContainerAwareCommand::initialize方法的具体用法?PHP ContainerAwareCommand::initialize怎么用?PHP ContainerAwareCommand::initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand
的用法示例。
在下文中一共展示了ContainerAwareCommand::initialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
/**
* Initialize Connections
* @param InputInterface $input input
* @param OutputInterface $output output
*/
protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
$this->container = $this->getContainer();
$this->classification = $this->container->get('consult.classification');
$this->wordManager = $this->container->get('consult.word_manager');
}
示例2: initialize
/**
* Initializes the command just after the input has been validated.
*
* This is mainly useful when a lot of commands extends one main command
* where some things need to be initialized based on the input arguments and options.
*
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*/
protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
$this->helper = $this->getHelperSet()->get('formatter');
// $this->rootDir = $this->getContainer()->get('kernel')->getRootDir();
// $this->env = $this->getContainer()->get('kernel')->getEnvironment();
}
示例3: initialize
protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
$this->communicationService = $this->getContainer()->get(CommunicationService::ID);
$this->documentManager = $this->getContainer()->get('doctrine_mongodb')->getManager();
$this->eventDispatcher = $this->getContainer()->get('event_dispatcher');
}
示例4: initialize
protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
$this->basePath = $input->getArgument('write_to') ?: $this->getContainer()->getParameter('assetic.write_to');
$this->verbose = $input->getOption('verbose');
$this->am = $this->getContainer()->get('assetic.asset_manager');
}
示例5: initialize
protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
$this->targetPath = $input->getOption('target') ?: sprintf('%s/../web/js/fos_js_routes.js', $this->getContainer()->getParameter('kernel.root_dir'));
$this->extractor = $this->getContainer()->get('fos_js_routing.extractor');
$this->serializer = $this->getContainer()->get('fos_js_routing.serializer');
}
示例6: initialize
/**
*
* @param InputInterface $input
* @param OutputInterface $output
*
* @return void
*/
protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
declare (ticks=1);
pcntl_signal(SIGTERM, [$this, 'stopCommand']);
pcntl_signal(SIGINT, [$this, 'stopCommand']);
}
示例7: initialize
/**
* Initialize objects required by {@see execute()}.
*
* @param InputInterface $input
* @param OutputInterface $output
*/
public function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
$this->searchIndexer = $this->getContainer()->get('ezpublish.spi.search.indexer');
if (!$this->searchIndexer instanceof Indexer) {
throw new RuntimeException(sprintf('Expected to find Search Engine Indexer but found "%s" instead', get_parent_class($this->searchIndexer)));
}
}
示例8: initialize
/**
* Initializes the command just after the input has been validated.
*
* This is mainly useful when a lot of commands extends one main command
* where some things need to be initialized based on the input arguments and options.
*
* @param InputInterface $input An InputInterface instance
* @param OutputInterface $output An OutputInterface instance
*/
protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
$this->entityManager = $this->getContainer()->get('doctrine.orm.default_entity_manager');
$this->router = $this->getContainer()->get('router.default');
$this->output = $output;
$this->entityManager->getConnection()->getConfiguration()->setSQLLogger(null);
}
示例9: initialize
/**
* {@inheritdoc}
*/
protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
$this->checkConfiguration();
if ($input->hasArgument('bundle') && '@' === substr($input->getArgument('bundle'), 0, 1)) {
$this->bundle = $this->getContainer()->get('kernel')->getBundle(substr($input->getArgument('bundle'), 1));
}
}
示例10: initialize
/**
* Initialize Connections
* @param InputInterface $input input
* @param OutputInterface $output output
*/
protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
//$this->container = $this->getContainer();
$this->queue = $this->getContainer()->get('consult.consult_queue');
$this->daaDebug = $this->getContainer()->getParameter('daa_debug');
$this->doctorManager = $this->getContainer()->get('consult.doctor_manager');
}
示例11: initialize
/**
* @param InputInterface $input
* @param OutputInterface $output
*/
protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
//initialize parent class method
$this->container = $this->getContainer();
// This loads Doctrine, you can load your own services as well
$this->em = $this->container->get('doctrine')->getManager();
}
示例12: initialize
/**
* Initialize Services
*
* @param InputInterface $input - Input Interface
* @param OutputInterface $output - Output Interface
*/
protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
$this->container = $this->getContainer();
$this->queue = $this->container->get('consult.consult_queue');
$this->helper = $this->container->get('consult.helper');
$this->doctorQuestionManager = $this->container->get('consult.doctorQuestionManager');
$this->questionManager = $this->container->get('consult.question_manager');
}
示例13: initialize
/**
* {@inheritdoc}
*/
protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
$path = $this->getContainer()->getParameter('sb_event_queue.storage_path');
$this->process = new QueueProcess();
$this->process->setPath($path);
if ($input->hasOption('name')) {
$this->process->setQueueName($input->getOption('name'));
}
}
示例14: initialize
protected function initialize(InputInterface $input, OutputInterface $output)
{
$legacyRootDir = $this->getContainer()->getParameter('innomatic_legacy.root_dir');
$legacyScript = $input->getArgument('script');
// Check if the given script exists
if (!file_exists($legacyRootDir . '/innomatic/core/scripts/' . $legacyScript)) {
throw new \InvalidArgumentException(sprintf('The script "%s" does not exist.', $input->getArgument('script')));
}
parent::initialize($input, $output);
}
示例15: initialize
protected function initialize(InputInterface $input, OutputInterface $output)
{
parent::initialize($input, $output);
$sets = $input->getOption('sets');
sort($sets);
$sets_suffix = $sets ? '.' . join('_', $sets) : '';
$this->targetPath = $input->getOption('target') ?: sprintf('%s/../web/js/fos_js_routes' . $sets_suffix . '.js', $this->getContainer()->getParameter('kernel.root_dir'));
$this->extractor = $this->getContainer()->get('fos_js_routing.extractor');
$this->serializer = $this->getContainer()->get('fos_js_routing.serializer');
}