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
$group
owner group of the file
protected
mixed
$group
Tags
$lastAccessed
timestamp of last access
protected
mixed
$lastAccessed
Tags
$lastAttributeModified
timestamp of last attribute modification
protected
mixed
$lastAttributeModified
Tags
$lastModified
timestamp of last modification
protected
mixed
$lastModified
Tags
$name
name of the container
protected
mixed
$name
Tags
$permissions
permissions for content
protected
mixed
$permissions
Tags
$type
type of the container
protected
mixed
$type
Tags
$user
owner of the file
protected
mixed
$user
Tags
$parentPath
path to to this content
private
mixed
$parentPath
Tags
Methods
__construct()
constructor
public
__construct(string $name[, int $permissions = null ]) : mixed
Parameters
- $name : string
- $permissions : int = null
-
optional
Tags
Return values
mixed —addChild()
adds child to the directory
public
addChild(vfsStreamContent $child) : mixed
Parameters
- $child : vfsStreamContent
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 —at()
adds content to given container
public
at(vfsStreamContainer $container) : $this
Parameters
- $container : vfsStreamContainer
Return values
$this —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
Return values
int —filectime()
returns the last attribute modification time of the stream content
public
filectime() : int
Tags
Return values
int —filemtime()
returns the last modification time of the stream content
public
filemtime() : int
Return values
int —getChild()
returns the child with the given name
public
getChild(string $name) : vfsStreamContent
Parameters
- $name : string
Return values
vfsStreamContent —getChildren()
returns a list of children for this directory
public
getChildren() : array<string|int, vfsStreamContent>
Return values
array<string|int, vfsStreamContent> —getGroup()
returns owner group of file
public
getGroup() : int
Return values
int —getIterator()
returns iterator for the children
public
getIterator() : vfsStreamContainerIterator
Return values
vfsStreamContainerIterator —getName()
returns the file name of the content
public
getName() : string
Return values
string —getPermissions()
returns permissions
public
getPermissions() : int
Return values
int —getType()
returns the type of the container
public
getType() : int
Return values
int —getUser()
returns owner of file
public
getUser() : 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
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
Return values
$this —lastAttributeModified()
sets the last attribute modification time of the stream content
public
lastAttributeModified(int $filectime) : $this
Parameters
- $filectime : int
Tags
Return values
$this —lastModified()
sets the last modification time of the stream content
public
lastModified(int $filemtime) : $this
Parameters
- $filemtime : int
Return values
$this —path()
returns path to this content
public
path() : string
Tags
Return values
string —removeChild()
removes child from the directory
public
removeChild(string $name) : bool
Parameters
- $name : string
Return values
bool —rename()
renames the content
public
rename(string $newName) : mixed
Parameters
- $newName : string
Tags
Return values
mixed —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
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
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