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


PHP ConsoleRunner::createHelperSet方法代码示例

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


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

示例1: __construct

 /**
  * Constructor
  *
  * @param Application $console Console
  * @param ContainerInterface $container Container DI
  */
 public function __construct(Application $console, ContainerInterface $container)
 {
     $entityManager = $container->get('EntityManager');
     $helperSet = ConsoleRunner::createHelperSet($entityManager);
     $helperSet->set(new QuestionHelper(), 'dialog');
     $console->setHelperSet($helperSet);
     ConsoleRunner::addCommands($console);
 }
开发者ID:danielspk,项目名称:tornadohttpskeletonapplication,代码行数:14,代码来源:ORMRegister.php

示例2: doRun

 /**
  * {@inheritDoc}
  */
 public function doRun(InputInterface $input, OutputInterface $output)
 {
     $this->setHelperSet(ConsoleRunner::createHelperSet($this->app->get('doctrine.orm.entity_manager')));
     $this->getHelperSet()->set(new QuestionHelper());
     $this->getHelperSet()->set(new DialogHelper());
     $this->registerCommands();
     $this->io = new ConsoleIO($input, $output, $this->getHelperSet());
     return parent::doRun($input, $output);
 }
开发者ID:Bonscho,项目名称:packages,代码行数:12,代码来源:Application.php

示例3: registerEntityManager

 private function registerEntityManager(Application $app, $serviceName, Connection $connection, Configuration $metadataConfig)
 {
     $app[$serviceName] = $app->share(function () use($app, $connection, $metadataConfig) {
         return EntityManager::create($connection, $metadataConfig);
     });
     // create a console for every manager
     $consoleServiceName = sprintf('%s.console', $serviceName);
     $app[$consoleServiceName] = $app->share(function () use($app, $serviceName) {
         return ConsoleRunner::createApplication(ConsoleRunner::createHelperSet($app[$serviceName]));
     });
 }
开发者ID:everlution,项目名称:silex-doctrine-orm-service,代码行数:11,代码来源:SilexDoctrineOrmServiceProvider.php

示例4: ormCommands

 /**
  * @param $orm
  */
 public function ormCommands($orm)
 {
     if (is_array($orm) && in_array('doctrine', $orm)) {
         /** @var EntityManager $em */
         $em = Model::orm('doctrine')->getOrm();
         $helperSet = ConsoleRunner::createHelperSet($em);
         $this->cli->setCatchExceptions(true);
         $this->cli->setHelperSet($helperSet);
         ConsoleRunner::addCommands($this->cli);
     }
 }
开发者ID:jetfirephp,项目名称:framework,代码行数:14,代码来源:ConsoleProvider.php

示例5: _before

 protected function _before()
 {
     $credentials = new DbCredentials();
     $container = ContainerService::getInstance()->setDbCredentials($credentials)->addEntityPath('src/Entity')->getContainer();
     $em = $container['doctrine.entity_manager'];
     $helperSet = ConsoleRunner::createHelperSet($em);
     $helperSet->set(new DialogHelper(), 'dialog');
     $this->app = new Application();
     $gen = new GenerateProxy();
     $gen->setHelperSet($helperSet);
     $this->app->add($gen);
     $this->app->add(new VersionCommand());
 }
开发者ID:delboy1978uk,项目名称:common,代码行数:13,代码来源:GenerateProxiesTest.php

示例6: _before

 protected function _before()
 {
     $credentials = new DbCredentials();
     $container = ContainerService::getInstance()->setDbCredentials($credentials)->addEntityPath('src/Entity')->getContainer();
     $em = $container['doctrine.entity_manager'];
     $helperSet = ConsoleRunner::createHelperSet($em);
     $helperSet->set(new DialogHelper(), 'dialog');
     $configuration = new Configuration($em->getConnection());
     $configuration->setMigrationsNamespace('Migrations');
     $configuration->setMigrationsTableName('Migration');
     $this->app = new Application();
     $mig = new Migration();
     $mig->setMigrationConfiguration($configuration);
     $this->app->add($mig);
     $this->app->add(new VersionCommand());
 }
开发者ID:delboy1978uk,项目名称:common,代码行数:16,代码来源:MigrationTest.php

示例7: setupDoctrineCommands

 public function setupDoctrineCommands()
 {
     if (!Core::make('app')->isInstalled()) {
         return;
     }
     $helperSet = ConsoleRunner::createHelperSet(\ORM::entityManager('core'));
     $this->setHelperSet($helperSet);
     $migrationsConfiguration = new MigrationsConfiguration();
     /** @var \Doctrine\DBAL\Migrations\Tools\Console\Command\AbstractCommand[] $commands */
     $commands = array(new \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\StatusCommand(), new \Doctrine\DBAL\Migrations\Tools\Console\Command\VersionCommand());
     foreach ($commands as $migrationsCommand) {
         $migrationsCommand->setMigrationConfiguration($migrationsConfiguration);
         $this->add($migrationsCommand);
     }
     ConsoleRunner::addCommands($this);
 }
开发者ID:kreativmind,项目名称:concrete5-5.7.0,代码行数:16,代码来源:Application.php

示例8: indexAction

 public function indexAction()
 {
     if ($this->getRequest() instanceof ConsoleRequest) {
         $params = $this->params()->fromRoute();
         switch ($params['api']) {
             case 'doctrine':
                 global $argv;
                 array_shift($argv);
                 // index.php
                 array_shift($argv);
                 // external
                 $_SERVER['argv'] = $argv;
                 $helperSet = ConsoleRunner::createHelperSet($this->getServiceLocator()->get('Doctrine\\ORM\\EntityManager'));
                 ConsoleRunner::run($helperSet, array());
                 break;
             default:
                 return 'Could not find an option for external tool: ' . $params['api'];
         }
         return '';
     }
     return new ViewModel();
 }
开发者ID:athemcms,项目名称:athcore,代码行数:22,代码来源:IndexController.php

示例9: actionIndex

 public function actionIndex()
 {
     unset($_SERVER['argv'][1]);
     $option = '--' . \yii\console\Application::OPTION_APPCONFIG . '=';
     foreach ($_SERVER['argv'] as $key => $param) {
         if (strpos($param, $option) === 0) {
             $keyToUnset = $key;
             break;
         }
     }
     if (isset($keyToUnset)) {
         unset($_SERVER['argv'][$keyToUnset]);
         unset($keyToUnset);
     }
     // Currently, symfony application uses a deprecated class (DialogHelper).
     // Don't throw an exception.
     $currentLevel = error_reporting();
     error_reporting($currentLevel ^ E_USER_DEPRECATED);
     $doctrine = $this->getDoctrineComponent();
     $entityManager = $doctrine->getEntityManager();
     $helperSet = ConsoleRunner::createHelperSet($entityManager);
     $result = ConsoleRunner::run($helperSet);
     return $result;
 }
开发者ID:iw-reload,项目名称:iw,代码行数:24,代码来源:DoctrineController.php

示例10: dirname

<?php

require dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
use Doctrine\ORM\Tools\Console\ConsoleRunner;
//create database if not exists
$mysqlConfig = NwApi\Libraries\Config::getInstance('mysql');
$mysqli = new mysqli($mysqlConfig->host, $mysqlConfig->user, $mysqlConfig->password, '', $mysqlConfig->port);
if (!$mysqli->query('CREATE DATABASE IF NOT EXISTS ' . $mysqli->real_escape_string($mysqlConfig->database))) {
    throw new Exception('Unable to create database');
}
return ConsoleRunner::createHelperSet(NwApi\Di::getInstance()->em);
开发者ID:petitchevalroux,项目名称:newswatcher-api,代码行数:11,代码来源:cli-config.php

示例11: EntityManager

<?php

require_once __DIR__ . '/../bootstrap.php';
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Nucleus\Config;
use Nucleus\EntityManager;
return ConsoleRunner::createHelperSet((new EntityManager(new Config()))->getEntityManager());
开发者ID:NucleusFramework,项目名称:Nucleus,代码行数:7,代码来源:cli-config.php

示例12:

<?php

require_once "bootstrap.php";
return \Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet($container->get('entityManager'));
开发者ID:destebang,项目名称:taskreporter-1,代码行数:4,代码来源:cli-config.php

示例13:

<?php

require_once "bootstrap.php";
$sm = \Updashd\ServiceManager::getInstance();
return \Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet($sm->get('\\Updashd\\Service\\Doctrine\\EntityManagerService')->getEntityManager());
开发者ID:updashd,项目名称:updashd-api-provider,代码行数:5,代码来源:cli-config.php

示例14:

<?php

$entityManager = (require __DIR__ . '/../bootstrap.php');
return \Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet($entityManager);
开发者ID:OaSiis,项目名称:EasyEticket,代码行数:4,代码来源:cli-config.php

示例15:

<?php

require_once __DIR__ . '/vendor/autoload.php';
$app = new Domora\TvGuide\Application();
\Doctrine\Common\Annotations\AnnotationRegistry::registerLoader('class_exists');
return \Doctrine\ORM\Tools\Console\ConsoleRunner::createHelperSet($app['orm.em']);
开发者ID:nawrasg,项目名称:tvguide,代码行数:6,代码来源:cli-config.php


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