Path
A Path handling class
since |
1.7.0 |
---|---|
deprecated |
4.4 will be removed in 6.0 Use Joomla\Filesystem\Path instead. |
package |
Joomla CMS |
Methods
canChmod
Checks if a path's permissions can be changed.
canChmod( path) :
since |
1.7.0 |
---|---|
deprecated |
4.4 will be removed in 6.0 Use Joomla\Filesystem\Path::canChmod() instead. |
Arguments
- path
string
Path to check.
Response
bool
True if path can have mode changed.
check
Checks for snooping outside of the file system root.
check( path) :
throws |
|
---|---|
since |
1.7.0 |
deprecated |
4.4 will be removed in 6.0 Use Joomla\Filesystem\Path::check() instead. |
Arguments
- path
string
A file system path to check.
Response
string
A cleaned version of the path or exit on error.
clean
Function to strip additional / or \ in a path name.
clean( path, ds = DIRECTORY_SEPARATOR) :
throws |
|
---|---|
since |
1.7.0 |
deprecated |
4.4 will be removed in 6.0 Use Joomla\Filesystem\Path::clean() instead. |
Arguments
- path
string
The path to clean.- ds
string
Directory separator (optional).
Response
string
The cleaned path.
find
Searches the directory paths for a given file.
find( paths, file) :
since |
1.7.0 |
---|---|
deprecated |
4.4 will be removed in 6.0 Use Joomla\Filesystem\Path::find() instead. |
Arguments
- paths
mixed
A path string or array of path strings to search in- file
string
The file name to look for.
Response
mixed
The full path and file name for the target file, or boolean false if the file is not found in any of the paths.
getPermissions
Get the permissions of the file/folder at a given path.
getPermissions( path) :
since |
1.7.0 |
---|---|
deprecated |
4.4 will be removed in 6.0 Use Joomla\Filesystem\Path::getPermissions() instead. The framework class throws Exceptions in case of error which you have to catch. |
Arguments
- path
string
The path of a file/folder.
Response
string
Filesystem permissions.
isOwner
Method to determine if script owns the path.
isOwner( path) :
since |
1.7.0 |
---|---|
deprecated |
4.4 will be removed in 6.0 Use Joomla\Filesystem\Path::isOwner() instead. |
Arguments
- path
string
Path to check ownership.
Response
bool
True if the php script owns the path passed.
removeRoot
Remove all references to root directory path and the system tmp path from a message
removeRoot( message, rootDirectory = null) :
since |
3.10.7 |
---|---|
deprecated |
4.4 will be removed in 6.0 Use Joomla\Filesystem\Path::removeRoot() instead. |
Arguments
- message
string
The message to be cleaned- rootDirectory
string
Optional root directory, defaults to JPATH_ROOT
Response
string
resolve
Resolves /./, /../ and multiple / in a string and returns the resulting absolute path, inspired by Flysystem Removes trailing slashes
resolve( path) :
since |
3.9.25 |
---|---|
deprecated |
4.4 will be removed in 6.0 Use Joomla\Filesystem\Path::resolve() instead. |
Arguments
- path
string
A path to resolve
Response
string
The resolved path
setPermissions
Chmods files and directories recursively to given permissions.
setPermissions( path, filemode = '0644', foldermode = '0755') :
since |
1.7.0 |
---|---|
deprecated |
4.4 will be removed in 6.0 Use Joomla\Filesystem\Path::setPermissions() instead. |
Arguments
- path
string
Root path to begin changing mode [without trailing slash].- filemode
string
Octal representation of the value to change file mode to [null = no change].- foldermode
string
Octal representation of the value to change folder mode to [null = no change].
Response
bool
True if successful [one fail means the whole operation failed].