protected static function setDebug(array $config)
 {
     if (isset($config['debug'])) {
         self::$debug = $config['debug'];
     }
     if (self::$debug) {
         self::$log_file = __DIR__ . '/debug.log';
     }
 }
 public static function init(array $config)
 {
     if (isset($config['debug'])) {
         self::$debug = $config['debug'];
     }
     if (self::$debug) {
         self::$log_file = __DIR__ . '/debug.log';
     }
     if (isset($config['php_parser'])) {
         self::$php_parser = constant('PhpParser\\ParserFactory::' . $config['php_parser']);
     }
     if (isset($config['root_dir'])) {
         Cache::setProjectRootDir($config['root_dir']);
     } else {
         // APPPATH is constant in CodeIgniter
         Cache::setProjectRootDir(APPPATH . '../');
     }
     if (!isset($config['cache_dir'])) {
         throw new LogicException('You have to set "cache_dir"');
     }
     self::setCacheDir($config['cache_dir']);
     if (!isset($config['include_paths'])) {
         throw new LogicException('You have to set "include_paths"');
     }
     self::setIncludePaths($config['include_paths']);
     if (isset($config['exclude_paths'])) {
         self::setExcludePaths($config['exclude_paths']);
     }
     Cache::createTmpListDir();
     if (isset($config['patcher_list'])) {
         self::setPatcherList($config['patcher_list']);
     }
     self::checkPatcherListUpdate();
     self::checkPathsUpdate();
     self::loadPatchers();
     self::addTmpFunctionBlacklist();
     if (isset($config['functions_to_patch'])) {
         FunctionPatcher::addWhitelists($config['functions_to_patch']);
     }
     self::checkFunctionWhitelistUpdate();
     FunctionPatcher::lockFunctionList();
     if (isset($config['exit_exception_classname'])) {
         self::setExitExceptionClassname($config['exit_exception_classname']);
     }
     // Register include stream wrapper for monkey patching
     self::wrap();
 }
 public static function init(array $config)
 {
     if (isset($config['debug'])) {
         self::$debug = $config['debug'];
     }
     if (self::$debug) {
         self::$log_file = __DIR__ . '/debug.log';
     }
     if (!isset($config['cache_dir'])) {
         throw new LogicException('You have to set "cache_dir"');
     }
     self::setCacheDir($config['cache_dir']);
     if (!isset($config['include_paths'])) {
         throw new LogicException('You have to set "include_paths"');
     }
     self::setIncludePaths($config['include_paths']);
     if (isset($config['exclude_paths'])) {
         self::setExcludePaths($config['exclude_paths']);
     }
     Cache::createTmpListFiles();
     if (isset($config['patcher_list'])) {
         self::setPatcherList($config['patcher_list']);
     }
     self::checkPatcherListUpdate();
     self::checkPathsUpdate();
     self::loadPatchers();
     self::addTmpFunctionBlacklist();
     if (isset($config['functions_to_patch'])) {
         FunctionPatcher::addWhitelists($config['functions_to_patch']);
     }
     self::checkFunctionWhitelistUpdate();
     FunctionPatcher::lockFunctionList();
     if (isset($config['exit_exception_classname'])) {
         self::setExitExceptionClassname($config['exit_exception_classname']);
     }
     // Register include stream wrapper for monkey patching
     self::wrap();
 }