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


PHP Application::getHelperSet方法代码示例

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


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

示例1: run

 /**
  * @param array $input
  *
  * @return integer
  */
 public function run($input = array())
 {
     $this->input = new ArrayInput((array) $input);
     $this->input->setInteractive(false);
     $this->output = new StreamOutput(fopen('php://memory', 'r+', false));
     $inputStream = $this->getInputStream();
     rewind($inputStream);
     $this->application->getHelperSet()->get('dialog')->setInputStream($inputStream);
     return $this->application->doRun($this->input, $this->output);
 }
开发者ID:jacdobro,项目名称:teryt-database-bundle,代码行数:15,代码来源:ApplicationTester.php

示例2: addConsoleHelpers

 private function addConsoleHelpers(FrameworkApplication $app)
 {
     if (!Util::hasQuestionHelper()) {
         $helper = $app->getKernel()->getContainer()->get('rj_frontend.console.helper.question_legacy');
         $app->getHelperSet()->set($helper, 'question');
     }
 }
开发者ID:regularjack,项目名称:frontend-bundle,代码行数:7,代码来源:RjFrontendBundle.php

示例3: setApplicationDocumentManager

 /**
  * @param Symfony\Bundle\FrameworkBundle\Console\Application
  * @param string $dmName
  */
 public static function setApplicationDocumentManager(Application $application, $dmName)
 {
     /** @var $dm \Doctrine\ODM\DocumentManager */
     $alias = sprintf("doctrine_mongodb.odm.%s", $dmName);
     $dm = $application->getKernel()->getContainer()->get($alias);
     $helperSet = $application->getHelperSet();
     $helperSet->set(new DocumentManagerHelper($dm), 'dm');
 }
开发者ID:gepo,项目名称:mongodb-migrations-bundle,代码行数:12,代码来源:AntiMattrCommand.php

示例4: setApplicationDocumentManager

 /**
  * Set the document manager on the application.
  *
  * @param Application $application
  * @param string      $dmName
  */
 public static function setApplicationDocumentManager(Application $application, $dmName)
 {
     /** @var $registry ManagerRegistry */
     $registry = $application->getKernel()->getContainer()->get('doctrine_phpcr');
     $documentManager = $registry->getManager($dmName);
     $helperSet = $application->getHelperSet();
     $helperSet->set(new DocumentManagerHelper(null, $documentManager));
 }
开发者ID:xabbuh,项目名称:DoctrinePHPCRBundle,代码行数:14,代码来源:DoctrineCommandHelper.php

示例5: setApplicationDocumentManager

 public static function setApplicationDocumentManager(Application $application, $dmName)
 {
     $container = $application->getKernel()->getContainer();
     $dmName = $dmName ? $dmName : 'default';
     $dmServiceName = sprintf('doctrine.odm.mongodb.%s_document_manager', $dmName);
     if (!$container->has($dmServiceName)) {
         throw new \InvalidArgumentException(sprintf('Could not find Doctrine ODM DocumentManager named "%s"', $dmName));
     }
     $dm = $container->get($dmServiceName);
     $helperSet = $application->getHelperSet();
     $helperSet->set(new DocumentManagerHelper($dm), 'dm');
 }
开发者ID:faridos,项目名称:ServerGroveLiveChat,代码行数:12,代码来源:DoctrineODMCommand.php

示例6: setApplicationConnection

 public static function setApplicationConnection(Application $application, $connName)
 {
     $container = $application->getKernel()->getContainer();
     $connName = $connName ? $connName : $container->getParameter('doctrine.dbal.default_connection');
     $connServiceName = sprintf('doctrine.dbal.%s_connection', $connName);
     if (!$container->has($connServiceName)) {
         throw new \InvalidArgumentException(sprintf('Could not find Doctrine Connection named "%s"', $connName));
     }
     $connection = $container->get($connServiceName);
     $helperSet = $application->getHelperSet();
     $helperSet->set(new ConnectionHelper($connection), 'db');
 }
开发者ID:norwayapp,项目名称:Invest,代码行数:12,代码来源:DoctrineCommand.php

示例7: setApplicationXmlEntityManager

 public static function setApplicationXmlEntityManager(Application $application, $xemName)
 {
     $container = $application->getKernel()->getContainer();
     $xemName = $xemName ? $xemName : 'default';
     $xemServiceName = sprintf('doctrine.oxm.%s_xml_entity_manager', $xemName);
     if (!$container->has($xemServiceName)) {
         throw new \InvalidArgumentException(sprintf('Could not find Doctrine OXM XmlEntityManager named "%s"', $xemName));
     }
     $xem = $container->get($xemServiceName);
     $helperSet = $application->getHelperSet();
     $helperSet->set(new XmlEntityManagerHelper($xem), 'xem');
 }
开发者ID:pkdevbox,项目名称:DoctrineOXMBundle,代码行数:12,代码来源:DoctrineOXMCommand.php

示例8: testCommand

 /**
  * @dataProvider provideTestCommand
  *
  * @param $command
  * @param $reportFile
  */
 public function testCommand($command, $arguments, $reportFile, $inputStream = null)
 {
     $client = static::createClient();
     $application = new Application($client->getKernel());
     $application->setCatchExceptions(false);
     $output = new BufferedOutput();
     $application->setAutoExit(false);
     if ($inputStream) {
         $application->getHelperSet()->get('dialog')->setInputStream($this->getInputStream($inputStream));
     }
     //We push a empty argument that is ignore by the application and we push the command itself
     array_unshift($arguments, null, $command);
     $application->run(new ArgvInput($arguments), $output);
     if ($this->dev) {
         file_put_contents($reportFile, $this->report($application));
     }
     $this->assertStringEqualsFile($reportFile, $this->report($application));
 }
开发者ID:mpoiriert,项目名称:nucleus-migration-bundle,代码行数:24,代码来源:NucleusMigrationExtensionTest.php

示例9: setApplicationConnection

 /**
  * Convenience method to push the helper sets of a given connection into the application.
  *
  * @param Application $application
  * @param string      $connName
  */
 public static function setApplicationConnection(Application $application, $connName)
 {
     $connection = $application->getKernel()->getContainer()->get('doctrine')->getConnection($connName);
     $helperSet = $application->getHelperSet();
     $helperSet->set(new ConnectionHelper($connection), 'db');
 }
开发者ID:TuxCoffeeCorner,项目名称:tcc,代码行数:12,代码来源:DoctrineCommandHelper.php

示例10: setApplicationDocumentManager

 public static function setApplicationDocumentManager(Application $application, $dmName)
 {
     $dm = $application->getKernel()->getContainer()->get('doctrine_mongodb')->getManager($dmName);
     $helperSet = $application->getHelperSet();
     $helperSet->set(new DocumentManagerHelper($dm), 'dm');
 }
开发者ID:Wizkunde,项目名称:DoctrineMongoDBBundle,代码行数:6,代码来源:DoctrineODMCommand.php


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