class FileSystem

Main 'access' class to vfs implementation. It will register new stream wrapper on instantiation.

This class provides methods to get access to Container as well as file URI helper.

Methods

__construct()

Class constructor. Will register both, the stream default options and wrapper handler.

string
scheme()

Returns wrapper scheme.

__destruct()

Remoces wrapper registered for scheme associated with FileSystem instance.

container()

Returns Container instance.

root()

Returns Root instance.

string
path(string $path)

Returns absolute path to full URI path (with scheme)

createDirectory(string $path, bool $recursive = false, integer $mode = null)

Creates and returns a directory

createFile(string $path, string $data = null)

Creates and returns a file

createStructure(array $structure)

Creates fs structure

createLink(string $path, string $destinationPath)

Creates and returns a link

Details

at line 40
__construct()

Class constructor. Will register both, the stream default options and wrapper handler.

Note: Each FileSystem instance will create NEW stream wrapper/scheme.

at line 58
string scheme()

Returns wrapper scheme.

Return Value

string

at line 80
__destruct()

Remoces wrapper registered for scheme associated with FileSystem instance.

at line 90
Container container()

Returns Container instance.

Return Value

Container

at line 100
Root root()

Returns Root instance.

Return Value

Root

at line 112
string path(string $path)

Returns absolute path to full URI path (with scheme)

Parameters

string $path
  • path without scheme

Return Value

string
  • path with scheme

at line 128
Directory createDirectory(string $path, bool $recursive = false, integer $mode = null)

Creates and returns a directory

Parameters

string $path
bool $recursive
integer $mode

Return Value

Directory

at line 141
File createFile(string $path, string $data = null)

Creates and returns a file

Parameters

string $path
string $data

Return Value

File

at line 151
createStructure(array $structure)

Creates fs structure

Parameters

array $structure

Creates and returns a link

Parameters

string $path
string $destinationPath

Return Value

Link