public function beforeCompile()
 {
     parent::beforeCompile();
     $container = $this->getContainerBuilder();
     $config = $this->getConfig($this->defaults);
     $securityManager = $container->getDefinition('cms.securityManager');
     $securityManager->addSetup('addSocialLogin', array($config['facebook']['name'], $this->prefix('facebookLogin')));
 }
Beispiel #2
0
 public function afterCompile(\Nette\Utils\PhpGenerator\ClassType $class)
 {
     parent::afterCompile($class);
     $initialize = $class->methods['initialize'];
     foreach ($this->getSortedServices('subscriber') as $item) {
         $initialize->addBody('$this->getService("eventManager")->addEventSubscriber($this->getService(?));', array($item));
     }
     $initialize->addBody('$this->parameters[\'baseUrl\'] = rtrim($this->getService("httpRequest")->getUrl()->getBaseUrl(), "/");');
     $initialize->addBody('$this->parameters[\'basePath\'] = preg_replace("#https?://[^/]+#A", "", $this->parameters["baseUrl"]);');
 }