diff --git a/typo3/sysext/install/Classes/FolderStructure/DirectoryNode.php b/typo3/sysext/install/Classes/FolderStructure/DirectoryNode.php index 3775f66a922422c42b9f59dfd1f16b83b16df97b..19dc5b9c7712f6da41aab635cefa2f85e39da0f4 100644 --- a/typo3/sysext/install/Classes/FolderStructure/DirectoryNode.php +++ b/typo3/sysext/install/Classes/FolderStructure/DirectoryNode.php @@ -82,7 +82,7 @@ class DirectoryNode extends AbstractNode implements NodeInterface { $status->setTitle($this->getRelativePathBelowSiteRoot() . ' does not exist'); $result[] = $status; } else { - $result[] = $this->getSelfStatus(); + $result = $this->getSelfStatus(); } $result = array_merge($result, $this->getChildrenStatus()); return $result; @@ -180,10 +180,10 @@ class DirectoryNode extends AbstractNode implements NodeInterface { /** * Get status of directory - used in root and directory node * - * @return \TYPO3\CMS\Install\Status\StatusInterface + * @return array<\TYPO3\CMS\Install\Status\StatusInterface> */ protected function getSelfStatus() { - $result = NULL; + $result = array(); if (!$this->isDirectory()) { $status = new Status\ErrorStatus(); $status->setTitle($this->getRelativePathBelowSiteRoot() . ' is not a directory'); @@ -191,7 +191,7 @@ class DirectoryNode extends AbstractNode implements NodeInterface { 'Path ' . $this->getAbsolutePath() . ' should be a directory,' . ' but is of type ' . filetype($this->getAbsolutePath()) ); - $result = $status; + $result[] = $status; } elseif (!$this->isWritable()) { $status = new Status\ErrorStatus(); $status->setTitle($this->getRelativePathBelowSiteRoot() . ' is not writable'); @@ -199,7 +199,7 @@ class DirectoryNode extends AbstractNode implements NodeInterface { 'Path ' . $this->getAbsolutePath() . ' exists, but no file below' . ' can be created.' ); - $result = $status; + $result[] = $status; } elseif (!$this->isPermissionCorrect()) { if ($this->getTargetPermissionRelaxed() === TRUE) { $status = new Status\NoticeStatus(); @@ -208,7 +208,7 @@ class DirectoryNode extends AbstractNode implements NodeInterface { 'Target permission are ' . $this->targetPermission . ' but current permission are ' . $this->getCurrentPermission() ); - $result = $status; + $result[] = $status; } else { $status = new Status\WarningStatus(); $status->setTitle($this->getRelativePathBelowSiteRoot() . ' has wrong permission'); @@ -216,12 +216,12 @@ class DirectoryNode extends AbstractNode implements NodeInterface { 'Target permission are ' . $this->targetPermission . ' but current permission are ' . $this->getCurrentPermission() ); - $result = $status; + $result[] = $status; } } else { $status = new Status\OkStatus(); $status->setTitle($this->getRelativePathBelowSiteRoot()); - $result = $status; + $result[] = $status; } return $result; } diff --git a/typo3/sysext/install/Classes/FolderStructure/FileNode.php b/typo3/sysext/install/Classes/FolderStructure/FileNode.php index ea6bbbbd552ffd8833dbdc8db48a6ba20b6e58fd..176d7aece802fba394f95b01cb3b8b5c58e51700 100644 --- a/typo3/sysext/install/Classes/FolderStructure/FileNode.php +++ b/typo3/sysext/install/Classes/FolderStructure/FileNode.php @@ -105,7 +105,7 @@ class FileNode extends AbstractNode implements NodeInterface { $status->setTitle($this->getRelativePathBelowSiteRoot() . ' does not exist'); $result[] = $status; } else { - $result[] = $this->getSelfStatus(); + $result = $this->getSelfStatus(); } return $result; } @@ -189,10 +189,10 @@ class FileNode extends AbstractNode implements NodeInterface { /** * Get status of file * - * @return \TYPO3\CMS\Install\Status\StatusInterface + * @return array<\TYPO3\CMS\Install\Status\StatusInterface> */ protected function getSelfStatus() { - $result = NULL; + $result = array(); if (!$this->isFile()) { $status = new Status\ErrorStatus(); $status->setTitle($this->getRelativePathBelowSiteRoot() . ' is not a file'); @@ -200,7 +200,7 @@ class FileNode extends AbstractNode implements NodeInterface { 'Path ' . $this->getAbsolutePath() . ' should be a file,' . ' but is of type ' . filetype($this->getAbsolutePath()) ); - $result = $status; + $result[] = $status; } elseif (!$this->isWritable()) { $status = new Status\WarningStatus(); $status->setTitle($this->getRelativePathBelowSiteRoot() . ' is not writable'); @@ -208,7 +208,7 @@ class FileNode extends AbstractNode implements NodeInterface { 'Path ' . $this->getAbsolutePath() . ' exists, but no file below' . ' can be created.' ); - $result = $status; + $result[] = $status; } elseif (!$this->isPermissionCorrect()) { $status = new Status\WarningStatus(); $status->setTitle($this->getRelativePathBelowSiteRoot() . ' has wrong permission'); @@ -216,19 +216,20 @@ class FileNode extends AbstractNode implements NodeInterface { 'Target permission are ' . $this->targetPermission . ' but current permission are ' . $this->getCurrentPermission() ); - $result = $status; - } elseif (!$this->isContentCorrect()) { + $result[] = $status; + } + if ($this->isFile() && !$this->isContentCorrect()) { $status = new Status\ErrorStatus(); $status->setTitle($this->getRelativePathBelowSiteRoot() . ' content differs'); $status->setMessage( 'File content is not identical to target content. Probably, this file was' . ' changed manually. The content will not be fixed to not override your changes.' ); - $result = $status; + $result[] = $status; } else { $status = new Status\OkStatus(); $status->setTitle($this->getRelativePathBelowSiteRoot()); - $result = $status; + $result[] = $status; } return $result; } diff --git a/typo3/sysext/install/Classes/FolderStructure/RootNode.php b/typo3/sysext/install/Classes/FolderStructure/RootNode.php index 65d34cff639724a95c16d923d60ad3d7dfcfc70b..a62e2e8fbbcb6213ab5f539cf0adf2442881b292 100644 --- a/typo3/sysext/install/Classes/FolderStructure/RootNode.php +++ b/typo3/sysext/install/Classes/FolderStructure/RootNode.php @@ -83,7 +83,7 @@ class RootNode extends DirectoryNode implements RootNodeInterface { $status->setTitle($this->getAbsolutePath() . ' does not exist'); $result[] = $status; } else { - $result[] = $this->getSelfStatus(); + $result = $this->getSelfStatus(); } $result = array_merge($result, $this->getChildrenStatus()); return $result;