本文整理汇总了PHP中Symfony\Bundle\FrameworkBundle\Console\Application::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::__construct方法的具体用法?PHP Application::__construct怎么用?PHP Application::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Bundle\FrameworkBundle\Console\Application
的用法示例。
在下文中一共展示了Application::__construct方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*
* @param KernelInterface $kernel A KernelInterface instance
*/
public function __construct(KernelInterface $kernel)
{
parent::__construct($kernel);
$this->kernel = $kernel;
$this->setName('Zikula');
$this->setVersion(\Zikula_Core::VERSION_NUM . ' - ' . $kernel->getName() . '/' . $kernel->getEnvironment() . ($kernel->isDebug() ? '/debug' : ''));
}
示例2: __construct
public function __construct(KernelInterface $kernel)
{
parent::__construct($kernel);
$this->getDefinition()->addOption(new InputOption('--jms-job-id', null, InputOption::VALUE_REQUIRED, 'The ID of the Job.'));
$kernel->boot();
if ($kernel->getContainer()->getParameter('jms_job_queue.statistics')) {
$this->insertStatStmt = $this->getConnection()->prepare("INSERT INTO jms_job_statistics (job_id, characteristic, createdAt, charValue) VALUES (:jobId, :name, :createdAt, :value)");
register_tick_function(array($this, 'onTick'));
}
}
示例3: __construct
/**
* {@inheritdoc}
*/
public function __construct(KernelInterface $kernel)
{
parent::__construct($kernel);
$this->setName('Rainmaker CLI');
$this->setVersion('1.x-dev');
$this->setDefaultTimezone();
$this->getCommands();
$this->addCommands($this->getCommands());
$this->setDefaultCommand('welcome');
}
示例4: __construct
public function __construct(KernelInterface $kernel)
{
parent::__construct($kernel);
// Boot kernel now
$kernel->boot();
// Get container
$container = $kernel->getContainer();
// Figure out environment
$envName = $container->getParameter('kernel.environment');
$releaseStage = $envName == 'prod' ? 'production' : $envName;
// Setup Bugsnag to handle our errors
\Bugsnag::register($container->getParameter('bugsnag.api_key'));
\Bugsnag::setReleaseStage($releaseStage);
\Bugsnag::setNotifyReleaseStages($container->getParameter('bugsnag.notify_stages'));
\Bugsnag::setProjectRoot(realpath($container->getParameter('kernel.root_dir') . '/..'));
// Attach to support reporting PHP errors
set_error_handler("\\Bugsnag::errorHandler");
}
示例5: __construct
public function __construct(KernelInterface $kernel)
{
parent::__construct($kernel);
$this->getDefinition()->addOption(new InputOption('--siteaccess', null, InputOption::VALUE_OPTIONAL, 'SiteAccess to use for operations. If not provided, default siteaccess will be used'));
}
示例6: __construct
/**
* @param string $appDir
* @param string $env
* @param string $debug
*/
public function __construct($appDir, $env, $debug = true)
{
FrameworkApplication::__construct(new \ToolsKernel($appDir, $env, $debug));
ConsoleApplication::__construct(self::NAME, self::VERSION);
}
示例7: __construct
/**
* Constructs SK ITC Bundle Application Console
*
* @param KernelInterface $kernel
* @param string $name
* @param string $version
*/
public function __construct(KernelInterface $kernel, $name = 'ITCloud Console', $version = '${project.version}')
{
parent::__construct($kernel);
$this->setName($name);
$this->setVersion($version);
}