class Directory extends Node

FileSystem Directory representation.

Constants

S_IFMT

DEF_MODE

S_IFTYPE

Methods

__construct(string $basename)

Class constructor.

chmod(int $mode)

Changes access to file.

from Node
int
mode()

Returns file mode

from Node
chown($userid)

Changes ownership.

from Node
mixed
user()

Returns ownership.

from Node
chgrp($groupid)

Changes group ownership.

from Node
mixed
group()

Returns group ownership.

from Node
int
size()

Returns size as the number of child elements.

string
basename()

Returns Node basename.

from Node
setBasename(string $basename)

Sets new basename

from Node
string
path()

Returns node path.

from Node
string
url()

Returns node URL.

from Node
string
__toString()

Returns node absolute path (without scheme).

from Node
string|null
dirname()

Returns Node parent absolute path.

from Node
setAccessTime(int $time)

Sets last access time

from Node
setModificationTime(int $time)

Sets last modification time

from Node
setChangeTime(int $time)

Sets last inode change time

from Node
int
atime()

Returns last access time

from Node
int
mtime()

Returns last modification time

from Node
int
ctime()

Returns last inode change time (chown etc.)

from Node
addDirectory(Directory $directory)

Adds child Directory.

addFile(File $file)

Adds child File.

addLink(Link $link)

Adds child Link.

addNode(Node $node)

Adds child Node.

childAt(string $path)

Returns child Node existing at path.

remove(string $basename)

Removes child Node

array
children()

Returns children

Details

at line 38
__construct(string $basename)

Class constructor.

Parameters

string $basename

Exceptions

InvalidArgumentException

in Node at line 54
chmod(int $mode)

Changes access to file.

This will apply the DIR/FILE type mask for use by stat to distinguish between file and directory.

Parameters

int $mode

See also

http://man7.org/linux/man-pages/man2/lstat.2.html for explanation.

in Node at line 64
int mode()

Returns file mode

Return Value

int

in Node at line 74
chown($userid)

Changes ownership.

Parameters

$userid

in Node at line 84
mixed user()

Returns ownership.

Return Value

mixed

in Node at line 94
chgrp($groupid)

Changes group ownership.

Parameters

$groupid

in Node at line 104
mixed group()

Returns group ownership.

Return Value

mixed

at line 98
int size()

Returns size as the number of child elements.

Return Value

int

in Node at line 131
string basename()

Returns Node basename.

Return Value

string

in Node at line 141
setBasename(string $basename)

Sets new basename

Parameters

string $basename

in Node at line 151
string path()

Returns node path.

Return Value

string

in Node at line 169
string url()

Returns node URL.

Return Value

string

in Node at line 187
string __toString()

Returns node absolute path (without scheme).

Return Value

string

in Node at line 197
string|null dirname()

Returns Node parent absolute path.

Return Value

string|null

in Node at line 209
setAccessTime(int $time)

Sets last access time

Parameters

int $time

in Node at line 219
setModificationTime(int $time)

Sets last modification time

Parameters

int $time

in Node at line 229
setChangeTime(int $time)

Sets last inode change time

Parameters

int $time

in Node at line 239
int atime()

Returns last access time

Return Value

int

in Node at line 249
int mtime()

Returns last modification time

Return Value

int

in Node at line 259
int ctime()

Returns last inode change time (chown etc.)

Return Value

int

at line 51
addDirectory(Directory $directory)

Adds child Directory.

Parameters

Directory $directory

at line 61
addFile(File $file)

Adds child File.

Parameters

File $file

Adds child Link.

Parameters

Link $link

at line 83
addNode(Node $node)

Adds child Node.

Parameters

Node $node

Exceptions

FileExistsException

at line 112
Node childAt(string $path)

Returns child Node existing at path.

Parameters

string $path

Return Value

Node

Exceptions

NotFoundException

at line 126
remove(string $basename)

Removes child Node

Parameters

string $basename

at line 136
array children()

Returns children

Return Value

array