Skip to content

Commit

Permalink
[TASK] Drop 'typo3/ should be link' recommendation
Browse files Browse the repository at this point in the history
The recommendation of FolderStructure having index.php and typo3/
folder as links is old fashioned, even if not using composer
based instances. The config has no functional meaning in the
install tool and can just be dropped.

Change-Id: Ie8addd1713cadeb381a11cf9a362ac255da6e72c
Resolves: #83550
Releases: master
Reviewed-on: https://review.typo3.org/55343
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
  • Loading branch information
lolli42 authored and Jigal van Hemert committed Jan 13, 2018
1 parent 6dded35 commit 673630d
Showing 1 changed file with 149 additions and 171 deletions.
320 changes: 149 additions & 171 deletions typo3/sysext/install/Classes/FolderStructure/DefaultFactory.php
Expand Up @@ -14,8 +14,6 @@
* The TYPO3 project - inspiring people to share!
*/

use TYPO3\CMS\Core\Core\Bootstrap;

/**
* Factory returns default folder structure object hierarchy
*/
Expand Down Expand Up @@ -44,193 +42,173 @@ protected function getDefaultStructureDefinition()
$filePermission = $GLOBALS['TYPO3_CONF_VARS']['SYS']['fileCreateMask'];
$directoryPermission = $GLOBALS['TYPO3_CONF_VARS']['SYS']['folderCreateMask'];

if (Bootstrap::usesComposerClassLoading()) {
// In composer mode the links are configurable and might even be actual files
// Ignore this structure in this case
$structureAdditional = [];
} else {
$structureAdditional = [
[
'name' => 'index.php',
'type' => LinkNode::class,
'target' => 'typo3_src/index.php',
],
return [
// Cut off trailing forward / from PATH_site, so root node has no trailing slash like all others
'name' => substr(PATH_site, 0, -1),
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => 'typo3',
'type' => LinkNode::class,
'target' => 'typo3_src/typo3',
],
];
}
$structureBase = [
[
'name' => 'typo3temp',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => 'index.html',
'type' => FileNode::class,
'targetPermission' => $filePermission,
'targetContent' => '',
],
[
'name' => 'assets',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => 'compressed',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission
],
[
'name' => 'css',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission
],
[
'name' => 'js',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission
],
[
'name' => 'images',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission
],
[
'name' => '_processed_',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission
'name' => 'typo3temp',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => 'index.html',
'type' => FileNode::class,
'targetPermission' => $filePermission,
'targetContent' => '',
],
[
'name' => 'assets',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => 'compressed',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission
],
[
'name' => 'css',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission
],
[
'name' => 'js',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission
],
[
'name' => 'images',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission
],
[
'name' => '_processed_',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission
]
]
]
],
[
'name' => 'var',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => '.htaccess',
'type' => FileNode::class,
'targetPermission' => $filePermission,
'targetContentFile' => PATH_site . 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/typo3temp-var-htaccess',
],
[
'name' => 'charset',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
],
[
'name' => 'Cache',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
],
[
'name' => 'locks',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
],
[
'name' => 'var',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => '.htaccess',
'type' => FileNode::class,
'targetPermission' => $filePermission,
'targetContentFile' => PATH_site . 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/typo3temp-var-htaccess',
],
[
'name' => 'charset',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
],
[
'name' => 'Cache',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
],
[
'name' => 'locks',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
]
]
]
],
],
],
],
[
'name' => 'typo3conf',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => 'ext',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
],
[
'name' => 'l10n',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
[
'name' => 'typo3conf',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => 'ext',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
],
[
'name' => 'l10n',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
],
],
],
],
[
'name' => !empty($GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir']) ? rtrim($GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'], '/') : 'fileadmin',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => '_temp_',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => '.htaccess',
'type' => FileNode::class,
'targetPermission' => $filePermission,
'targetContentFile' => PATH_site . 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-htaccess',
],
[
'name' => 'index.html',
'type' => FileNode::class,
'targetPermission' => $filePermission,
'targetContentFile' => PATH_site . 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-index.html',
[
'name' => !empty($GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir']) ? rtrim($GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'], '/') : 'fileadmin',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => '_temp_',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => '.htaccess',
'type' => FileNode::class,
'targetPermission' => $filePermission,
'targetContentFile' => PATH_site . 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-htaccess',
],
[
'name' => 'index.html',
'type' => FileNode::class,
'targetPermission' => $filePermission,
'targetContentFile' => PATH_site . 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-index.html',
],
],
],
],
[
'name' => 'user_upload',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => '_temp_',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => 'index.html',
'type' => FileNode::class,
'targetPermission' => $filePermission,
'targetContent' => '',
],
[
'name' => 'importexport',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => '.htaccess',
'type' => FileNode::class,
'targetPermission' => $filePermission,
'targetContentFile' => PATH_site . 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-user_upload-temp-importexport-htaccess',
],
[
'name' => 'index.html',
'type' => FileNode::class,
'targetPermission' => $filePermission,
'targetContentFile' => PATH_site . 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-index.html',
[
'name' => 'user_upload',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => '_temp_',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => 'index.html',
'type' => FileNode::class,
'targetPermission' => $filePermission,
'targetContent' => '',
],
[
'name' => 'importexport',
'type' => DirectoryNode::class,
'targetPermission' => $directoryPermission,
'children' => [
[
'name' => '.htaccess',
'type' => FileNode::class,
'targetPermission' => $filePermission,
'targetContentFile' => PATH_site . 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-user_upload-temp-importexport-htaccess',
],
[
'name' => 'index.html',
'type' => FileNode::class,
'targetPermission' => $filePermission,
'targetContentFile' => PATH_site . 'typo3/sysext/install/Resources/Private/FolderStructureTemplateFiles/fileadmin-temp-index.html',
],
],
],
],
],
],
[
'name' => 'index.html',
'type' => FileNode::class,
'targetPermission' => $filePermission,
'targetContent' => '',
[
'name' => 'index.html',
'type' => FileNode::class,
'targetPermission' => $filePermission,
'targetContent' => '',
],
],
],
],
],
],
];

return [
// Cut off trailing forward / from PATH_site, so root node has no trailing slash like all others
'name' => substr(PATH_site, 0, -1),
'targetPermission' => $directoryPermission,
'children' => array_merge($structureAdditional, $structureBase)
];
}
}

0 comments on commit 673630d

Please sign in to comment.