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); }
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); }
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); }