Class JPath
Methods summary
public static
boolean
|
#
canChmod( string $path )
Checks if a path's permissions can be changed.
Checks if a path's permissions can be changed.
Parameters
- $path
string - $path Path to check.
Returns
boolean - True if path can have mode changed.
Since
11.1
|
public static
boolean
|
#
setPermissions( string $path, string $filemode = '0644', string $foldermode = '0755' )
Chmods files and directories recursively to given permissions.
Chmods files and directories recursively to given permissions.
Parameters
- $path
string - $path Root path to begin changing mode [without trailing slash].
- $filemode
string - $filemode Octal representation of the value to change file mode to [null = no
change].
- $foldermode
string - $foldermode Octal representation of the value to change folder mode to [null =
no change].
Returns
boolean - True if successful [one fail means the whole operation failed].
Since
11.1
|
public static
string
|
#
getPermissions( string $path )
Get the permissions of the file/folder at a given path.
Get the permissions of the file/folder at a given path.
Parameters
- $path
string - $path The path of a file/folder.
Returns
string - Filesystem permissions.
Since
11.1
|
public static
string
|
#
check( string $path )
Checks for snooping outside of the file system root.
Checks for snooping outside of the file system root.
Parameters
- $path
string - $path A file system path to check.
Returns
string - A cleaned version of the path or exit on error.
Throws
Since
11.1
|
public static
string
|
#
clean( string $path, string $ds = DIRECTORY_SEPARATOR )
Function to strip additional / or \ in a path name.
Function to strip additional / or \ in a path name.
Parameters
- $path
string - $path The path to clean.
- $ds
string - $ds Directory separator (optional).
Returns
string - The cleaned path.
Throws
Since
11.1
|
public static
boolean
|
#
isOwner( string $path )
Method to determine if script owns the path.
Method to determine if script owns the path.
Parameters
- $path
string - $path Path to check ownership.
Returns
boolean - True if the php script owns the path passed.
Since
11.1
|
public static
mixed
|
#
find( mixed $paths, string $file )
Searches the directory paths for a given file.
Searches the directory paths for a given file.
Parameters
- $paths
mixed - $paths An path string or array of path strings to search in
- $file
string - $file The file name to look for.
Returns
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.
Since
11.1
|
Magic methods summary