Example #1
0
 /**
  * Register default extensions.
  */
 protected function registerDefaultExtensions()
 {
     parent::registerDefaultExtensions();
     $this->registerDefaultPlugins();
     $config = Yaml::parse(file_get_contents($this->getRootDir() . '/config.yml'));
     $security = isset($config['security']) ? $config['security'] : array();
     $doctrine = isset($config['doctrine']) ? $config['doctrine'] : array();
     $resque = isset($config['resque']) ? $config['resque'] : null;
     $this->appendExtension(new PackagesExtension($this->plugins, array('output_dir' => $this->getRootDir() . '/web', 'resque' => $resque)));
     $this->appendExtension(new DoctrineOrmExtension($doctrine));
     $this->appendExtension(new SessionExtension());
     $this->appendExtension(new TemplatingExtension());
     $this->appendExtension(new TwigExtension());
     $this->appendExtension(new SecurityExtension(array('authenticator' => array('type' => 'username', 'username' => isset($security['username']) ? $security['username'] : null, 'password' => isset($security['password']) ? password_hash($security['password'], PASSWORD_DEFAULT) : null), 'firewall' => '^/manage', 'success_path' => '/manage')));
 }