Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Référence de la classe Path

Fonctions membres publiques statiques

static canChmod ($path)
 
static setPermissions ($path, $filemode='0644', $foldermode='0755')
 
static getPermissions ($path)
 
static check ($path)
 
static clean ($path, $ds=DIRECTORY_SEPARATOR)
 
static isOwner ($path)
 
static find ($paths, $file)
 
static resolve ($path)
 
static removeRoot ($message, $rootDirectory=null)
 

Description détaillée

A Path handling class

Depuis
1.7.0

Documentation des fonctions membres

◆ canChmod()

static canChmod (   $path)
static

Checks if a path's permissions can be changed.

Paramètres
string$pathPath to check.
Renvoie
boolean True if path can have mode changed.
Depuis
1.7.0

Références $path.

◆ check()

static check (   $path)
static

Checks for snooping outside of the file system root.

Paramètres
string$pathA file system path to check.
Renvoie
string A cleaned version of the path or exit on error.
Exceptions

Références $path, et JPATH_ROOT.

Référencé par BaseController\addPath(), TemplateModel\getForm(), ModuleHelper\getLayoutPath(), LocalAdapter\getLocalPath(), TemplateModel\getSource(), Users\image(), ComponentModel\populateState(), FilePathRule\test(), et Joomla\CMS\MVC\Model\workflowAfterSave().

◆ clean()

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

Function to strip additional / or \ in a path name.

Paramètres
string$pathThe path to clean.
string$dsDirectory separator (optional).
Renvoie
string The cleaned path.
Exceptions
Exemples:
C:/laragon/www/_install/Joomla_422-Stable-Full_Package_French_v1/libraries/src/HTML/HTMLHelper.php.

Références $path, elseif, et JPATH_ROOT.

Référencé par LocalAdapter\__construct(), SubformField\__set(), HtmlView\_addPath(), InstallModel\_getPackageFromFolder(), BaseModel\addIncludePath(), CacheController\addIncludePath(), CacheStorage\addIncludePath(), Cache\addIncludePath(), HTMLHelper\addIncludePath(), WebAssetRegistry\addRegistryFile(), HtmlView\addToolbar(), File\append(), LocalAdapter\checkContent(), TemplateModel\child(), InstallerHelper\cleanupInstall(), Folder\copy(), File\copy(), LocalAdapter\copy(), TemplateModel\copy(), TemplateModel\copyFile(), Installer\copyFiles(), Folder\create(), TemplateModel\createFile(), TemplateModel\createFolder(), TemplateModel\createOverride(), File\delete(), Folder\delete(), TemplateModel\deleteFolder(), Folder\exists(), File\exists(), TemplateModel\extractArchive(), Folder\files(), Folder\folders(), TemplateModel\getArchive(), ActionlogsHelper\getContentTypeLink(), TemplateModel\getCoreFile(), TemplateModel\getCoreList(), FileAdapter\getElement(), LocalAdapter\getFileName(), LocalAdapter\getFiles(), TemplateModel\getFiles(), TemplateModel\getFont(), OverrideModel\getForm(), TemplateModel\getForm(), TemplateModel\getImage(), FieldLayoutField\getInput(), ModulelayoutField\getInput(), ComponentlayoutField\getInput(), PluginModel\getItem(), StyleModel\getItem(), ModuleModel\getItem(), PositionsModel\getItems(), SelectModel\getItems(), TemplateModel\getMediaFiles(), BaseController\getModel(), AliastagField\getOptions(), FolderlistField\getOptions(), FilelistField\getOptions(), TemplateModel\getOverridesList(), LocalAdapter\getPathInformation(), TemplatesHelper\getPositions(), ModulesModel\getPositions(), TemplateModel\getSource(), TemplateModel\getUpdatedList(), BaseController\getView(), Folder\listFolderTree(), LegacyComponent\loadHelper(), ContenthistoryHelper\loadLanguageFiles(), File\move(), Folder\move(), LocalAdapter\move(), Installer\parseMedia(), TemplatesHelper\parseXMLTemplateFile(), PluginsHelper\parseXMLTemplateFile(), FileAdapter\populateFilesAndFolderList(), ComponentModel\populateState(), ModulesModel\preprocessForm(), TemplatesModel\preprocessForm(), GroupModel\preprocessForm(), PluginModel\preprocessForm(), StyleModel\preprocessForm(), CategoryModel\preprocessForm(), ModuleModel\preprocessForm(), FieldModel\preprocessForm(), ItemModel\preprocessForm(), StringsModel\refresh(), ApplicationModel\save(), TemplateModel\save(), LocalAdapter\search(), ComponentAdapter\setupInstallPaths(), ComponentAdapter\setupUninstall(), FolderPathExistsRule\test(), InstallerHelper\unpack(), File\upload(), TemplateModel\uploadFile(), DatabaseHelper\validateConnectionParameters(), ApplicationModel\validateDbConnection(), File\write(), et Debug\xdebuglink().

◆ find()

static find (   $paths,
  $file 
)
static

Searches the directory paths for a given file.

Paramètres
mixed$pathsAn path string or array of path strings to search in
string$fileThe file name to look for.
Renvoie
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.
Depuis
1.7.0
Exemples:
C:/laragon/www/_install/Joomla_422-Stable-Full_Package_French_v1/libraries/src/HTML/HTMLHelper.php.

Références $path.

Référencé par HTMLHelper\_(), LegacyFactory\createView(), TemplateModel\getCoreFile(), CacheController\getInstance(), Table\getInstance(), HtmlView\getLayoutFile(), FileLayout\getPath(), FormHelper\loadClass(), Form\loadFile(), HtmlView\loadHelper(), HtmlView\loadTemplate(), et ItemModel\preprocessForm().

◆ getPermissions()

static getPermissions (   $path)
static

Get the permissions of the file/folder at a given path.

Paramètres
string$pathThe path of a file/folder.
Renvoie
string Filesystem permissions.
Depuis
1.7.0

Références $i, $mode, et $path.

Référencé par TemplateModel\save().

◆ isOwner()

static isOwner (   $path)
static

Method to determine if script owns the path.

Paramètres
string$pathPath to check ownership.
Renvoie
boolean True if the php script owns the path passed.
Depuis
1.7.0

Références $dir, $path, $return, $tmp, File\delete(), Crypt\genRandomBytes(), JPATH_SITE, et File\write().

Référencé par TemplateModel\save(), et ApplicationModel\writeConfigFile().

◆ removeRoot()

static removeRoot (   $message,
  $rootDirectory = null 
)
static

Remove all references to root directory path and the system tmp path from a message

Paramètres
string$messageThe message to be cleaned
string$rootDirectoryOptional root directory, defaults to JPATH_ROOT
Renvoie
string
Depuis
3.10.7

Références $dir, $message, et JPATH_ROOT.

Référencé par LogEntry\__construct(), Patcher\applyHunk(), et Folder\copy().

◆ resolve()

static resolve (   $path)
static

Resolves /./, /../ and multiple / in a string and returns the resulting absolute path, inspired by Flysystem Removes trailing slashes

Paramètres
string$pathA path to resolve
Renvoie
string The resolved path
Depuis
3.9.25

Références $parts, et $path.

◆ setPermissions()

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

Chmods files and directories recursively to given permissions.

Paramètres
string$pathRoot path to begin changing mode [without trailing slash].
string$filemodeOctal representation of the value to change file mode to [null = no change].
string$foldermodeOctal representation of the value to change folder mode to [null = no change].
Renvoie
boolean True if successful [one fail means the whole operation failed].
Depuis
1.7.0

Références $path.

Référencé par TemplateModel\save(), File\upload(), et ApplicationModel\writeConfigFile().


La documentation de cette classe a été générée à partir du fichier suivant :