public function attach(EventManagerInterface $events)
 {
     $this->listener = $events->attach(MvcEvent::EVENT_BOOTSTRAP, function (MvcEvent $e) {
         $serviceManager = $e->getApplication()->getServiceManager();
         $facadeServiceLocator = new ServiceLocatorAdapter($serviceManager);
         FacadeLoader::init($facadeServiceLocator, $this->aliases);
     }, 2);
 }
Example #2
0
 public function register(Container $pimple)
 {
     if ($pimple->offsetExists('facade.aliases')) {
         $aliases = $pimple->offsetGet('facade.aliases');
     } else {
         $aliases = null;
     }
     $facadeServiceLocator = new ArrayAccessAdapter($pimple);
     FacadeLoader::init($facadeServiceLocator, $aliases);
 }
Example #3
0
 public function boot()
 {
     if ($this->container->hasParameter('facade.aliases')) {
         $aliases = $this->container->getParameter('facade.aliases');
     }
     if (empty($aliases) || !is_array($aliases)) {
         $aliases = null;
     }
     $facadeServiceLocator = new ServiceLocatorAdapter($this->container);
     FacadeLoader::init($facadeServiceLocator, $aliases);
 }