TYPO3  7.6
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
DirectoryNode Class Reference
Inheritance diagram for DirectoryNode:
AbstractNode NodeInterface RootNode

Public Member Functions

 __construct (array $structure, NodeInterface $parent=null)
 
 getStatus ()
 
 isWritable ()
 
- Public Member Functions inherited from AbstractNode
 getName ()
 
 getAbsolutePath ()
 
 isWritable ()
 
- Public Member Functions inherited from NodeInterface
 getName ()
 
 getAbsolutePath ()
 
 fix ()
 

Protected Member Functions

 fixSelf ()
 
 createDirectory ()
 
 getSelfStatus ()
 
 canFileBeCreated ()
 
 isDirectory ()
 
- Protected Member Functions inherited from AbstractNode
 getTargetPermission ()
 
 setTargetPermission ($permission)
 
 getChildren ()
 
 getParent ()
 
 exists ()
 
 fixPermission ()
 
 isPermissionCorrect ()
 
 getCurrentPermission ()
 
 isWindowsOs ()
 
 getRelativePathBelowSiteRoot ($path=null)
 

Protected Attributes

 $targetPermission = '2775'
 
- Protected Attributes inherited from AbstractNode
 $name = ''
 
 $targetPermission = null
 
 $parent = null
 
 $children = array()
 

Detailed Description

A directory

Definition at line 23 of file DirectoryNode.php.

Constructor & Destructor Documentation

__construct ( array  $structure,
NodeInterface  $parent = null 
)

Implement constructor

Parameters
array$structureStructure array
NodeInterface$parentParent object
Exceptions
Exception\InvalidArgumentException

Implements NodeInterface.

Definition at line 37 of file DirectoryNode.php.

References AbstractNode\$parent, and AbstractNode\setTargetPermission().

Member Function Documentation

canFileBeCreated ( )
protected

Create a test file and delete again - helper for isWritable

Returns
bool TRUE if test file creation was successful

Definition at line 254 of file DirectoryNode.php.

References AbstractNode\getAbsolutePath(), and StringUtility\getUniqueId().

Referenced by DirectoryNode\isWritable().

createDirectory ( )
protected

Create directory if not exists

Exceptions
Exception
Returns

Definition at line 168 of file DirectoryNode.php.

References AbstractNode\exists(), AbstractNode\getAbsolutePath(), and AbstractNode\getRelativePathBelowSiteRoot().

Referenced by DirectoryNode\fixSelf().

fixSelf ( )
protected

Fix this directory:

  • create with correct permissions if it was not existing
  • if there is no "write" permissions, try to fix it
  • leave it alone otherwise
Returns
array<>

Definition at line 127 of file DirectoryNode.php.

References DirectoryNode\createDirectory(), elseif, AbstractNode\exists(), AbstractNode\fixPermission(), AbstractNode\getAbsolutePath(), AbstractNode\getRelativePathBelowSiteRoot(), DirectoryNode\isDirectory(), AbstractNode\isPermissionCorrect(), and DirectoryNode\isWritable().

getSelfStatus ( )
protected
getStatus ( )

Get own status and status of child objects

Returns
array<>

Implements NodeInterface.

Definition at line 70 of file DirectoryNode.php.

References AbstractNode\exists(), AbstractNode\getRelativePathBelowSiteRoot(), and DirectoryNode\getSelfStatus().

isDirectory ( )
protected

Checks if not is a directory

Returns
bool True if node is a directory

Definition at line 269 of file DirectoryNode.php.

References AbstractNode\getAbsolutePath().

Referenced by DirectoryNode\fixSelf(), and DirectoryNode\getSelfStatus().

isWritable ( )

Create a test file and delete again if directory exists

Returns
bool TRUE if test file creation was successful

Implements NodeInterface.

Definition at line 90 of file DirectoryNode.php.

References DirectoryNode\canFileBeCreated(), elseif, and AbstractNode\exists().

Referenced by DirectoryNode\fixSelf(), and DirectoryNode\getSelfStatus().

Member Data Documentation

$targetPermission = '2775'
protected

Definition at line 28 of file DirectoryNode.php.