Back to Joomla project (class list)

Class Path - list of methods

A Path handling class
Package: Joomla\CMS\Filesystem
Copyright: (C) 2006 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Filesystem/Path.php
Project: Joomla

Method Summary

public static bool
(mixed $path)

Checks if a path's permissions can be changed.
Parameters
  • string $path Path to check.
Returns
  • bool True if path can have mode changed.
Since
  • 1.7.0
Show source code of this method: canChmod Source Code

public static bool
(mixed $path, mixed $filemode = '0644', mixed $foldermode = '0755')

Chmods files and directories recursively 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].
Returns
  • bool True if successful [one fail means the whole operation failed].
Since
  • 1.7.0
Show source code of this method: setPermissions Source Code

public static string
(mixed $path)

Get the permissions of the file/folder at a given path.
Parameters
  • string $path The path of a file/folder.
Returns
  • string Filesystem permissions.
Since
  • 1.7.0
Show source code of this method: getPermissions Source Code

public static string
(mixed $path)

Checks for snooping outside of the file system root.
Parameters
  • string $path A file system path to check.
Returns
  • string A cleaned version of the path or exit on error.
Since
  • 1.7.0
-
  • \Exception
Show source code of this method: check Source Code

public static string
(mixed $path, mixed $ds = DIRECTORY_SEPARATOR)

Function to strip additional / or \ in a path name.
Parameters
  • string $path The path to clean.
  • string $ds Directory separator (optional).
Returns
  • string The cleaned path.
Since
  • 1.7.0
-
  • \UnexpectedValueException
Show source code of this method: clean Source Code

public static bool
(mixed $path)

Method to determine if script owns the path.
Parameters
  • string $path Path to check ownership.
Returns
  • bool True if the php script owns the path passed.
Since
  • 1.7.0
Show source code of this method: isOwner Source Code

public static mixed
(mixed $paths, mixed $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.
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
  • 1.7.0
Show source code of this method: find Source Code

public static string
(mixed $path)

Resolves /./, /../ and multiple / in a string and returns the resulting absolute path, inspired by Flysystem Removes trailing slashes
Parameters
  • string $path A path to resolve
Returns
  • string The resolved path
Since
  • 3.9.25
Show source code of this method: resolve Source Code

public static string
(mixed $message, mixed $rootDirectory = null)

Remove all references to root directory path and the system tmp path from a message
Parameters
  • string $message The message to be cleaned
  • string $rootDirectory Optional root directory, defaults to JPATH_ROOT
Returns
  • string
Since
  • 3.10.7
Show source code of this method: removeRoot Source Code

Tags Summary

Since
1.7.0