TYPO3  7.6
FolderStructure.php
Go to the documentation of this file.
1 <?php
2 namespace TYPO3\CMS\Install\Controller\Action\Tool;
3 
4 /*
5  * This file is part of the TYPO3 CMS project.
6  *
7  * It is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License, either version 2
9  * of the License, or any later version.
10  *
11  * For the full copyright and license information, please read the
12  * LICENSE.txt file that was distributed with this source code.
13  *
14  * The TYPO3 project - inspiring people to share!
15  */
16 
17 use TYPO3\CMS\Install\Controller\Action;
18 
23 {
29  protected function executeAction()
30  {
32  $folderStructureFactory = $this->objectManager->get(\TYPO3\CMS\Install\FolderStructure\DefaultFactory::class);
34  $structureFacade = $folderStructureFactory->getStructure();
35 
36  $fixedStatusObjects = array();
37  if (isset($this->postValues['set']['fix'])) {
38  $fixedStatusObjects = $structureFacade->fix();
39  }
40 
41  $statusObjects = $structureFacade->getStatus();
43  $statusUtility = $this->objectManager->get(\TYPO3\CMS\Install\Status\StatusUtility::class);
44 
45  $errorStatus = array_merge(
46  $statusUtility->filterBySeverity($statusObjects, 'error'),
47  $statusUtility->filterBySeverity($statusObjects, 'warning')
48  );
49  $okStatus = array_merge(
50  $statusUtility->filterBySeverity($statusObjects, 'notice'),
51  $statusUtility->filterBySeverity($statusObjects, 'information'),
52  $statusUtility->filterBySeverity($statusObjects, 'ok')
53  );
54 
56  $permissionCheck = $this->objectManager->get(\TYPO3\CMS\Install\FolderStructure\DefaultPermissionsCheck::class);
57  $filePermissionStatus = $permissionCheck->getMaskStatus('fileCreateMask');
58  $directoryPermissionStatus = $permissionCheck->getMaskStatus('folderCreateMask');
59 
60  $this->view
61  ->assign('filePermissionStatus', $filePermissionStatus)
62  ->assign('directoryPermissionStatus', $directoryPermissionStatus)
63  ->assign('fixedStatus', $fixedStatusObjects)
64  ->assign('errorStatus', $errorStatus)
65  ->assign('okStatus', $okStatus);
66 
67  return $this->view->render();
68  }
69 }