class JPath


Located at : UKNOWVA_ROOT/libraries/joomla/filesystem/path.php

A Path handling class

Methods

static boolean
canChmod(string $path)

Checks if a path's permissions can be changed

static boolean
setPermissions(string $path, string $filemode = '0644', string $foldermode = '0755')

Chmods files and directories recursivly to given permissions

static string
getPermissions(string $path)

Get the permissions of the file/folder at a give path

static string
check(string $path, string $ds = DIRECTORY_SEPARATOR)

Checks for snooping outside of the file system root

static string
clean(string $path, string $ds = DIRECTORY_SEPARATOR)

Function to strip additional / or \ in a path name

static boolean
isOwner(string $path)

Method to determine if script owns the path

static mixed
find(mixed $paths, string $file)

Searches the directory paths for a given file.

Details

at line 46
static boolean canChmod(string $path)

Checks if a path's permissions can be changed

Parameters

string $path Path to check

Return Value

boolean True if path can have mode changed

at line 69
static boolean setPermissions(string $path, string $filemode = '0644', string $foldermode = '0755')

Chmods files and directories recursivly to given permissions

Parameters

string $path Root path to begin changing mode [without trailing slash]
string $filemode Octal representation of the value to change file mode to [null = no change]
string $foldermode Octal representation of the value to change folder mode to [null = no change]

Return Value

boolean True if successful [one fail means the whole operation failed]

at line 116
static string getPermissions(string $path)

Get the permissions of the file/folder at a give path

Parameters

string $path The path of a file/folder

Return Value

string Filesystem permissions

at line 147
static string check(string $path, string $ds = DIRECTORY_SEPARATOR)

Checks for snooping outside of the file system root

Parameters

string $path A file system path to check
string $ds Directory separator (optional)

Return Value

string A cleaned version of the path or exit on error

at line 174
static string clean(string $path, string $ds = DIRECTORY_SEPARATOR)

Function to strip additional / or \ in a path name

Parameters

string $path The path to clean
string $ds Directory separator (optional)

Return Value

string The cleaned path

at line 196
static boolean isOwner(string $path)

Method to determine if script owns the path

Parameters

string $path Path to check ownership

Return Value

boolean True if the php script owns the path passed

at line 238
static mixed find(mixed $paths, string $file)

Searches the directory paths for a given file.

Parameters

mixed $paths An path string or array of path strings to search in
string $file The file name to look for.

Return Value

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.