/** * Registers services on the given container. * * This method should only be used to configure services and parameters. * It should not get services. * * @param \Pimple $mainContainer An Container instance */ public function register(\Pimple $mainContainer) { $mainContainer['core']['db'] = $mainContainer->share(function () { return \Pelican_Db::getInstance(); }); $mainContainer['core']['listener.ajax_response_render'] = $mainContainer->share(function () { return new AjaxRenderResponseListener(new \Pelican_Ajax_Adapter_Jquery()); }); }
/** * Constructor * * @param ServiceContainer $container * @param ApplicationInterface $app * @param ControllerResolverInterface $resolver */ public function __construct(ServiceContainer $container, ApplicationInterface $app, ControllerResolverInterface $resolver) { \Pelican::$config = $app->getConfig(); parent::__construct($container, $app, $resolver); $this->overridePelicanLoader(); \Pelican_Cache::$eventDispatcher = $container['core']['dispatcher']; \Pelican_Db::$eventDispatcher = $container['core']['dispatcher']; \Pelican_Request::$eventDispatcher = $container['core']['dispatcher']; \Backoffice_Div_Helper::$kernel = $this; $this->resolver->setPath($this->container['config']['APPLICATION_CONTROLLERS']); }