PHP Class org\bovigo\vfs\vfsStreamDirectory

Inheritance: extends vfsStreamAbstractContent, implements org\bovigo\vfs\vfsStreamContainer
Show file Open project: mikey179/vfsstream Class Usage Examples

Protected Properties

Property Type Description
$children list of directory children

Public Methods

Method Description
__construct ( string $name, integer $permissions = null ) constructor
addChild ( org\bovigo\vfs\vfsStreamContent $child ) adds child to the directory
getChild ( string $name ) : org\bovigo\vfs\vfsStreamContent returns the child with the given name
getChildren ( ) : org\bovigo\vfs\vfsStreamContent[] returns a list of children for this directory
getIterator ( ) : vfsStreamContainerIterator returns iterator for the children
hasChild ( string $name ) : boolean checks whether the container contains a child with the given name
hasChildren ( ) : boolean checks whether directory contains any children
isDot ( ) : boolean checks whether dir is a dot dir
removeChild ( string $name ) : boolean removes child from the directory
rename ( string $newName ) renames the content
setParentPath ( string $parentPath ) sets parent path
size ( ) : integer returns size of directory
sizeSummarized ( ) : integer returns summarized size of directory and its children

Protected Methods

Method Description
getChildName ( string $name, string $ownName ) : string helper method to calculate the child name
getDefaultPermissions ( ) : integer returns default permissions for concrete implementation
getRealChildName ( string $name ) : string helper method to detect the real child name
updateModifications ( ) updates internal timestamps

Method Details

__construct() public method

constructor
public __construct ( string $name, integer $permissions = null )
$name string
$permissions integer optional

addChild() public method

adds child to the directory
public addChild ( org\bovigo\vfs\vfsStreamContent $child )
$child org\bovigo\vfs\vfsStreamContent

getChild() public method

returns the child with the given name
public getChild ( string $name ) : org\bovigo\vfs\vfsStreamContent
$name string
return org\bovigo\vfs\vfsStreamContent

getChildName() protected static method

helper method to calculate the child name
protected static getChildName ( string $name, string $ownName ) : string
$name string
$ownName string
return string

getChildren() public method

returns a list of children for this directory
public getChildren ( ) : org\bovigo\vfs\vfsStreamContent[]
return org\bovigo\vfs\vfsStreamContent[]

getDefaultPermissions() protected method

returns default permissions for concrete implementation
Since: 0.8.0
protected getDefaultPermissions ( ) : integer
return integer

getIterator() public method

returns iterator for the children
public getIterator ( ) : vfsStreamContainerIterator
return vfsStreamContainerIterator

getRealChildName() protected method

helper method to detect the real child name
protected getRealChildName ( string $name ) : string
$name string
return string

hasChild() public method

checks whether the container contains a child with the given name
public hasChild ( string $name ) : boolean
$name string
return boolean

hasChildren() public method

checks whether directory contains any children
Since: 0.10.0
public hasChildren ( ) : boolean
return boolean

isDot() public method

checks whether dir is a dot dir
public isDot ( ) : boolean
return boolean

removeChild() public method

removes child from the directory
public removeChild ( string $name ) : boolean
$name string
return boolean

rename() public method

renames the content
public rename ( string $newName )
$newName string

setParentPath() public method

sets parent path
Since: 1.2.0
public setParentPath ( string $parentPath )
$parentPath string

size() public method

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

sizeSummarized() public method

returns summarized size of directory and its children
public sizeSummarized ( ) : integer
return integer

updateModifications() protected method

updates internal timestamps
protected updateModifications ( )

Property Details

$children protected property

list of directory children
protected $children