static function get_version() { if (file::get_folder_path('framework') === false) { return; } return @file_get_contents(get_file('framework', 'VERSION')->get_path()); }
public function get_write_path() { $folder_path = file::get_folder_path($this->folder); if ($folder_path === false) { common::error("Unknown folder ID: " . $this->folder); } $relative = $path[0] != '/' && strpos($path, ':') === false; return ($relative ? PATH_TO_ROOT_WRITE : '') . $folder_path . $this->name; }
static function directories() { if (!config::config_exists()) { return array(); } $return = array(); foreach (config::search('/^folder_/') as $id => $path) { $id = substr($id, 7); $return[$id] = array("path" => $path); $return[$id]["write_required"] = $id == 'data' || $id == 'compiled' || $id == 'cached' || $id == 'dcss_compiled' || $id == 'form_compiled'; $return[$id]["exists"] = file::get_folder_path($id) !== false && @is_dir(get_file($id, '')->get_path()); $return[$id]["writable"] = @is_writable(get_file($id, '')->get_path()); $return[$id]["updatable"] = @is_writable(get_file($id, '')->get_write_path()); } return $return; }