/** * Get the names of all the sections in the configuration * @return array Array with the names of all the ini files in the configuration directory, withouth the extension */ public function getAllSections() { $sections = array(); $includePaths = $this->browser->getIncludePaths(); foreach ($includePaths as $includePath) { $path = new File($includePath, Zibo::DIRECTORY_CONFIG); $sections = Structure::merge($sections, $this->getDirectorySections($path)); } $path = new File($this->getEnvironmentPath()); $sections = Structure::merge($sections, $this->getDirectorySections($path)); return $sections; }
/** * Autoloads the provided class * @param string $class full class name with namespace * @return boolean true if succeeded, false otherwise */ public function autoload($class) { $class = str_replace(array('\\', '_'), File::DIRECTORY_SEPARATOR, $class) . '.php'; $file = $this->browser->getFile(Zibo::DIRECTORY_SOURCE . File::DIRECTORY_SEPARATOR . $class); if ($file) { include_once $file->getPath(); return true; } $file = $this->browser->getFile(Zibo::DIRECTORY_VENDOR . File::DIRECTORY_SEPARATOR . $class); if ($file) { include_once $file->getPath(); return true; } $directories = explode(PATH_SEPARATOR, get_include_path()); foreach ($directories as $directory) { $file = realpath($directory) . DIRECTORY_SEPARATOR . $class; if (file_exists($file)) { include_once $file; return true; } } return false; }
/** * Reinitialize the file browser * @return null */ public function resetFileBrowser() { $this->browser->reset(); }