コード例 #1
0
ファイル: exido.php プロジェクト: esironal/exidoengine
 /**
  * Sets an include paths, including the application and system paths.
  * @param array $external_paths
  * @return void
  */
 public static function setIncludePaths(array $external_paths = array())
 {
     // Debug log
     if (self::$log_debug) {
         self::$log->add('EXIDO_DEBUG_LOG', 'Set include paths');
     }
     // Start a new list of include paths, APPPATH first
     self::$_paths = array(APPPATH);
     // Set the currently environment path
     if (is_dir(self::_coreEnvDir())) {
         array_push(self::$_paths, self::_coreEnvDir());
     }
     if (!empty($external_paths)) {
         foreach ($external_paths as $key => $path) {
             // Check if the path exists in the file system
             if (is_dir($path)) {
                 // Add the path to include paths
                 array_push(self::$_paths, $path);
             } else {
                 // The path is invalid, so we just remove it
                 unset($external_paths[$key]);
             }
         }
     }
     // Finish the include paths by adding SYSPATH
     array_push(self::$_paths, SYSPATH);
     self::$_paths = array_unique(array_merge(self::$_paths, explode(':', get_include_path())));
     // Debug log
     if (self::$log_debug) {
         self::$log->add('EXIDO_DEBUG_LOG', 'Included paths: ' . implode(':', self::$_paths));
     }
 }