Exemplo n.º 1
0
 /**
  * Initialize Twig Module
  *
  * @throws Kohana_Exception
  */
 public static function init()
 {
     // Register auto loader
     Twig_Autoloader::register();
     // Load Config
     Twig::$config = Kohana::$config->load('twig');
     // Initialize path
     $path = Twig::$config['environment']['cache'];
     if (!is_dir($path) && !is_writable($path) && !self::_init_cache($path)) {
         throw new Twig_Exception('Directory :dir must exists and be writable', array(':dir' => Debug::path($path)));
     }
 }