RootNode extends DirectoryNode implements RootNodeInterface
Root node of structure
This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
Table of Contents
Interfaces
- RootNodeInterface
- Interface implemented by root node
Properties
- $children : array<string|int, mixed>
- $name : string
- $parent : NodeInterface|null
- $targetPermission : string
Methods
- __construct() : mixed
- Implement constructor
- fix() : array<string|int, FlashMessage>
- Fix structure
- getAbsolutePath() : string
- Root node does not call parent, but returns own name only
- getName() : string
- Get name
- getStatus() : array<string|int, FlashMessage>
- Get own status and status of child objects - Root node gives error status if not exists
- isWritable() : bool
- Create a test file and delete again if directory exists
- canFileBeCreated() : bool
- Create a test file and delete again - helper for isWritable
- createChildren() : mixed
- Create children nodes - done in directory and root node
- createDirectory() : FlashMessage
- Create directory if not exists
- exists() : bool
- Checks if node exists.
- fixPermission() : FlashMessage
- Fix permission if they are not equal to target permission
- fixSelf() : array<string|int, FlashMessage>
- Fix this directory:
- getChildren() : array<string|int, mixed>
- Get children
- getChildrenStatus() : array<string|int, FlashMessage>
- Get status of children
- getCurrentPermission() : string
- Get current permission of node
- getParent() : NodeInterface|null
- Get parent
- getRelativePathBelowSiteRoot() : string
- Cut off project path from given path
- getSelfStatus() : array<string|int, FlashMessage>
- Get status of directory - used in root and directory node
- getTargetPermission() : string
- Get target permission
- isDirectory() : bool
- Checks if not is a directory
- isPermissionCorrect() : bool
- Checks if current permission are identical to target permission
- isWindowsOs() : bool
- Returns TRUE if OS is windows
- setTargetPermission() : mixed
- Set target permission
Properties
$children
protected
array<string|int, mixed>
$children
= []
Directories and root may have children, files and link always empty array
$name
protected
string
$name
= ''
Name
$parent
protected
NodeInterface|null
$parent
Parent object of this structure node
$targetPermission
protected
string
$targetPermission
= '2775'
Default for directories is octal 02775 == decimal 1533
Methods
__construct()
Implement constructor
public
__construct(array<string|int, mixed> $structure[, NodeInterface $parent = null ]) : mixed
Parameters
- $structure : array<string|int, mixed>
-
Given structure
- $parent : NodeInterface = null
-
Must be NULL for RootNode
Tags
fix()
Fix structure
public
fix() : array<string|int, FlashMessage>
If there is nothing to fix, returns an empty array
Return values
array<string|int, FlashMessage>getAbsolutePath()
Root node does not call parent, but returns own name only
public
getAbsolutePath() : string
Return values
string —Absolute path
getName()
Get name
public
getName() : string
Return values
string —Name
getStatus()
Get own status and status of child objects - Root node gives error status if not exists
public
getStatus() : array<string|int, FlashMessage>
Return values
array<string|int, FlashMessage>isWritable()
Create a test file and delete again if directory exists
public
isWritable() : bool
Return values
bool —TRUE if test file creation was successful
canFileBeCreated()
Create a test file and delete again - helper for isWritable
protected
canFileBeCreated() : bool
Return values
bool —TRUE if test file creation was successful
createChildren()
Create children nodes - done in directory and root node
protected
createChildren(array<string|int, mixed> $structure) : mixed
Parameters
- $structure : array<string|int, mixed>
-
Array of children
Tags
createDirectory()
Create directory if not exists
protected
createDirectory() : FlashMessage
Tags
Return values
FlashMessageexists()
Checks if node exists.
protected
exists() : bool
Returns TRUE if it is there, even if it is only a link. Does not check the type!
Return values
boolfixPermission()
Fix permission if they are not equal to target permission
protected
fixPermission() : FlashMessage
Tags
Return values
FlashMessagefixSelf()
Fix this directory:
protected
fixSelf() : array<string|int, FlashMessage>
- create with correct permissions if it was not existing
- if there is no "write" permissions, try to fix it
- leave it alone otherwise
Return values
array<string|int, FlashMessage>getChildren()
Get children
protected
getChildren() : array<string|int, mixed>
Return values
array<string|int, mixed>getChildrenStatus()
Get status of children
protected
getChildrenStatus() : array<string|int, FlashMessage>
Return values
array<string|int, FlashMessage>getCurrentPermission()
Get current permission of node
protected
getCurrentPermission() : string
Return values
string —eg. 2775 for dirs, 0664 for files
getParent()
Get parent
protected
getParent() : NodeInterface|null
Return values
NodeInterface|nullgetRelativePathBelowSiteRoot()
Cut off project path from given path
protected
getRelativePathBelowSiteRoot([string $path = null ]) : string
Parameters
- $path : string = null
-
Given path
Tags
Return values
string —Relative path, but beginning with /
getSelfStatus()
Get status of directory - used in root and directory node
protected
getSelfStatus() : array<string|int, FlashMessage>
Return values
array<string|int, FlashMessage>getTargetPermission()
Get target permission
protected
getTargetPermission() : string
Make sure to call octdec on the value when passing this to chmod
Return values
string —Permissions as a 4 character octal string, i.e. 2775 or 0644
isDirectory()
Checks if not is a directory
protected
isDirectory() : bool
Return values
bool —True if node is a directory
isPermissionCorrect()
Checks if current permission are identical to target permission
protected
isPermissionCorrect() : bool
Return values
boolisWindowsOs()
Returns TRUE if OS is windows
protected
isWindowsOs() : bool
Return values
bool —TRUE on windows
setTargetPermission()
Set target permission
protected
setTargetPermission(string $permission) : mixed
Parameters
- $permission : string
-
Permissions as a 4 character octal string, i.e. 2775 or 0644