boot() public method

Boots the Bundle.
public boot ( )
Exemplo n.º 1
0
 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;
 }
 public function boot()
 {
     parent::boot();
     $phingClasspath = __DIR__ . '/Resources/classes';
     set_include_path(get_include_path() . PATH_SEPARATOR . $phingClasspath);
     //spl_autoload_register(array($this, 'loadPhingClass'));
 }
Exemplo n.º 3
0
 /**
  * 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() . '".');
         }
     }
 }
Exemplo n.º 4
0
 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'));
 }
Exemplo n.º 5
0
 /**
  * {@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();
 }
 public function boot()
 {
     parent::boot();
     if ($this->container->getParameter('kernel.debug')) {
         //$subscriber = $this->container->get('event_subscriber');
         //$this->container->get('event_dispatcher')->addSubscriber($subscriber);
     }
 }
 /**
  * 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'));
     }
 }
Exemplo n.º 8
0
 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');
 }
Exemplo n.º 9
0
 /**
  * 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);
     }
 }
 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');
 }
 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');
     }
 }
Exemplo n.º 12
0
 /**
  * {@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;
     });
 }
Exemplo n.º 13
0
 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);
         }
     }
 }
 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
         }
     }
 }
Exemplo n.º 15
0
 /**
  * {@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();
     }
 }
Exemplo n.º 16
0
 public function boot()
 {
     $em = $this->container->get('doctrine.orm.entity_manager');
     EncryptedData::setKey($this->container->getParameter('streamperk.encryption_key'));
     if (Type::hasType('encrypted_data') === false) {
         Type::addType('encrypted_data', 'MadrakIO\\StreamPerk\\Bundle\\CoreBundle\\DataTypes\\EncryptedData');
     }
     if (!$em->getConnection()->getDatabasePlatform()->hasDoctrineTypeMappingFor('encrypted_data')) {
         $em->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping('encrypted_data', 'encrypted_data');
     }
     if (Type::hasType('encrypted_array_data') === false) {
         Type::addType('encrypted_array_data', 'MadrakIO\\StreamPerk\\Bundle\\CoreBundle\\DataTypes\\EncryptedArrayData');
     }
     if (!$em->getConnection()->getDatabasePlatform()->hasDoctrineTypeMappingFor('encrypted_array_data')) {
         $em->getConnection()->getDatabasePlatform()->registerDoctrineTypeMapping('encrypted_array_data', 'encrypted_array_data');
     }
     parent::boot();
 }
 public function boot()
 {
     parent::boot();
     if (!$this->container->hasParameter('knp_gaufrette.stream_wrapper.protocol') || !$this->container->hasParameter('knp_gaufrette.stream_wrapper.filesystems')) {
         return;
     }
     StreamWrapper::register($this->container->getParameter('knp_gaufrette.stream_wrapper.protocol'));
     $wrapperFsMap = StreamWrapper::getFilesystemMap();
     $fileSystems = $this->container->getParameter('knp_gaufrette.stream_wrapper.filesystems');
     /*
      * If there are no filesystems configured to be wrapped,
      * all filesystems within the map will be wrapped.
      */
     if (empty($fileSystems)) {
         $fileSystems = $this->container->get('knp_gaufrette.filesystem_map');
         foreach ($fileSystems as $domain => $fileSystem) {
             $wrapperFsMap->set($domain, $fileSystem);
         }
     } else {
         foreach ($fileSystems as $domain => $fileSystem) {
             $wrapperFsMap->set($domain, $this->container->get('knp_gaufrette.filesystem_map')->get($fileSystem));
         }
     }
 }
Exemplo n.º 18
0
 public function boot()
 {
     MimeTypeGuesser::getInstance()->register(new FileinfoMimeTypeGuesser());
     parent::boot();
 }
 public function boot()
 {
     parent::boot();
     $this->getContainer()->get('hoathis.locator.wrapper')->init();
 }
Exemplo n.º 20
0
 public function boot()
 {
     parent::boot();
 }
 public function boot()
 {
     parent::boot();
     date_default_timezone_set('UTC');
 }