/** * Returns the REAL path (based from the current working root) * * @param $path * * @return null|string */ public static function RealPath($path) { if (is_string($path)) { if (PathFinder::$path_scope == null) { /** * If this file does exist, read from it! To save the memory! */ $obtained_path = PathFinder::ParsePath(getcwd()) . PathFinder::$source_folder; /** * If it exists. */ if (FileMethods::FileExists($obtained_path . "Json/resource/filepath.json")) { PathFinder::$path_scope = PathFinder::ReadSavedPath($obtained_path)['path']; } else { /** * If not, write this path for the FUTURE! */ PathFinder::SavePath($obtained_path); /** * Then lets set the current path */ PathFinder::$path_scope = $obtained_path; } /** * assuming everything worked out, we can now output */ return PathFinder::$path_scope . $path; } /** * Assuming we have a path, we can just return that shit */ return PathFinder::$path_scope . $path; } return null; }