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


PHP ContainerAwareCommand::setContainer方法代码示例

本文整理汇总了PHP中Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand::setContainer方法的典型用法代码示例。如果您正苦于以下问题:PHP ContainerAwareCommand::setContainer方法的具体用法?PHP ContainerAwareCommand::setContainer怎么用?PHP ContainerAwareCommand::setContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand的用法示例。


在下文中一共展示了ContainerAwareCommand::setContainer方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setContainer

 /**
  * Set the service container, and initialize the command.
  *
  * @param ContainerInterface $container
  */
 public function setContainer(ContainerInterface $container = null)
 {
     parent::setContainer($container);
     $this->templating = $container->get('templating');
     $this->logger = $container->get('monolog.logger.processing');
     $this->ping = $container->get('ping');
 }
开发者ID:ubermichael,项目名称:pkppln-php,代码行数:12,代码来源:HealthCheckCommand.php

示例2: setContainer

 /**
  * Set the service container, and initialize the command.
  *
  * @param ContainerInterface $container
  */
 public function setContainer(ContainerInterface $container = null)
 {
     parent::setContainer($container);
     $this->templating = $container->get('templating');
     $this->logger = $container->get('logger');
     $this->em = $container->get('doctrine')->getManager();
 }
开发者ID:ubermichael,项目名称:pkppln-php,代码行数:12,代码来源:ExtractDepositCommand.php

示例3: setContainer

 /**
  * {@inheritdoc}
  */
 public function setContainer(ContainerInterface $container = null)
 {
     parent::setContainer($container);
     $this->logger = $container->get('logger');
     $this->em = $container->get('doctrine')->getManager();
     $this->filePaths = $container->get('filepaths');
 }
开发者ID:ubermichael,项目名称:pkppln-php,代码行数:10,代码来源:CleanupCommand.php

示例4: setContainer

 /**
  * Set the service container, and initialize the command.
  *
  * @param ContainerInterface $container
  */
 public function setContainer(ContainerInterface $container = null)
 {
     parent::setContainer($container);
     $this->logger = $container->get('monolog.logger.processing');
     $this->em = $container->get('doctrine')->getManager();
     $this->filePaths = $container->get('filepaths');
     $this->swordClient = $container->get('sword_client');
     $this->fs = new Filesystem();
 }
开发者ID:ubermichael,项目名称:pkppln-php,代码行数:14,代码来源:FetchContentCommand.php

示例5: setContainer

 public function setContainer(ContainerInterface $container = NULL)
 {
     parent::setContainer($container);
     //Set up some shortcuts to services
     if ($container !== NULL) {
         $this->_em = $container->get("doctrine.orm.entity_manager");
         $this->resultRepo = $this->_em->getRepository("OverwatchResultBundle:TestResult");
     }
 }
开发者ID:amyboyd,项目名称:overwatch,代码行数:9,代码来源:ResultCleanupCommand.php

示例6: executeCommand

 /**
  * Executes specified command.
  *
  * @param ContainerAwareCommand $commandInstance
  * @param string                $commandNamespace
  * @param array                 $parameters
  *
  * @return CommandTester
  */
 protected function executeCommand(ContainerAwareCommand $commandInstance, $commandNamespace, array $parameters = [])
 {
     $application = new Application(self::createClient()->getKernel());
     $commandInstance->setContainer($this->getServiceContainer());
     $application->add($commandInstance);
     $command = $application->find($commandNamespace);
     $commandTester = new CommandTester($command);
     $commandTester->execute(array_merge_recursive(['command' => $command->getName()], $parameters));
     return $commandTester;
 }
开发者ID:arfr,项目名称:OXIDConnectorBundle,代码行数:19,代码来源:AbstractTestCase.php

示例7: setContainer

 /**
  * Set the service container, and initialize the command.
  *
  * @param ContainerInterface $container
  */
 public function setContainer(ContainerInterface $container = null)
 {
     parent::setContainer($container);
     $this->logger = $container->get('monolog.logger.processing');
     $this->em = $container->get('doctrine')->getManager();
 }
开发者ID:ubermichael,项目名称:pkppln-php,代码行数:11,代码来源:ResetDepositCommand.php

示例8:

 /**
  * @param string $command
  * @param string $controller
  * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
  */
 function __construct($command, $controller, ContainerInterface $container)
 {
     $this->command = new $command();
     $this->command->setContainer($container);
     $this->controller = $controller;
 }
开发者ID:axelvnk,项目名称:KunstmaanBundlesCMS,代码行数:11,代码来源:DashboardWidget.php

示例9: setContainer

 /**
  * {@inheritdoc}
  *
  * @InjectParams({
  *     "container" = @Inject("service_container")
  * })
  */
 public function setContainer(ContainerInterface $container = null)
 {
     parent::setContainer($container);
 }
开发者ID:ChMat,项目名称:CoreBundle,代码行数:11,代码来源:PlatformUpdateCommand.php

示例10: runCommand

 /**
  * Runs a command and returns a response if there was an error.
  *
  * @param ContainerAwareCommand $command
  * @param InputInterface|null   $input
  *
  * @return Response|null
  */
 private function runCommand(ContainerAwareCommand $command, InputInterface $input = null)
 {
     if (null === $input) {
         $input = new ArgvInput([]);
     }
     $output = new BufferedOutput(OutputInterface::VERBOSITY_NORMAL, true);
     $command->setContainer($this->container);
     $status = $command->run($input, $output);
     if ($status > 0) {
         return $this->render('console.html.twig', ['output' => $output->fetch()]);
     }
     return null;
 }
开发者ID:contao,项目名称:installation-bundle,代码行数:21,代码来源:InstallationController.php

示例11: setContainer

 /**
  * @param ContainerInterface|null $container
  */
 public function setContainer(ContainerInterface $container = null)
 {
     parent::setContainer($container);
     $this->_consulBag = $container->get('consul_api.bag');
 }
开发者ID:dcarbone,项目名称:php-consul-api-bundle,代码行数:8,代码来源:AbstractPHPConsulAPICommand.php


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