Inherited Variables
Inherited Constants
Inherited Methods
Class Details
URL utility class
This class provides methods to deal with encoding and decoding url (percent encoded) strings.
It was not possible to use PHP's built-in methods for this, because some clients don't like encoding of certain characters.
Specifically, it was found that GVFS (gnome's webdav client) does not like encoding of ( and ). Since these are reserved, but don't have a reserved meaning in url, these characters are kept as-is.
[ Top ]
Class Variables
Class Methods
static decodePath
static string decodePath(
string
$path)
[line 88]
Decodes a url-encoded path
Parameters:
- string $path -
[ Top ]
static decodePathSegment
static string decodePathSegment(
string
$path)
[line 100]
Decodes a url-encoded path segment
Parameters:
- string $path -
[ Top ]
static encodePath
static string encodePath(
string
$path)
[line 34]
Encodes the path of a url.
slashes (/) are treated as path-separators.
Parameters:
- string $path -
[ Top ]
static encodePathSegment
static string encodePathSegment(
string
$pathSegment)
[line 49]
Encodes a 1 segment of a path
Slashes are considered part of the name, and are encoded as %2f
Parameters:
- string $pathSegment -
[ Top ]
static splitPath
static array splitPath(
string
$path)
[line 133]
Returns the 'dirname' and 'basename' for a path.
The reason there is a custom function for this purpose, is because basename() is locale aware (behaviour changes if C locale or a UTF-8 locale is used) and we need a method that just operates on UTF-8 characters.
In addition basename and dirname are platform aware, and will treat backslash (\) as a directory separator on windows.
This method returns the 2 components as an array.
If there is no dirname, it will return an empty string. Any / appearing at the end of the string is stripped off.
Parameters:
- string $path -
[ Top ]