Documentation

vfsStreamDirectory extends vfsStreamAbstractContent
in package
implements vfsStreamContainer

Directory container.

Interfaces, Classes and Traits

vfsStreamContainer
Interface for stream contents that are able to store other stream contents.

Table of Contents

$children  : mixed
list of directory children
$group  : mixed
owner group of the file
$lastAccessed  : mixed
timestamp of last access
$lastAttributeModified  : mixed
timestamp of last attribute modification
$lastModified  : mixed
timestamp of last modification
$name  : mixed
name of the container
$permissions  : mixed
permissions for content
$type  : mixed
type of the container
$user  : mixed
owner of the file
$parentPath  : mixed
path to to this content
__construct()  : mixed
constructor
addChild()  : mixed
adds child to the directory
appliesTo()  : bool
checks whether the container can be applied to given name
at()  : $this
adds content to given container
chgrp()  : $this
change owner group of file to given group
chmod()  : $this
change file mode to given permissions
chown()  : $this
change owner of file to given user
fileatime()  : int
returns the last access time of the stream content
filectime()  : int
returns the last attribute modification time of the stream content
filemtime()  : int
returns the last modification time of the stream content
getChild()  : vfsStreamContent
returns the child with the given name
getChildren()  : array<string|int, vfsStreamContent>
returns a list of children for this directory
getGroup()  : int
returns owner group of file
getIterator()  : vfsStreamContainerIterator
returns iterator for the children
getName()  : string
returns the file name of the content
getPermissions()  : int
returns permissions
getType()  : int
returns the type of the container
getUser()  : int
returns owner of file
hasChild()  : bool
checks whether the container contains a child with the given name
hasChildren()  : bool
checks whether directory contains any children
isDot()  : bool
checks whether dir is a dot dir
isExecutable()  : bool
checks whether content is executable
isOwnedByGroup()  : bool
checks whether file is owned by group
isOwnedByUser()  : bool
checks whether file is owned by given user
isReadable()  : bool
checks whether content is readable
isWritable()  : bool
checks whether content is writable
lastAccessed()  : $this
sets last access time of the stream content
lastAttributeModified()  : $this
sets the last attribute modification time of the stream content
lastModified()  : $this
sets the last modification time of the stream content
path()  : string
returns path to this content
removeChild()  : bool
removes child from the directory
rename()  : mixed
renames the content
size()  : int
returns size of directory
sizeSummarized()  : int
returns summarized size of directory and its children
url()  : string
returns complete vfsStream url for this content
getChildName()  : string
helper method to calculate the child name
getDefaultPermissions()  : int
returns default permissions for concrete implementation
getRealChildName()  : string
helper method to detect the real child name
updateModifications()  : mixed
updates internal timestamps

Properties

$children

list of directory children

protected mixed $children = array()
Tags
type

vfsStreamContent[]

$lastAttributeModified

timestamp of last attribute modification

protected mixed $lastAttributeModified
Tags
type

int

Methods

__construct()

constructor

public __construct(string $name[, int $permissions = null ]) : mixed
Parameters
$name : string
$permissions : int = null

optional

Tags
throws
vfsStreamException
Return values
mixed

appliesTo()

checks whether the container can be applied to given name

public appliesTo(string $name) : bool
Parameters
$name : string
Return values
bool

chgrp()

change owner group of file to given group

public chgrp(int $group) : $this
Parameters
$group : int
Return values
$this

chmod()

change file mode to given permissions

public chmod(int $permissions) : $this
Parameters
$permissions : int
Return values
$this

chown()

change owner of file to given user

public chown(int $user) : $this
Parameters
$user : int
Return values
$this

fileatime()

returns the last access time of the stream content

public fileatime() : int
Tags
since
0.9
Return values
int

filectime()

returns the last attribute modification time of the stream content

public filectime() : int
Tags
since
0.9
Return values
int

filemtime()

returns the last modification time of the stream content

public filemtime() : int
Return values
int

hasChild()

checks whether the container contains a child with the given name

public hasChild(string $name) : bool
Parameters
$name : string
Return values
bool

hasChildren()

checks whether directory contains any children

public hasChildren() : bool
Tags
since
0.10.0
Return values
bool

isDot()

checks whether dir is a dot dir

public isDot() : bool
Return values
bool

isExecutable()

checks whether content is executable

public isExecutable(int $user, int $group) : bool
Parameters
$user : int

id of user to check for

$group : int

id of group to check for

Return values
bool

isOwnedByGroup()

checks whether file is owned by group

public isOwnedByGroup(int $group) : bool
Parameters
$group : int
Return values
bool

isOwnedByUser()

checks whether file is owned by given user

public isOwnedByUser(int $user) : bool
Parameters
$user : int
Return values
bool

isReadable()

checks whether content is readable

public isReadable(int $user, int $group) : bool
Parameters
$user : int

id of user to check for

$group : int

id of group to check for

Return values
bool

isWritable()

checks whether content is writable

public isWritable(int $user, int $group) : bool
Parameters
$user : int

id of user to check for

$group : int

id of group to check for

Return values
bool

lastAccessed()

sets last access time of the stream content

public lastAccessed(int $fileatime) : $this
Parameters
$fileatime : int
Tags
since
0.9
Return values
$this

lastAttributeModified()

sets the last attribute modification time of the stream content

public lastAttributeModified(int $filectime) : $this
Parameters
$filectime : int
Tags
since
0.9
Return values
$this

lastModified()

sets the last modification time of the stream content

public lastModified(int $filemtime) : $this
Parameters
$filemtime : int
Return values
$this

removeChild()

removes child from the directory

public removeChild(string $name) : bool
Parameters
$name : string
Return values
bool

size()

returns size of directory

public size() : int

The size of a directory is always 0 bytes. To calculate the summarized size of all children in the directory use sizeSummarized().

Return values
int

sizeSummarized()

returns summarized size of directory and its children

public sizeSummarized() : int
Return values
int

url()

returns complete vfsStream url for this content

public url() : string
Tags
since
1.2.0
Return values
string

getChildName()

helper method to calculate the child name

protected static getChildName(string $name, string $ownName) : string
Parameters
$name : string
$ownName : string
Return values
string

getDefaultPermissions()

returns default permissions for concrete implementation

protected getDefaultPermissions() : int
Tags
since
0.8.0
Return values
int

getRealChildName()

helper method to detect the real child name

protected getRealChildName(string $name) : string
Parameters
$name : string
Return values
string

updateModifications()

updates internal timestamps

protected updateModifications() : mixed
Return values
mixed

Search results