TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Install\FolderStructure\FileNode Class Reference
Inheritance diagram for TYPO3\CMS\Install\FolderStructure\FileNode:
TYPO3\CMS\Install\FolderStructure\AbstractNode TYPO3\CMS\Install\FolderStructure\NodeInterface

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

 $targetPermission = '0664'
 
 $targetContent = null
 
- Protected Attributes inherited from TYPO3\CMS\Install\FolderStructure\AbstractNode
 $name = ''
 
 $targetPermission = null
 
 $parent = null
 
 $children = []
 

Detailed Description

A file

Definition at line 22 of file FileNode.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Install\FolderStructure\FileNode::__construct ( array  $structure,
NodeInterface  $parent = null 
)

Implement constructor

Parameters
array$structureStructure array
NodeInterface$parentParent object
Exceptions
Exception

Implements TYPO3\CMS\Install\FolderStructure\NodeInterface.

Definition at line 41 of file FileNode.php.

References TYPO3\CMS\Install\FolderStructure\AbstractNode\$parent, and TYPO3\CMS\Install\FolderStructure\AbstractNode\setTargetPermission().

Member Function Documentation

◆ createFile()

TYPO3\CMS\Install\FolderStructure\FileNode::createFile ( )
protected

◆ fix()

TYPO3\CMS\Install\FolderStructure\FileNode::fix ( )

Fix structure

If there is nothing to fix, returns an empty array

Returns
array<>

Implements TYPO3\CMS\Install\FolderStructure\NodeInterface.

Definition at line 113 of file FileNode.php.

References TYPO3\CMS\Install\FolderStructure\FileNode\fixSelf().

◆ fixSelf()

◆ getSelfStatus()

◆ getStatus()

TYPO3\CMS\Install\FolderStructure\FileNode::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 TYPO3\CMS\Install\FolderStructure\NodeInterface.

Definition at line 92 of file FileNode.php.

References TYPO3\CMS\Install\FolderStructure\AbstractNode\exists(), TYPO3\CMS\Install\FolderStructure\AbstractNode\getRelativePathBelowSiteRoot(), and TYPO3\CMS\Install\FolderStructure\FileNode\getSelfStatus().

◆ isContentCorrect()

TYPO3\CMS\Install\FolderStructure\FileNode::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 TYPO3\CMS\Install\FolderStructure\AbstractNode\getAbsolutePath().

Referenced by TYPO3\CMS\Install\FolderStructure\FileNode\getSelfStatus().

◆ isFile()

TYPO3\CMS\Install\FolderStructure\FileNode::isFile ( )
protected

◆ setContent()

TYPO3\CMS\Install\FolderStructure\FileNode::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 TYPO3\CMS\Install\FolderStructure\AbstractNode\getAbsolutePath(), and TYPO3\CMS\Install\FolderStructure\AbstractNode\getRelativePathBelowSiteRoot().

Referenced by TYPO3\CMS\Install\FolderStructure\FileNode\fixSelf().

Member Data Documentation

◆ $targetContent

TYPO3\CMS\Install\FolderStructure\FileNode::$targetContent = null
protected

Definition at line 32 of file FileNode.php.

◆ $targetPermission

TYPO3\CMS\Install\FolderStructure\FileNode::$targetPermission = '0664'
protected

Definition at line 27 of file FileNode.php.