Definition at line 8 of file Util.php.
◆ contentSize()
static League\Flysystem\Util::contentSize |
( |
|
$contents | ) |
|
|
static |
Get content size.
- Parameters
-
- Returns
- int content size
Definition at line 164 of file Util.php.
References $contents, and defined.
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
◆ dirname()
static League\Flysystem\Util::dirname |
( |
|
$path | ) |
|
|
static |
◆ emulateDirectories()
static League\Flysystem\Util::emulateDirectories |
( |
array |
$listing | ) |
|
|
static |
Emulate directories.
- Parameters
-
- Returns
- array listing with emulated directories
Definition at line 195 of file Util.php.
198 $listedDirectories = [];
200 foreach ($listing as $object) {
201 list($directories, $listedDirectories) = static::emulateObjectDirectories(
208 $directories = array_diff(array_unique($directories), array_unique($listedDirectories));
210 foreach ($directories as $directory) {
211 $listing[] = static::pathinfo($directory) + [
'type' =>
'dir'];
◆ emulateObjectDirectories()
static League\Flysystem\Util::emulateObjectDirectories |
( |
array |
$object, |
|
|
array |
$directories, |
|
|
array |
$listedDirectories |
|
) |
| |
|
staticprotected |
Emulate the directories of a single object.
- Parameters
-
array | $object | |
array | $directories | |
array | $listedDirectories | |
- Returns
- array
Definition at line 285 of file Util.php.
287 if ($object[
'type'] ===
'dir') {
288 $listedDirectories[] = $object[
'path'];
291 if (empty($object[
'dirname'])) {
292 return [$directories, $listedDirectories];
295 $parent = $object[
'dirname'];
297 while ( ! empty($parent) && ! in_array($parent, $directories)) {
298 $directories[] = $parent;
299 $parent = static::dirname($parent);
302 if (isset($object[
'type']) && $object[
'type'] ===
'dir') {
303 $listedDirectories[] = $object[
'path'];
305 return [$directories, $listedDirectories];
308 return [$directories, $listedDirectories];
◆ ensureConfig()
static League\Flysystem\Util::ensureConfig |
( |
|
$config | ) |
|
|
static |
◆ getStreamSize()
static League\Flysystem\Util::getStreamSize |
( |
|
$resource | ) |
|
|
static |
Get the size of a stream.
- Parameters
-
- Returns
- int stream size
Definition at line 269 of file Util.php.
271 $stat = fstat($resource);
273 return $stat[
'size'];
◆ guessMimeType()
static League\Flysystem\Util::guessMimeType |
( |
|
$path, |
|
|
|
$content |
|
) |
| |
|
static |
◆ isSeekableStream()
static League\Flysystem\Util::isSeekableStream |
( |
|
$resource | ) |
|
|
static |
◆ map()
static League\Flysystem\Util::map |
( |
array |
$object, |
|
|
array |
$map |
|
) |
| |
|
static |
Map result arrays.
- Parameters
-
- Returns
- array mapped result
Definition at line 58 of file Util.php.
References $from, and $result.
62 foreach ($map as
$from => $to) {
63 if ( ! isset($object[
$from])) {
◆ normalizeDirname()
static League\Flysystem\Util::normalizeDirname |
( |
|
$dirname | ) |
|
|
static |
Normalize a dirname return value.
- Parameters
-
- Returns
- string normalized dirname
Definition at line 33 of file Util.php.
35 return $dirname ===
'.' ?
'' : $dirname;
◆ normalizePath()
static League\Flysystem\Util::normalizePath |
( |
|
$path | ) |
|
|
static |
Normalize path.
- Parameters
-
- Exceptions
-
- Returns
- string
Definition at line 82 of file Util.php.
References $path.
Referenced by League\Flysystem\Filesystem\copy(), League\Flysystem\Filesystem\createDir(), League\Flysystem\Filesystem\delete(), League\Flysystem\Filesystem\deleteDir(), League\Flysystem\Filesystem\get(), League\Flysystem\Filesystem\getMetadata(), League\Flysystem\Filesystem\getMimetype(), League\Flysystem\Filesystem\getSize(), League\Flysystem\Filesystem\getTimestamp(), League\Flysystem\Filesystem\getVisibility(), League\Flysystem\Filesystem\has(), League\Flysystem\Filesystem\listContents(), League\Flysystem\Filesystem\put(), League\Flysystem\Filesystem\putStream(), League\Flysystem\Filesystem\read(), League\Flysystem\Filesystem\readAndDelete(), League\Flysystem\Filesystem\readStream(), League\Flysystem\Filesystem\rename(), League\Flysystem\Filesystem\setVisibility(), League\Flysystem\Filesystem\update(), League\Flysystem\Filesystem\updateStream(), League\Flysystem\Filesystem\write(), and League\Flysystem\Filesystem\writeStream().
84 return static::normalizeRelativePath(
$path);
◆ normalizePrefix()
static League\Flysystem\Util::normalizePrefix |
( |
|
$prefix, |
|
|
|
$separator |
|
) |
| |
|
static |
Normalize prefix.
- Parameters
-
string | $prefix | |
string | $separator | |
- Returns
- string normalized path
Definition at line 152 of file Util.php.
154 return rtrim($prefix, $separator) . $separator;
◆ normalizeRelativePath()
static League\Flysystem\Util::normalizeRelativePath |
( |
|
$path | ) |
|
|
static |
Normalize relative directories in a path.
- Parameters
-
- Exceptions
-
- Returns
- string
Definition at line 96 of file Util.php.
References $path.
103 foreach (explode(
'/',
$path) as $part) {
112 'Path is outside of the defined root, path: [' .
$path .
']' 124 return implode(
'/', $parts);
◆ pathinfo()
static League\Flysystem\Util::pathinfo |
( |
|
$path | ) |
|
|
static |
◆ removeFunkyWhiteSpace()
static League\Flysystem\Util::removeFunkyWhiteSpace |
( |
|
$path | ) |
|
|
staticprotected |
Removes unprintable characters and invalid unicode characters.
- Parameters
-
- Returns
- string $path
Definition at line 134 of file Util.php.
References $path.
137 while (preg_match(
'#\p{C}+|^\./#u',
$path)) {
138 $path = preg_replace(
'#\p{C}+|^\./#u',
'',
$path);
◆ rewindStream()
static League\Flysystem\Util::rewindStream |
( |
|
$resource | ) |
|
|
static |
The documentation for this class was generated from the following file:
- libs/composer/vendor/league/flysystem/src/Util.php