38 throw new \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException(
39 'Node must have parent',
46 if (strstr($structure[
'name'],
'/') !== FALSE) {
47 throw new \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException(
48 'Directory name must not contain forward slash',
52 $this->name = $structure[
'name'];
54 if (isset($structure[
'targetPermission'])) {
58 if (array_key_exists(
'children', $structure)) {
59 $this->createChildren($structure[
'children']);
73 $status->setMessage(
'The Install Tool can try to create it');
104 public function fix() {
106 foreach ($this->children as $child) {
126 $result[] = $resultCreateDirectory;
127 if ($resultCreateDirectory instanceof \
TYPO3\CMS\Install\Status\
OkStatus &&
143 ' but is of type ' . $fileType .
'. This cannot be fixed automatically. Please investigate.' 148 ' but is of unknown type, probably because an upper level directory does not exist. Please investigate.' 177 'The target directory could not be created. There is probably a' .
178 ' group or owner permission problem on the parent directory.' 203 'Path ' . $this->
getAbsolutePath() .
' exists, but no file underneath it' .
231 protected function getChildrenStatus() {
233 foreach ($this->children as $child) {
246 $testFileName = uniqid(
'installToolTest_', TRUE);
261 return (!@is_link($path) && @is_dir($path));
270 protected function createChildren(array $structure) {
271 foreach ($structure as $child) {
272 if (!array_key_exists(
'type', $child)) {
273 throw new \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException(
274 'Child must have type',
278 if (!array_key_exists(
'name', $child)) {
279 throw new \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException(
280 'Child must have name',
284 $name = $child[
'name'];
285 foreach ($this->children as $existingChild) {
287 if ($existingChild->getName() ===
$name) {
288 throw new \TYPO3\CMS\Install\FolderStructure\Exception\InvalidArgumentException(
289 'Child name must be unique',
294 $this->children[] =
new $child[
'type']($child, $this);
setTargetPermission($permission)
__construct(array $structure, NodeInterface $parent=NULL)
if($list_of_literals) if(!empty($literals)) if(!empty($literals)) $result
Analyse literals to prepend the N char to them if their contents aren't numeric.
getRelativePathBelowSiteRoot($path=NULL)