本文整理汇总了PHP中Symfony\Component\HttpKernel\Bundle\Bundle::boot方法的典型用法代码示例。如果您正苦于以下问题:PHP Bundle::boot方法的具体用法?PHP Bundle::boot怎么用?PHP Bundle::boot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\HttpKernel\Bundle\Bundle
的用法示例。
在下文中一共展示了Bundle::boot方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: boot
public function boot()
{
parent::boot();
$this->configure();
if (function_exists('ppm_log')) {
//In an environment like PPM with several workers Propel's not distributed cache will
//lead to inconsistent states across all workers, so we need to disable it here completely.
//Jarves already caches using a distributed cache where all workers are notified when
//a change changes, so we don't really need Propel's cache here.
Propel::disableInstancePooling();
}
if (!$this->booted) {
/** @var ContainerInterface $container */
$container = $this->container;
/** @var $jarves Jarves */
$jarves = $container->get('jarves');
/** @var JarvesConfig $jarvesConfig */
$jarvesConfig = $container->get('jarves.config');
$twig = $container->get('twig');
$twig->addGlobal('jarves_content_render', $container->get('jarves.content.render'));
$twig->addGlobal('pageStack', $container->get('jarves.page_stack'));
if ($jarvesConfig->getSystemConfig()->getLogs(true)->isActive()) {
/** @var $logger \Symfony\Bridge\Monolog\Logger */
$logger = $container->get('logger');
$logger->pushHandler($container->get('jarves.logger.handler'));
}
}
$this->booted = true;
}
示例2: boot
public function boot()
{
parent::boot();
$phingClasspath = __DIR__ . '/Resources/classes';
set_include_path(get_include_path() . PATH_SEPARATOR . $phingClasspath);
//spl_autoload_register(array($this, 'loadPhingClass'));
}
示例3: boot
/**
* Boot the bundle
*
* @throws Exception
*/
public function boot()
{
parent::boot();
if (php_sapi_name() == 'cli') {
return null;
}
$bundleVersion = null;
// need to be installed
if ($this->getNeedInstallation() && $this->container->getParameter('versions.checkNeedInstallation')) {
$bundleVersion = $this->container->get('versions.bundle')->getVersion($this->getName());
if ($bundleVersion->isInstalled() === false) {
if ($this->getName() == 'VersionsBundle') {
$message = 'Bundle "' . $this->getName() . '" needs to be installed. Exec "php app/console bundle:install ' . $this->getName() . ' --force".';
} else {
$message = 'Bundle "' . $this->getName() . '" needs to be installed. Exec "php app/console bundle:install ' . $this->getName() . '".';
}
throw new VersionException($message);
}
}
// need to be updated
if ($this->getNeedUpToDate() && $this->container->getParameter('versions.checkNeedUpToDate')) {
if ($bundleVersion === null) {
$bundleVersion = $this->container->get('versions.bundle')->getVersion($this->getName());
}
if ($bundleVersion->needUpdate()) {
throw new VersionException('Bundle "' . $this->getName() . '" needs to be updated. Exec "php app/console bundle:update ' . $this->getName() . '".');
}
}
}
示例4: boot
public function boot()
{
parent::boot();
//Initialize Config storage for Xacml library
Config::set(Config::ATTRIBUTE_FINDER, $this->container->get('galmi_xacml.pip'));
Config::set(Config::FUNC_REGISTRY, $this->container->get('galmi_xacml_func_registry'));
Config::set(Config::COMBINING_ALGORITHM_REGISTRY, $this->container->get('galmi_xacml_combining_algorithm_registry'));
}
示例5: boot
/**
* {@inheritDoc}
* @see Symfony\Component\HttpKernel\Bundle.Bundle::boot()
*/
public function boot()
{
$em = $this->container->get('doctrine.orm.default_entity_manager');
$discriminatorMapListener = $this->container->get('hexmedia_user.discriminator');
$evm = $em->getEventManager();
$evm->addEventListener(Events::loadClassMetadata, $discriminatorMapListener);
parent::boot();
}
示例6: boot
public function boot()
{
parent::boot();
if ($this->container->getParameter('kernel.debug')) {
//$subscriber = $this->container->get('event_subscriber');
//$this->container->get('event_dispatcher')->addSubscriber($subscriber);
}
}
示例7: boot
/**
* Boots the Bundle.
*/
public function boot()
{
parent::boot();
$swc = $this->container->getParameter('liuggio_rackspace_cloud_files.stream_wrapper.class');
$swc::$service = $this->container->get('liuggio_rackspace_cloud_files.service');
if ($this->container->getParameter('liuggio_rackspace_cloud_files.stream_wrapper.register')) {
$swc::registerStreamWrapperClass($this->container->getParameter('liuggio_rackspace_cloud_files.stream_wrapper.protocol_name'));
}
}
示例8: boot
public function boot()
{
if (!function_exists('bmetrics_increment')) {
require_once __DIR__ . "/../../Metrics/functions.php";
}
parent::boot();
// initialize all collectors
$this->container->get('beberlei_metrics.registry');
}
示例9: boot
/**
* Boots the Bundle.
*/
public function boot()
{
parent::boot();
foreach ($this->subscriberServices as $serviceName) {
/** @var EventSubscriberInterface $subscriber */
$subscriber = $this->container->get($serviceName);
$this->container->get("event_dispatcher")->addSubscriber($subscriber);
}
}
示例10: boot
public function boot()
{
parent::boot();
if (!$this->container->has('windows_azure_distribution.storage_registry')) {
return;
}
// instantiate storage registry, will lead to registration of stream wrappers.
$storageRegistry = $this->container->get('windows_azure_distribution.storage_registry');
}
示例11: boot
public function boot()
{
parent::boot();
if (!Type::hasType(WordpressMetaType::NAME)) {
Type::addType(WordpressMetaType::NAME, 'Kayue\\WordpressBundle\\Types\\WordpressMetaType');
}
if (!Type::hasType(WordpressIdType::NAME)) {
Type::addType(WordpressIdType::NAME, 'Kayue\\WordpressBundle\\Types\\WordpressIdType');
}
}
示例12: boot
/**
* {@inheritDoc}
*/
public function boot()
{
parent::boot();
// Load our annotation if it get's mentioned, Doctrine does not try to autoload it via plain PHP.
AnnotationRegistry::registerLoader(function ($class) {
if (0 === strcmp('Tenside\\CoreBundle\\Annotation\\ApiDescription', $class)) {
class_exists('Tenside\\CoreBundle\\Annotation\\ApiDescription');
return true;
}
return false;
});
}
示例13: boot
public function boot()
{
parent::boot();
if (!Type::hasType(MoneyType::NAME)) {
Type::addType(MoneyType::NAME, 'Tbbc\\MoneyBundle\\Type\\MoneyType');
}
$entityManagerNameList = $this->container->getParameter('doctrine.entity_managers');
foreach ($entityManagerNameList as $entityManagerName) {
$em = $this->container->get($entityManagerName);
if (!$em->getConnection()->getDatabasePlatform()->hasDoctrineTypeMappingFor(MoneyType::NAME)) {
$em->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping(MoneyType::NAME, MoneyType::NAME);
}
}
}
示例14: boot
public function boot()
{
parent::boot();
if (!is_null($this->container->getParameter('ldap_object.host'))) {
$connect = new Connection($this->container->getParameter('ldap_object.host'), $this->container->getParameter('ldap_object.port'));
if (!is_null($this->container->getParameter('ldap_object.dn')) && !is_null($this->container->getParameter('ldap_object.password'))) {
$connect->identify($this->container->getParameter('ldap_object.dn'), $this->container->getParameter('ldap_object.password'));
}
$client = $connect->connect();
$client->setBaseDn($this->container->getParameter('ldap_object.base_dn'));
try {
EntityManager::addEntityManager('default', $client);
} catch (Exception $e) {
// Nothing
}
}
}
示例15: boot
/**
* {@inheritdoc}
*/
public function boot()
{
parent::boot();
$registerErrorHandler = $this->container->getParameter('hautelook_sentry.error_handler.error');
$registerFatalErrorHandler = $this->container->getParameter('hautelook_sentry.error_handler.fatal_error');
if (!$registerErrorHandler && !$registerFatalErrorHandler) {
return;
}
$errorHandler = $this->container->get('hautelook_sentry.error_handler');
/** @var $errorHandler ErrorHandler */
if ($registerErrorHandler) {
$errorHandler->registerErrorHandler();
}
if ($registerFatalErrorHandler) {
$errorHandler->registerShutdownFunction();
}
}