当前位置: 首页>>代码示例>>PHP>>正文


PHP ContainerAwareCommand::initialize方法代码示例

本文整理汇总了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');
 }
开发者ID:nandanprac,项目名称:capi,代码行数:12,代码来源:DataTrainingCommand.php

示例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();
 }
开发者ID:performerSpa,项目名称:PerformerVagrantBundle,代码行数:16,代码来源:BasicCommand.php

示例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');
 }
开发者ID:symfony-tutorial,项目名称:app,代码行数:7,代码来源:EmailsRecyclerCommand.php

示例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');
 }
开发者ID:laubosslink,项目名称:lab,代码行数:7,代码来源:DumpCommand.php

示例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');
 }
开发者ID:tecnocat,项目名称:FOSJsRoutingBundle,代码行数:7,代码来源:DumpCommand.php

示例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']);
 }
开发者ID:cimus,项目名称:gearman-bundle,代码行数:14,代码来源:RunWorkerCommand.php

示例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)));
     }
 }
开发者ID:ezsystems,项目名称:ezpublish-kernel,代码行数:14,代码来源:ReindexCommand.php

示例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);
 }
开发者ID:7rin0,项目名称:BigfootCoreBundle,代码行数:17,代码来源:BaseCommand.php

示例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));
     }
 }
开发者ID:angelk,项目名称:PropelBundle,代码行数:11,代码来源:AbstractCommand.php

示例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');
 }
开发者ID:nandanprac,项目名称:capi,代码行数:13,代码来源:DoctorAssigmentCommand.php

示例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();
 }
开发者ID:airamwrc,项目名称:LiipFunctionalTestBundle,代码行数:12,代码来源:TestCommand.php

示例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');
 }
开发者ID:nandanprac,项目名称:capi,代码行数:15,代码来源:DoctorAssignmentPersistenceCommand.php

示例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'));
     }
 }
开发者ID:symfony-bundles,项目名称:event-queue-bundle,代码行数:13,代码来源:Command.php

示例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);
 }
开发者ID:innomatic,项目名称:innomatic-legacy-bridge,代码行数:10,代码来源:LegacyScriptCommand.php

示例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');
 }
开发者ID:CoderRoman,项目名称:FOSJsRoutingBundle,代码行数:10,代码来源:DumpCommand.php


注:本文中的Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand::initialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。