Ejemplo n.º 1
0
 private function _twigInit()
 {
     if ($this->config->item('enable_twig')) {
         $twigDirectory = $this->config->item('twig_dir');
         if (!$twigDirectory) {
             $twigDirectory = 'twig';
         }
         $templatesPath = APPPATH . $twigDirectory;
         $this->_twigPath = realpath($templatesPath);
         $extensions = $this->config->item('twig_extensions');
         $env = ConfigResolver::getShortEnv(ENVIRONMENT);
         if (class_exists('\\Twig_Loader_Filesystem')) {
             $loader = new \Twig_Loader_Filesystem($templatesPath);
             $this->_twig = new Loader($loader, array('debug' => $env != 'prod', 'cache' => APPPATH . 'cache' . DIRECTORY_SEPARATOR . $env), $this, $extensions);
         } else {
             show_error('Twig is not installed. Install Twig first by run the command "composer update twig/twig"');
         }
     } else {
         $this->_twig = new Dummy();
     }
 }
 public function __construct(ConfigResolver $kernel)
 {
     parent::__construct('Cdeigniter Extended', $kernel->getVersion() . '-' . $kernel->getEnvironment() . ($kernel->isDebug() ? '/debug' : ''));
     $this->getDefinition()->addOption(new InputOption('--env', '-e', InputOption::VALUE_REQUIRED, 'The Environment name.', $kernel->getEnvironment()));
     $this->getDefinition()->addOption(new InputOption('--no-debug', null, InputOption::VALUE_NONE, 'Switches off debug mode.'));
 }