Joomla CMS  4.2.2
Documentation des API du CMS Joomla en version 4.2.2
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe File

Fonctions membres publiques statiques

static stripExt ($file)
 
static makeSafe ($file, array $stripChars=['#^\.#'])
 
static copy ($src, $dest, $path=null, $useStreams=false)
 
static delete ($file)
 
static move ($src, $dest, $path='', $useStreams=false)
 
static write ($file, &$buffer, $useStreams=false, $appendToFile=false)
 
static upload ($src, $dest, $useStreams=false)
 
static invalidateFileCache ($file)
 

Description détaillée

A File handling class

Depuis
1.0

Documentation des fonctions membres

◆ copy()

static copy (   $src,
  $dest,
  $path = null,
  $useStreams = false 
)
static

Copies a file

Paramètres
string$srcThe path to the source file
string$destThe path to the destination file
string$pathAn optional base path to prefix to the file names
boolean$useStreamsTrue to use streams
Renvoie
boolean True on success
Depuis
1.0
Exceptions
FilesystemException

Références $path, Laminas\Diactoros\$stream, Path\clean(), Stream\getStream(), null, et Path\removeRoot().

Référencé par Archive\extract().

◆ delete()

static delete (   $file)
static

Delete a file or array of files

Paramètres
mixed$fileThe file name or an array of file names
Renvoie
boolean True on success
Depuis
1.0
Exceptions
FilesystemException

Références Path\canChmod(), et Path\clean().

Référencé par Patcher\apply(), Folder\delete(), et Path\isOwner().

◆ invalidateFileCache()

static invalidateFileCache (   $file)
static

Invalidate any opcache for a newly written file immediately, if opcache* functions exist and if this was a PHP file.

Paramètres
string$fileThe path to the file just written to, to flush from opcache
Renvoie
void

Références $info.

◆ makeSafe()

static makeSafe (   $file,
array  $stripChars = ['#^\.#'] 
)
static

Makes the file name safe to use

Paramètres
string$fileThe name of the file [not full path]
array$stripCharsArray of regex (by default will remove any leading periods)
Renvoie
string The sanitised string
Depuis
1.0

◆ move()

static move (   $src,
  $dest,
  $path = '',
  $useStreams = false 
)
static

Moves a file

Paramètres
string$srcThe path to the source file
string$destThe path to the destination file
string$pathAn optional base path to prefix to the file names
boolean$useStreamsTrue to use streams
Renvoie
boolean True on success
Depuis
1.0
Exceptions
FilesystemException

Références $path, Laminas\Diactoros\$stream, Path\clean(), Stream\getStream(), et null.

◆ stripExt()

static stripExt (   $file)
static

Strips the last extension off of a file name

Paramètres
string$fileThe file name
Renvoie
string The file name without the extension
Depuis
1.0

Référencé par ImportCommand\doExecute(), et FilelistField\getOptions().

◆ upload()

static upload (   $src,
  $dest,
  $useStreams = false 
)
static

Moves an uploaded file to a destination folder

Paramètres
string$srcThe name of the php (temporary) uploaded file
string$destThe path (including filename) to move the uploaded file to
boolean$useStreamsTrue to use streams
Renvoie
boolean True on success
Depuis
1.0
Exceptions
FilesystemException

Références $baseDir, Laminas\Diactoros\$stream, Path\clean(), Folder\create(), Stream\getStream(), null, et Path\setPermissions().

◆ write()

static write (   $file,
$buffer,
  $useStreams = false,
  $appendToFile = false 
)
static

Write contents to a file

Paramètres
string$fileThe full file path
string$bufferThe buffer to write
boolean$useStreamsUse streams
boolean$appendToFileAppend to the file and not overwrite it.
Renvoie
boolean True on success
Depuis
1.0

Références $buffer, Laminas\Diactoros\$stream, Path\clean(), Folder\create(), et Stream\getStream().

Référencé par Patcher\apply(), Zip\createZipFile(), Bzip2\extract(), Gzip\extract(), Tar\extract(), Zip\extractCustom(), Zip\extractNative(), Path\isOwner(), Requests\makeGetRequest(), et SiteStatus\writeConfigFile().


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