Exemple #1
0
 /**
  * Register the extensions Composer JSON and a matching Bolt name.
  * This allows reverse lookup of Bolt name to Composer name
  *
  * @param BaseExtensionInterface $extension
  */
 private function registerComposerJson(BaseExtensionInterface $extension)
 {
     $json = new JsonFile($extension->getBasepath() . '/composer.json');
     $composerjson = $json->read();
     $this->app['extensions']->composer[strtolower($composerjson['name'])] = array('name' => $extension->getName(), 'json' => $composerjson);
 }
Exemple #2
0
 protected function initializeExtension(BaseExtensionInterface $extension)
 {
     $name = $extension->getName();
     try {
         $extension->getConfig();
         $extension->initialize();
         $this->initialized[$name] = $extension;
         $this->getSnippets($name);
         if ($extension instanceof \Twig_Extension) {
             $this->app['twig']->addExtension($extension);
             if (!empty($info['allow_in_user_content'])) {
                 $this->app['safe_twig']->addExtension($extension);
             }
         }
     } catch (\Exception $e) {
     }
 }