本文整理汇总了PHP中Alchemy\Phrasea\Application::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Application::__construct方法的具体用法?PHP Application::__construct怎么用?PHP Application::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Alchemy\Phrasea\Application
的用法示例。
在下文中一共展示了Application::__construct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Registers the autoloader and necessary components.
*
* @param string $name Name for this application.
* @param string|null $version Version number for this application.
* @param string|null $environment The environment.
*/
public function __construct($name, $version = null, $environment = self::ENV_PROD)
{
parent::__construct($environment);
$app = $this;
$this['session.test'] = true;
$this['console'] = $this->share(function () use($name, $version) {
return new Console\Application($name, $version);
});
$this['dispatcher'] = $this->share($this->extend('dispatcher', function (EventDispatcher $dispatcher, Application $app) {
$dispatcher->addListener('phraseanet.notification.sent', function () use($app) {
$app['swiftmailer.spooltransport']->getSpool()->flushQueue($app['swiftmailer.transport']);
});
$dispatcher->addSubscriber(new BridgeSubscriber($app));
return $dispatcher;
}));
$this->register(new PluginServiceProvider());
$this->register(new WebsocketServerServiceProvider());
$this->register(new ComposerSetupServiceProvider());
$this->register(new CLIDriversServiceProvider());
$this->register(new LessBuilderServiceProvider());
$this->register(new SignalHandlerServiceProvider());
$this->register(new TaskManagerServiceProvider());
$this->register(new TranslationExtractorServiceProvider());
$this->register(new DoctrineMigrationServiceProvider());
$this->bindRoutes();
error_reporting(-1);
ErrorHandler::register();
PhraseaCLIExceptionHandler::register();
}