Documentation

Local extends AbstractAdapter
in package

Table of Contents

Constants

DISALLOW_LINKS  = 02
SKIP_LINKS  = 01

Properties

$pathPrefix  : string|null
$pathSeparator  : string
$permissionMap  : array<string|int, mixed>
$permissions  : array<string|int, mixed>
$writeFlags  : int
$linkHandling  : int

Methods

__construct()  : mixed
Constructor.
applyPathPrefix()  : string
Prefix a path.
copy()  : bool
Copy a file.
createDir()  : array<string|int, mixed>|false
Create a directory.
delete()  : bool
Delete a file.
deleteDir()  : bool
Delete a directory.
getMetadata()  : array<string|int, mixed>|false
Get all the meta data of a file or directory.
getMimetype()  : array<string|int, mixed>|false
Get the mimetype of a file.
getPathPrefix()  : string|null
Get the path prefix.
getSize()  : array<string|int, mixed>|false
Get the size of a file.
getTimestamp()  : array<string|int, mixed>|false
Get the last modified time of a file as a timestamp.
getVisibility()  : array<string|int, mixed>|false
Get the visibility of a file.
has()  : array<string|int, mixed>|bool|null
Check whether a file exists.
listContents()  : array<string|int, mixed>
List contents of a directory.
read()  : array<string|int, mixed>|false
Read a file.
readStream()  : array<string|int, mixed>|false
Read a file as a stream.
removePathPrefix()  : string
Remove a path prefix.
rename()  : bool
Rename a file.
setPathPrefix()  : void
Set the path prefix.
setVisibility()  : array<string|int, mixed>|false
Set the visibility for a file.
update()  : array<string|int, mixed>|false
Update a file.
updateStream()  : array<string|int, mixed>|false
Update a file using a stream.
write()  : array<string|int, mixed>|false
Write a new file.
writeStream()  : array<string|int, mixed>|false
Write a new file using a stream.
deleteFileInfoObject()  : mixed
ensureDirectory()  : void
Ensure the root directory exists.
getDirectoryIterator()  : DirectoryIterator
getFilePath()  : string
Get the normalized path from a SplFileInfo object.
getRecursiveDirectoryIterator()  : RecursiveIteratorIterator
guardAgainstUnreadableFileInfo()  : mixed
mapFileInfo()  : array<string|int, mixed>
normalizeFileInfo()  : array<string|int, mixed>|void
Normalize the file info.

Constants

public int DISALLOW_LINKS = 02
public int SKIP_LINKS = 01

Properties

$pathSeparator

protected string $pathSeparator = DIRECTORY_SEPARATOR

$permissionMap

protected array<string|int, mixed> $permissionMap

$permissions

protected static array<string|int, mixed> $permissions = ['file' => ['public' => 0644, 'private' => 0600], 'dir' => ['public' => 0755, 'private' => 0700]]

$writeFlags

protected int $writeFlags

$linkHandling

private int $linkHandling

Methods

__construct()

Constructor.

public __construct(string $root[, int $writeFlags = LOCK_EX ][, int $linkHandling = self::DISALLOW_LINKS ][, array<string|int, mixed> $permissions = [] ]) : mixed
Parameters
$root : string
$writeFlags : int = LOCK_EX
$linkHandling : int = self::DISALLOW_LINKS
$permissions : array<string|int, mixed> = []
Tags
throws
LogicException

applyPathPrefix()

Prefix a path.

public applyPathPrefix(string $path) : string
Parameters
$path : string
Return values
string

prefixed path

copy()

Copy a file.

public copy(mixed $path, mixed $newpath) : bool
Parameters
$path : mixed
$newpath : mixed
Tags
inheritdoc
Return values
bool

createDir()

Create a directory.

public createDir(mixed $dirname, Config $config) : array<string|int, mixed>|false
Parameters
$dirname : mixed

directory name

$config : Config
Tags
inheritdoc
Return values
array<string|int, mixed>|false

delete()

Delete a file.

public delete(mixed $path) : bool
Parameters
$path : mixed
Tags
inheritdoc
Return values
bool

deleteDir()

Delete a directory.

public deleteDir(mixed $dirname) : bool
Parameters
$dirname : mixed
Tags
inheritdoc
Return values
bool

getMetadata()

Get all the meta data of a file or directory.

public getMetadata(mixed $path) : array<string|int, mixed>|false
Parameters
$path : mixed
Tags
inheritdoc
Return values
array<string|int, mixed>|false

getMimetype()

Get the mimetype of a file.

public getMimetype(mixed $path) : array<string|int, mixed>|false
Parameters
$path : mixed
Tags
inheritdoc
Return values
array<string|int, mixed>|false

getPathPrefix()

Get the path prefix.

public getPathPrefix() : string|null
Return values
string|null

path prefix or null if pathPrefix is empty

getSize()

Get the size of a file.

public getSize(mixed $path) : array<string|int, mixed>|false
Parameters
$path : mixed
Tags
inheritdoc
Return values
array<string|int, mixed>|false

getTimestamp()

Get the last modified time of a file as a timestamp.

public getTimestamp(mixed $path) : array<string|int, mixed>|false
Parameters
$path : mixed
Tags
inheritdoc
Return values
array<string|int, mixed>|false

getVisibility()

Get the visibility of a file.

public getVisibility(mixed $path) : array<string|int, mixed>|false
Parameters
$path : mixed
Tags
inheritdoc
Return values
array<string|int, mixed>|false

has()

Check whether a file exists.

public has(mixed $path) : array<string|int, mixed>|bool|null
Parameters
$path : mixed
Tags
inheritdoc
Return values
array<string|int, mixed>|bool|null

listContents()

List contents of a directory.

public listContents([mixed $directory = '' ][, mixed $recursive = false ]) : array<string|int, mixed>
Parameters
$directory : mixed = ''
$recursive : mixed = false
Tags
inheritdoc
Return values
array<string|int, mixed>

read()

Read a file.

public read(mixed $path) : array<string|int, mixed>|false
Parameters
$path : mixed
Tags
inheritdoc
Return values
array<string|int, mixed>|false

readStream()

Read a file as a stream.

public readStream(mixed $path) : array<string|int, mixed>|false
Parameters
$path : mixed
Tags
inheritdoc
Return values
array<string|int, mixed>|false

removePathPrefix()

Remove a path prefix.

public removePathPrefix(string $path) : string
Parameters
$path : string
Return values
string

path without the prefix

rename()

Rename a file.

public rename(mixed $path, mixed $newpath) : bool
Parameters
$path : mixed
$newpath : mixed
Tags
inheritdoc
Return values
bool

setPathPrefix()

Set the path prefix.

public setPathPrefix(string $prefix) : void
Parameters
$prefix : string

setVisibility()

Set the visibility for a file.

public setVisibility(mixed $path, mixed $visibility) : array<string|int, mixed>|false
Parameters
$path : mixed
$visibility : mixed
Tags
inheritdoc
Return values
array<string|int, mixed>|false

file meta data

update()

Update a file.

public update(mixed $path, mixed $contents, Config $config) : array<string|int, mixed>|false
Parameters
$path : mixed
$contents : mixed
$config : Config

Config object

Tags
inheritdoc
Return values
array<string|int, mixed>|false

false on failure file meta data on success

updateStream()

Update a file using a stream.

public updateStream(mixed $path, mixed $resource, Config $config) : array<string|int, mixed>|false
Parameters
$path : mixed
$resource : mixed
$config : Config

Config object

Tags
inheritdoc
Return values
array<string|int, mixed>|false

false on failure file meta data on success

write()

Write a new file.

public write(mixed $path, mixed $contents, Config $config) : array<string|int, mixed>|false
Parameters
$path : mixed
$contents : mixed
$config : Config

Config object

Tags
inheritdoc
Return values
array<string|int, mixed>|false

false on failure file meta data on success

writeStream()

Write a new file using a stream.

public writeStream(mixed $path, mixed $resource, Config $config) : array<string|int, mixed>|false
Parameters
$path : mixed
$resource : mixed
$config : Config

Config object

Tags
inheritdoc
Return values
array<string|int, mixed>|false

false on failure file meta data on success

deleteFileInfoObject()

protected deleteFileInfoObject(SplFileInfo $file) : mixed
Parameters
$file : SplFileInfo

ensureDirectory()

Ensure the root directory exists.

protected ensureDirectory(string $root) : void
Parameters
$root : string

root directory path

Tags
throws
Exception

in case the root directory can not be created

getDirectoryIterator()

protected getDirectoryIterator(string $path) : DirectoryIterator
Parameters
$path : string
Return values
DirectoryIterator

getFilePath()

Get the normalized path from a SplFileInfo object.

protected getFilePath(SplFileInfo $file) : string
Parameters
$file : SplFileInfo
Return values
string

getRecursiveDirectoryIterator()

protected getRecursiveDirectoryIterator(string $path[, int $mode = RecursiveIteratorIterator::SELF_FIRST ]) : RecursiveIteratorIterator
Parameters
$path : string
$mode : int = RecursiveIteratorIterator::SELF_FIRST
Return values
RecursiveIteratorIterator

guardAgainstUnreadableFileInfo()

protected guardAgainstUnreadableFileInfo(SplFileInfo $file) : mixed
Parameters
$file : SplFileInfo
Tags
throws
UnreadableFileException

mapFileInfo()

protected mapFileInfo(SplFileInfo $file) : array<string|int, mixed>
Parameters
$file : SplFileInfo
Return values
array<string|int, mixed>

normalizeFileInfo()

Normalize the file info.

protected normalizeFileInfo(SplFileInfo $file) : array<string|int, mixed>|void
Parameters
$file : SplFileInfo
Tags
throws
NotSupportedException
Return values
array<string|int, mixed>|void

        
On this page

Search results