|
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) |
|
A File handling class
- Depuis
- 1.0
◆ copy()
static copy |
( |
|
$src, |
|
|
|
$dest, |
|
|
|
$path = null , |
|
|
|
$useStreams = false |
|
) |
| |
|
static |
◆ delete()
◆ 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 | $file | The 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 | $file | The name of the file [not full path] |
array | $stripChars | Array 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 | $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 |
- Renvoie
- boolean True on success
- Depuis
- 1.0
- Exceptions
-
Références $path, Laminas\Diactoros\$stream, Path\clean(), Stream\getStream(), et null.
◆ stripExt()
◆ upload()
static upload |
( |
|
$src, |
|
|
|
$dest, |
|
|
|
$useStreams = false |
|
) |
| |
|
static |
◆ write()
static write |
( |
|
$file, |
|
|
& |
$buffer, |
|
|
|
$useStreams = false , |
|
|
|
$appendToFile = false |
|
) |
| |
|
static |
Write contents to a file
- Paramètres
-
string | $file | The full file path |
string | $buffer | The buffer to write |
boolean | $useStreams | Use streams |
boolean | $appendToFile | Append 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 :