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

Public Member Functions

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

Protected Member Functions

 fixSelf ()
 
 createFile ()
 
 getSelfStatus ()
 
 isContentCorrect ()
 
 setContent ()
 
 isFile ()
 
- Protected Member Functions inherited from AbstractNode
 getTargetPermission ()
 
 setTargetPermission ($permission)
 
 getChildren ()
 
 getParent ()
 
 exists ()
 
 fixPermission ()
 
 isPermissionCorrect ()
 
 getCurrentPermission ()
 
 isWindowsOs ()
 
 getRelativePathBelowSiteRoot ($path=null)
 

Protected Attributes

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

Detailed Description

A file

Definition at line 22 of file FileNode.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 41 of file FileNode.php.

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

Member Function Documentation

createFile ( )
protected

Create file if not exists

Exceptions
Exception
Returns

Definition at line 166 of file FileNode.php.

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

Referenced by FileNode\fixSelf().

fix ( )

Fix structure

If there is nothing to fix, returns an empty array

Returns
array<>

Implements NodeInterface.

Definition at line 113 of file FileNode.php.

References FileNode\fixSelf().

fixSelf ( )
protected
getSelfStatus ( )
protected
getStatus ( )

Get own status Returns warning if file not exists Returns error if file exists but content is not as expected (can / shouldn't be fixed)

Returns
array<>

Implements NodeInterface.

Definition at line 92 of file FileNode.php.

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

isContentCorrect ( )
protected

Compare current file content with target file content

Exceptions
ExceptionIf file does not exist
Returns
bool TRUE if current and target file content are identical

Definition at line 246 of file FileNode.php.

References AbstractNode\getAbsolutePath().

Referenced by FileNode\getSelfStatus().

isFile ( )
protected

Checks if not is a file

Returns
bool

Definition at line 306 of file FileNode.php.

References AbstractNode\getAbsolutePath().

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

setContent ( )
protected

Sets content of file to target content

Exceptions
ExceptionIf file does not exist
Returns

Definition at line 274 of file FileNode.php.

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

Referenced by FileNode\fixSelf().

Member Data Documentation

$targetContent = null
protected

Definition at line 32 of file FileNode.php.

$targetPermission = '0664'
protected

Definition at line 27 of file FileNode.php.