diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 7a773bf..6cb3a77 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -18,10 +18,13 @@ jobs: strategy: fail-fast: false matrix: - typo3: [ '^11.5.0', '^12.4.0' ] + typo3: [ '^11.5.0', '^12.4.0', '^13.4.0' ] php: [ '8.1', '8.2', '8.3' ] dependency-version: [ lowest, stable ] experimental: [ false ] + exclude: + - typo3: '^13.4.0' + php: '8.1' continue-on-error: ${{ matrix.experimental }} diff --git a/composer.json b/composer.json index 8acdc0b..ae1b5c2 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "symfony/console": "^5.4 || ^6.4 || ^7.0", "symfony/yaml": "^5.4 || ^6.4 || ^7.0", "typo3/cms-composer-installers": "^4.0@rc || >=5.0", - "typo3/cms-core": "^11.5.20 || ^12.4", + "typo3/cms-core": "^11.5.20 || ^12.4 || ^13.4", "composer-runtime-api": "^2.2", "symfony/polyfill-php80": "^1.23.1" }, diff --git a/src/Composer/InstallerScript/DumpSettings.php b/src/Composer/InstallerScript/DumpSettings.php index ee95177..a82d77a 100644 --- a/src/Composer/InstallerScript/DumpSettings.php +++ b/src/Composer/InstallerScript/DumpSettings.php @@ -45,7 +45,7 @@ private function generateLocalConfigurationFile(ScriptEvent $event): bool $fileSystem = new Filesystem(); $fileSystem->ensureDirectoryExists(getenv('TYPO3_PATH_APP') . '/config'); $fileSystem->ensureDirectoryExists(getenv('TYPO3_PATH_APP') . '/var/cache/code'); - if ($this->isMajorVersionTwelve($event->getComposer())) { + if ($this->isMajorVersionTwelveOrHigher($event->getComposer())) { $systemConfigurationFile = getenv('TYPO3_PATH_APP') . '/config/system/settings.php'; $fileSystem->ensureDirectoryExists(getenv('TYPO3_PATH_APP') . '/config/system'); } else { @@ -100,7 +100,7 @@ private function generateLocalConfigurationFile(ScriptEvent $event): bool ) > 0; } - private function isMajorVersionTwelve(Composer $composer): bool + private function isMajorVersionTwelveOrHigher(Composer $composer): bool { $repository = $composer->getRepositoryManager()->getLocalRepository(); $corePackage = $repository->findPackage('typo3/cms-core', '*'); diff --git a/src/Typo3SiteConfiguration.php b/src/Typo3SiteConfiguration.php index 08b9b93..27ec9d1 100644 --- a/src/Typo3SiteConfiguration.php +++ b/src/Typo3SiteConfiguration.php @@ -12,6 +12,9 @@ class Typo3SiteConfiguration extends SiteConfiguration { + protected $configFileName = 'config.yaml'; + protected $cacheIdentifier = 'sites-configuration'; + /** * Load plain configuration * This method should only be used in case the original configuration as it exists in the file should be loaded, diff --git a/src/Xclass/ConfigurationManager.php b/src/Xclass/ConfigurationManager.php index 68ce9d3..3f8be96 100644 --- a/src/Xclass/ConfigurationManager.php +++ b/src/Xclass/ConfigurationManager.php @@ -55,14 +55,13 @@ * * This class handles the access to the files * - EXT:core/Configuration/DefaultConfiguration.php (default TYPO3_CONF_VARS) - * - typo3conf/LocalConfiguration.php (overrides of TYPO3_CONF_VARS) - * - typo3conf/AdditionalConfiguration.php (optional additional local code blocks) + * - config/system/settings.php or typo3conf/system/settings.php - previously known as LocalConfiguration.php + * - config/system/additional.php or typo3conf/system/additional.php (optional additional code blocks) - previously known as typo3conf/AdditionalConfiguration.php * * IMPORTANT: * This class is intended for internal core use ONLY. * Extensions should usually use the resulting $GLOBALS['TYPO3_CONF_VARS'] array, - * do not try to modify settings in LocalConfiguration.php with an extension. - * + * do not try to modify settings in the config/system/settings.php file with an extension. * @internal */ class ConfigurationManager @@ -130,7 +129,7 @@ class ConfigurationManager * * @var array */ - protected $whiteListedLocalConfigurationPaths = [ + protected array $allowedSettingsPaths = [ 'EXTCONF', 'DB', 'SYS/caching/cacheConfigurations', @@ -190,7 +189,8 @@ public function getDefaultConfigurationDescriptionFileLocation() } /** - * Return local configuration array typo3conf/LocalConfiguration.php + * Return configuration array of typo3conf/system/settings.php or config/system/settings.php, falls back + * to typo3conf/LocalConfiguration.php * * @return array Content array of local configuration file */ @@ -466,7 +466,7 @@ public function enableFeature(string $featureName): bool } /** - * Disables a feature and writes the option to LocalConfiguration.php + * Disables a feature and writes the option to system/settings.php * Short-hand method * Warning: TO BE USED ONLY to disable a single feature. * NOT TO BE USED within iterations to disable multiple features. @@ -509,7 +509,7 @@ public function exportConfiguration() } /** - * Write local configuration array to typo3conf/LocalConfiguration.php + * Write configuration array to %config-dir%/system/settings.php * * @param array $configuration The local configuration to be written * @@ -529,7 +529,7 @@ public function writeLocalConfiguration(array $configuration) } /** - * Write additional configuration array to typo3conf/AdditionalConfiguration.php + * Write additional configuration array to config/system/additional.php / typo3conf/system/additional.php * * @param array $additionalConfigurationLines The configuration lines to be written * @@ -549,18 +549,17 @@ public function writeAdditionalConfiguration(array $additionalConfigurationLines /** * Uses FactoryConfiguration file and a possible AdditionalFactoryConfiguration - * file in typo3conf to create a basic LocalConfiguration.php. This is used - * by the install tool in an early step. + * file in typo3conf to create a basic config/system/settings.php. This is used + * by the installer in an early step. * * @throws \RuntimeException - * * @internal */ public function createLocalConfigurationFromFactoryConfiguration() { if (file_exists($this->getLocalConfigurationFileLocation())) { throw new \RuntimeException( - 'LocalConfiguration.php exists already', + basename($this->getSystemConfigurationFileLocation(true)) . ' already exists', 1364836026 ); } @@ -583,14 +582,13 @@ public function createLocalConfigurationFromFactoryConfiguration() * Check if access / write to given path in local configuration is allowed. * * @param string $path Path to search for - * * @return bool TRUE if access is allowed */ protected function isValidLocalConfigurationPath($path) { // Early return for white listed paths - foreach ($this->whiteListedLocalConfigurationPaths as $whiteListedPath) { - if (str_starts_with($path, $whiteListedPath)) { + foreach ($this->allowedSettingsPaths as $allowedSettingsPath) { + if (str_starts_with($path, $allowedSettingsPath)) { return true; } }