public static function rootPath($directory) {
        $num = count(explode("/", $directory));
        $path = "";
        for ($i = 0; $i < $num; $i++)
            $path = self::join("..", $path);
        return $path;
    }
public static function rootPath($directory) {
        $num = count(explode("/", $directory));
        $path = "";
        for ($i = 0; $i < $num; $i++)
            $path = self::join("..", $path);
        return $path;
    }
public static function rootPath ( $ directory ) { $ num = count ( explode ( "/" , $ directory ) ) ; $ path = "" ; for ( $ i = 0 ; $ i < $ num ; $ i ++ ) $ path = self :: join ( ".." , $ path ) ; return $ path ; }
Builds a path referring to the root directory from a relative path.
@param string $directory
return string
Builds a path referring to the root directory from a relative path .