[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Filesystem/ -> Path.php (summary)

Joomla! Content Management System

Copyright: (C) 2006 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
File Size: 374 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Path:: (9 methods):
  canChmod()
  setPermissions()
  getPermissions()
  check()
  clean()
  isOwner()
  find()
  resolve()
  removeRoot()


Class: Path  - X-Ref

A Path handling class

canChmod($path)   X-Ref
Checks if a path's permissions can be changed.

param: string  $path  Path to check.
return: boolean  True if path can have mode changed.

setPermissions($path, $filemode = '0644', $foldermode = '0755')   X-Ref
Chmods files and directories recursively to given permissions.

param: string  $path        Root path to begin changing mode [without trailing slash].
param: string  $filemode    Octal representation of the value to change file mode to [null = no change].
param: string  $foldermode  Octal representation of the value to change folder mode to [null = no change].
return: boolean  True if successful [one fail means the whole operation failed].

getPermissions($path)   X-Ref
Get the permissions of the file/folder at a given path.

param: string  $path  The path of a file/folder.
return: string  Filesystem permissions.

check($path)   X-Ref
Checks for snooping outside of the file system root.

param: string  $path  A file system path to check.
return: string  A cleaned version of the path or exit on error.

clean($path, $ds = DIRECTORY_SEPARATOR)   X-Ref
Function to strip additional / or \ in a path name.

param: string  $path  The path to clean.
param: string  $ds    Directory separator (optional).
return: string  The cleaned path.

isOwner($path)   X-Ref
Method to determine if script owns the path.

param: string  $path  Path to check ownership.
return: boolean  True if the php script owns the path passed.

find($paths, $file)   X-Ref
Searches the directory paths for a given file.

param: mixed   $paths  An path string or array of path strings to search in
param: string  $file   The file name to look for.
return: 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.

resolve($path)   X-Ref
Resolves /./, /../ and multiple / in a string and returns the resulting absolute path, inspired by Flysystem
Removes trailing slashes

param: string  $path  A path to resolve
return: string  The resolved path

removeRoot($message, $rootDirectory = null)   X-Ref
Remove all references to root directory path and the system tmp path from a message

param: string  $message        The message to be cleaned
param: string  $rootDirectory  Optional root directory, defaults to JPATH_ROOT
return: string



Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer