本文整理汇总了PHP中Symfony\Component\Console\Application::setCatchExceptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::setCatchExceptions方法的具体用法?PHP Application::setCatchExceptions怎么用?PHP Application::setCatchExceptions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Console\Application
的用法示例。
在下文中一共展示了Application::setCatchExceptions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setupConsoleApplication
/**
* Setup symfonys consoles application
*
* @return ConsoleApplication
*/
public function setupConsoleApplication()
{
$this->consoleApplication = new ConsoleApplication();
$this->consoleApplication->setCatchExceptions(false);
$this->setupConsoleCommands();
return $this->consoleApplication;
}
示例2: 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);
}
}
示例3: createConsole
/**
* Creates console.
*
* @param HelperSet $helperSet
* @param \Symfony\Component\Console\Command\Command[] $commands
* @return Application
*/
public function createConsole(HelperSet $helperSet, array $commands)
{
$cli = new Application($this->getName(), $this->getVersion());
$cli->setCatchExceptions(true);
$cli->setHelperSet($helperSet);
$cli->addCommands($commands);
return $cli;
}
示例4: run
/**
* Run console with the given helperset.
*
* @param \Symfony\Component\Console\Helper\HelperSet $helperSet
* @return void
*/
public static function run(HelperSet $helperSet)
{
$cli = new Application('Propel Command Line Tool', \PropelCli\Version::VERSION);
$cli->setCatchExceptions(true);
$cli->setHelperSet($helperSet);
self::addCommands($cli);
$cli->run();
}
示例5: run
/**
* Run console with the given helperset.
*
* @param \Symfony\Component\Console\Helper\HelperSet $helperSet
* @return void
*/
public static function run(HelperSet $helperSet)
{
$cli = new Application('Doctrine Command Line Interface', \Doctrine\ORM\Version::VERSION);
$cli->setCatchExceptions(true);
$cli->setHelperSet($helperSet);
self::addCommands($cli);
$cli->run();
}
示例6: run
public function run($config)
{
$cli = new Application('Schema Roller', Version::VERSION);
$cli->setCatchExceptions(true);
self::addHelperSets($cli, $config);
self::addCommands($cli);
$cli->run();
}
示例7: run
/**
* @param HelperSet $helperSet
* @param array $commands
*/
public static function run(HelperSet $helperSet, $commands = array())
{
$cli = new \Symfony\Component\Console\Application('Malocher EventStore CLI', self::VERSION);
$cli->setHelperSet($helperSet);
$cli->setCatchExceptions(true);
self::addCommands($cli);
$cli->run();
}
示例8: run
/**
* Run console with the given helperset.
*
* @param \Symfony\Component\Console\Helper\HelperSet $helperSet
* @param \Symfony\Component\Console\Command\Command[] $commands
* @return void
*/
public static function run($commands = array())
{
$cli = new Application('Doctrine to XSD Command Line Interface', "1.0");
$cli->setCatchExceptions(true);
self::addCommands($cli);
$cli->addCommands($commands);
$cli->run();
}
示例9: createApplication
/**
* Creates a console application with the given helperset and
* optional commands.
*
* @param \Symfony\Component\Console\Helper\HelperSet $helperSet
* @param array $commands
*
* @return \Symfony\Component\Console\Application
*/
public static function createApplication(HelperSet $helperSet, $commands = array())
{
$cli = new Application('Doctrine Command Line Interface', Version::VERSION);
$cli->setCatchExceptions(true);
$cli->setHelperSet($helperSet);
self::addCommands($cli);
$cli->addCommands($commands);
return $cli;
}
示例10: run
/**
* Runs console with the given helperset.
*
* @param HelperSet $helperSet
* @param \Symfony\Component\Console\Command\Command[] $commands
*
* @return void
*/
public static function run(HelperSet $helperSet, $commands = array())
{
$cli = new Application('PoolDBM Command Line Interface', Version::VERSION);
$cli->setCatchExceptions(true);
$cli->setHelperSet(new HelperSet($helperSet));
self::addDefaultCommands($cli);
$cli->addCommands($commands);
$cli->run();
}
示例11: createApplication
/**
* Creates a console application with the given helperset and
* optional commands.
*
* @param \Symfony\Component\Console\Helper\HelperSet $helperSet
* @param array $commands
*
* @return \Symfony\Component\Console\Application
*/
public static function createApplication(HelperSet $helperSet, $commands = [])
{
$cli = new Application('Doctrine Migrations', MigrationsVersion::VERSION());
$cli->setCatchExceptions(true);
$cli->setHelperSet($helperSet);
self::addCommands($cli);
$cli->addCommands($commands);
return $cli;
}
示例12: createApplication
/**
* Creates a console application with the given helperset and
* optional commands.
*
* @param HelperSet $helperSet
* @param \Symfony\Component\Console\Command\Command[] $commands
*
* @return Application
*/
public static function createApplication(HelperSet $helperSet, $commands = [])
{
$cli = new Application('Humus Amqp Command Line Interface');
$cli->setCatchExceptions(true);
$cli->setHelperSet($helperSet);
self::addCommands($cli);
$cli->addCommands($commands);
return $cli;
}
示例13: register
/**
* {@inheritDoc}
*/
public function register(Application $app)
{
$app['console'] = $app->share(function ($app) {
$consoleApp = new ConsoleApplication();
// disable swallowing exceptions so they actually get pushed to the logger
$consoleApp->setCatchExceptions(false);
return $consoleApp;
});
}
示例14: run
/**
* Runs console with the given helperset.
*
* @param \Symfony\Component\Console\Helper\HelperSet $helperSet
* @param \Symfony\Component\Console\Command\Command[] $commands
*
* @return void
*/
public static function run(HelperSet $helperSet, $commands = array(), OutputInterface $output = null)
{
$cli = new Application('Doctrine Command Line Interface', Version::VERSION);
$cli->setCatchExceptions(true);
$cli->setHelperSet($helperSet);
$cli->setAutoExit(false);
$commands = array_merge(self::getDefaultCommands(), $commands);
$cli->addCommands($commands);
$cli->run(null, $output);
}
示例15: __invoke
/**
* {@inheritDoc}
* @return Application
*/
public function __invoke(ContainerInterface $container, $requestedName, array $options = null)
{
$cli = new Application();
$cli->setName('DoctrineModule Command Line Interface');
$cli->setVersion(Version::VERSION);
$cli->setHelperSet(new HelperSet());
$cli->setCatchExceptions(true);
$cli->setAutoExit(false);
// Load commands using event
$this->getEventManager($container)->trigger('loadCli.post', $cli, array('ServiceManager' => $container));
return $cli;
}