/** * Get all include paths. APPPATH is the first path, followed by module * paths in the order they are configured, follow by the SYSPATH. * * @param boolean re-process the include paths * @return array */ public static function include_paths($process = FALSE) { if ($process === TRUE) { // Add APPPATH as the first path self::$include_paths = array(CSSPATH, SYSPATH . 'modules', PLUGINS); # Find the modules and plugins installed $modules = self::list_files('modules', FALSE, SYSPATH . 'modules'); $plugins = self::list_files('plugins', FALSE, PLUGINS); foreach (array_merge($plugins, $modules) as $path) { $path = str_replace('\\', '/', realpath($path)); if (is_dir($path)) { // Add a valid path self::$include_paths[] = $path . '/'; } } // Add SYSPATH as the last path self::$include_paths[] = SYSPATH; self::$include_paths[] = SCAFFOLD; } return self::$include_paths; }