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


PHP Bundle::boot方法代码示例

本文整理汇总了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;
 }
开发者ID:jarves,项目名称:jarves,代码行数:29,代码来源:JarvesBundle.php

示例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'));
 }
开发者ID:rhapsody-project,项目名称:phing-bundle,代码行数:7,代码来源:RhapsodyPhingBundle.php

示例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() . '".');
         }
     }
 }
开发者ID:kujaff,项目名称:versionsbundle,代码行数:34,代码来源:VersionnedBundle.php

示例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'));
 }
开发者ID:galmi,项目名称:xacmlBundle,代码行数:8,代码来源:GalmiXacmlBundle.php

示例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();
 }
开发者ID:hexmedia,项目名称:user-bundle,代码行数:12,代码来源:HexmediaUserBundle.php

示例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);
     }
 }
开发者ID:jadeit,项目名称:catalogd-bundle,代码行数:8,代码来源:JadeITCatalogDBundle.php

示例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'));
     }
 }
开发者ID:renegare,项目名称:RackspaceCloudFilesBundle,代码行数:12,代码来源:LiuggioRackspaceCloudFilesBundle.php

示例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');
 }
开发者ID:rcambien,项目名称:metrics,代码行数:9,代码来源:BeberleiMetricsBundle.php

示例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);
     }
 }
开发者ID:StasPiv,项目名称:playzone,代码行数:12,代码来源:CoreBundle.php

示例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');
 }
开发者ID:nmariani,项目名称:AzureDistributionBundle,代码行数:9,代码来源:WindowsAzureDistributionBundle.php

示例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');
     }
 }
开发者ID:ninodafonte,项目名称:KayueWordpressBundle,代码行数:10,代码来源:KayueWordpressBundle.php

示例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;
     });
 }
开发者ID:tenside,项目名称:core-bundle,代码行数:15,代码来源:TensideCoreBundle.php

示例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);
         }
     }
 }
开发者ID:stalxed,项目名称:TbbcMoneyBundle,代码行数:14,代码来源:TbbcMoneyBundle.php

示例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
         }
     }
 }
开发者ID:toshy62,项目名称:ldapobjectbundle,代码行数:17,代码来源:Toshy62LdapObjectBundle.php

示例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();
     }
 }
开发者ID:hjr3,项目名称:SentryBundle,代码行数:20,代码来源:HautelookSentryBundle.php


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