Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Add install:fixfolderstructure command #126

Merged
merged 1 commit into from
Apr 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ script:
- ./typo3cms backend:unlock
- ./typo3cms cleanup:updatereferenceindex
- ./typo3cms database:updateschema "*"
- rm typo3temp/index.html && ./typo3cms install:fixfolderstructure && [ -f "typo3temp/index.html" ]
26 changes: 26 additions & 0 deletions Classes/Command/InstallCommandController.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,32 @@ protected function getPackagesFromRootComposerFile() {
return $composerData->extra->{$activePackageKey};
}

/**
* Automatically create files and folders, required for a TYPO3 installation.
*
* This command is great e.g. for creating the typo3temp folder structure during deployment
*
* @throws \TYPO3\CMS\Install\FolderStructure\Exception
* @throws \TYPO3\CMS\Install\Status\Exception
*/
public function fixFolderStructureCommand() {
/** @var $folderStructureFactory \TYPO3\CMS\Install\FolderStructure\DefaultFactory */
$folderStructureFactory = GeneralUtility::makeInstance('TYPO3\\CMS\\Install\\FolderStructure\\DefaultFactory');
/** @var $structureFacade \TYPO3\CMS\Install\FolderStructure\StructureFacade */
$structureFacade = $folderStructureFactory->getStructure();

$fixedStatusObjects = $structureFacade->fix();

if (empty($fixedStatusObjects)) {
$this->outputLine('<info>No action performed!</info>');
} else {
$this->outputLine('<info>The following directory structure has been fixed:</info>');
foreach ($fixedStatusObjects as $fixedStatusObject) {
$this->outputLine($fixedStatusObject->getTitle());
}
}
}

/**
* Check environment and create folder structure
*
Expand Down