Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques statiques | |
static | getExt ($file) |
static | stripExt ($file) |
static | makeSafe ($file) |
static | copy ($src, $dest, $path=null, $useStreams=false) |
static | invalidateFileCache ($filepath, $force=true) |
static | canFlushFileCache () |
static | delete ($file) |
static | move ($src, $dest, $path='', $useStreams=false) |
static | write ($file, $buffer, $useStreams=false) |
static | append ($file, $buffer, $useStreams=false) |
static | upload ($src, $dest, $useStreams=false, $allowUnsafe=false, $safeFileOptions=array()) |
static | exists ($file) |
Attributs protégés statiques | |
static | $canFlushFileCache |
A File handling class
|
static |
Append contents to a file
string | $file | The full file path |
string | $buffer | The buffer to write |
boolean | $useStreams | Use streams |
Références $buffer, Laminas\Diactoros\$stream, Log\add(), Path\clean(), ClientHelper\getCredentials(), FtpClient\getInstance(), Factory\getStream(), JPATH_ROOT, Text\sprintf(), et Log\WARNING.
|
static |
First we check if opcache is enabled Then we check if the opcache_invalidate function is available Lastly we check if the host has restricted which scripts can use opcache_invalidate using opcache.restrict_api.
‘$_SERVER['SCRIPT_FILENAME’]approximates the origin file's path, but
realpath() is necessary because
SCRIPT_FILENAMEcan be a relative path when run from CLI. If the host has this set, check whether the path in
opcache.restrict_api` matches the beginning of the path of the origin file.
Copies a file
string | $src | The path to the source file |
string | $dest | The path to the destination file |
string | $path | An optional base path to prefix to the file names |
boolean | $useStreams | True to use streams |
Références $path, Laminas\Diactoros\$stream, Log\add(), Path\clean(), Folder\create(), ClientHelper\getCredentials(), FtpClient\getInstance(), Factory\getStream(), JPATH_ROOT, Text\sprintf(), et Log\WARNING.
Référencé par TemplateModel\child(), TemplateModel\copy(), LocalAdapter\copyFile(), TemplateModel\copyFile(), Installer\copyFiles(), et TemplateModel\createTemplateOverride().
|
static |
Delete a file or array of files
mixed | $file | The file name or an array of file names |
Try making the file writable first. If it's read-only, it can't be deleted on Windows, even if the parent folder is writable
Invalidate the OPCache for the file before actually deleting it
In case of restricted permissions we delete it one way or the other as long as the owner is either the webserver or the ftp
Références Log\add(), Path\clean(), elseif, ClientHelper\getCredentials(), FtpClient\getInstance(), JPATH_ROOT, Text\sprintf(), et Log\WARNING.
Référencé par Installer\abort(), Patcher\apply(), LocalAdapter\checkContent(), UpdateModel\cleanUp(), InstallerHelper\cleanupInstall(), LocalAdapter\copyFolder(), UpdateModel\createUpdateFile(), LocalAdapter\delete(), Folder\delete(), ConfigurationModel\deleteConfiguration(), TemplateModel\deleteFile(), CleanupModel\deleteInstallationFolder(), UpdateModel\downloadPackage(), FileAdapter\finaliseUninstall(), PackageAdapter\finaliseUninstall(), TracksModel\getContent(), OverridesModel\getOverrides(), Path\isOwner(), LocalAdapter\moveFolder(), Installer\parseFiles(), FileAdapter\removeExtensionFiles(), LibraryAdapter\removeExtensionFiles(), InstallerScript\removeFiles(), Installer\removeFiles(), UpdateModel\removePackageFiles(), et UpdateCoreCommand\updateJoomlaCore().
|
static |
Wrapper for the standard file_exists function
string | $file | File path |
Références Path\clean().
Référencé par MessageController\action(), UpdateController\captive(), UpdateModel\captiveFileExists(), DatabaseHelper\checkRemoteDbHost(), TemplateModel\child(), UpdateModel\cleanUp(), TemplateModel\copy(), TemplateModel\createTemplateOverride(), UpdateModel\createUpdateFile(), LocalAdapter\delete(), TemplateModel\fixTemplateName(), ContenthistoryHelper\getFormFile(), ConfigComponentsField\getOptions(), MessagesModel\onProcessList(), UpdateModel\preparePreUpdate(), UpdateModel\removePackageFiles(), LocalAdapter\updateFile(), DatabaseHelper\validateConnectionParameters(), et ApplicationModel\validateDbConnection().
|
static |
Gets the extension of a file name
string | $file | The file name |
Référencé par TemplateHelper\canUpload(), LocalAdapter\checkContent(), ApiModel\createFile(), TemplateModel\createTemplateOverride(), MailTemplate\getAttachmentName(), LocalAdapter\getPathInformation(), TemplateModel\getSafeName(), LocalAdapter\getSafeName(), Joomla\Plugin\Editors\TinyMCE\PluginTraits\includeRelativeFiles(), HTMLHelper\includeRelativeFiles(), Stream\open(), et ApiModel\updateFile().
|
static |
Invalidate opcache for a newly written/deleted file immediately, if opcache* functions exist and if this was a PHP file.
string | $filepath | The path to the file just written to, to flush from opcache |
boolean | $force | If set to true, the script will be invalidated regardless of whether invalidation is necessary |
Référencé par FileStorage\__construct(), FileStorage\_checkExpire(), FileStorage\_deleteFolder(), UpdateModel\createUpdateFile(), FileStorage\gc(), et FileStorage\remove().
|
static |
Makes file name safe to use
string | $file | The name of the file [not full path] |
Référencé par TemplateHelper\canUpload(), MediaHelper\canUpload(), ContenthistoryHelper\getFormFile(), LocalAdapter\getSafeName(), et TemplateModel\uploadFile().
|
static |
Moves a file
string | $src | The path to the source file |
string | $dest | The path to the destination file |
string | $path | An optional base path to prefix to the file names |
boolean | $useStreams | True to use streams |
Références $path, Laminas\Diactoros\$stream, Text\_(), Log\add(), Path\clean(), ClientHelper\getCredentials(), FtpClient\getInstance(), Factory\getStream(), JPATH_ROOT, Text\sprintf(), et Log\WARNING.
Référencé par CleanupModel\deleteInstallationFolder(), TemplateModel\fixTemplateName(), InstallerScript\moveCliFiles(), et LocalAdapter\moveFile().
|
static |
Strips the last extension off of a file name
string | $file | The file name |
Référencé par TemplateModel\createTemplateOverride(), PluginAdapter\discover(), MailTemplate\getAttachmentName(), MenusHelper\getPresets(), Joomla\Plugin\Editors\TinyMCE\PluginTraits\includeRelativeFiles(), HTMLHelper\includeRelativeFiles(), Indexer\index(), Installer\parseXMLInstallFile(), et ConfigurationModel\setup().
|
static |
Moves an uploaded file to a destination folder
string | $src | The name of the php (temporary) uploaded file |
string | $dest | The path (including filename) to move the uploaded file to |
boolean | $useStreams | True to use streams |
boolean | $allowUnsafe | Allow the upload of unsafe files |
array | $safeFileOptions | Options to InputFilter::isSafeFile |
Références $baseDir, Laminas\Diactoros\$stream, Text\_(), Log\add(), Path\clean(), Folder\create(), ClientHelper\getCredentials(), FtpClient\getInstance(), Factory\getStream(), InputFilter\isSafeFile(), JPATH_ROOT, Path\setPermissions(), Text\sprintf(), et Log\WARNING.
Référencé par InstallModel\_getPackageFromUpload(), UpdateModel\upload(), et TemplateModel\uploadFile().
|
static |
Write contents to a file
string | $file | The full file path |
string | $buffer | The buffer to write |
boolean | $useStreams | Use streams |
Références $buffer, Laminas\Diactoros\$stream, Log\add(), Path\clean(), Folder\create(), ClientHelper\getCredentials(), FtpClient\getInstance(), Factory\getStream(), JPATH_ROOT, Text\sprintf(), et Log\WARNING.
Référencé par Patcher\apply(), LocalAdapter\checkContent(), DatabaseHelper\checkRemoteDbHost(), TemplateModel\child(), LocalAdapter\createFile(), UpdateModel\createUpdateFile(), InstallerHelper\downloadPackage(), UpdateModel\downloadPackage(), TemplateModel\fixTemplateName(), Path\isOwner(), FileStorage\save(), TemplateModel\save(), LanguageHelper\saveToIniFile(), LocalAdapter\updateFile(), et ApplicationModel\writeConfigFile().
|
staticprotected |