From 7061745551360cf1851d14217f6712a4e8e78080 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Tue, 24 Jan 2023 20:14:37 +0100 Subject: [PATCH] support redaxo 5.15.0-dev --- config/_from-r5_15.neon | 4 ++++ config/_up-to-r5_14.neon | 8 ++++++++ default-config.neon | 4 ---- install.php | 17 +++++++++++++---- 4 files changed, 25 insertions(+), 8 deletions(-) create mode 100644 config/_from-r5_15.neon create mode 100644 config/_up-to-r5_14.neon diff --git a/config/_from-r5_15.neon b/config/_from-r5_15.neon new file mode 100644 index 000000000..639520cfa --- /dev/null +++ b/config/_from-r5_15.neon @@ -0,0 +1,4 @@ +# config settings required starting with redaxo 5.15.+ + +parameters: + phpVersion: 80100 # PHP 8.1 diff --git a/config/_up-to-r5_14.neon b/config/_up-to-r5_14.neon new file mode 100644 index 000000000..a12c0ff8d --- /dev/null +++ b/config/_up-to-r5_14.neon @@ -0,0 +1,8 @@ +# config settings required up to redaxo 5.14.* + +parameters: + scanFiles: + - ../../core/vendor/symfony/polyfill-php80/bootstrap.php + - ../../core/vendor/symfony/polyfill-php81/bootstrap.php + + phpVersion: 70300 # PHP 7.3 diff --git a/default-config.neon b/default-config.neon index 2d0214702..3bbca0112 100644 --- a/default-config.neon +++ b/default-config.neon @@ -35,11 +35,7 @@ parameters: # autoload core symbols which are not autoloadable scanDirectories: - ../../core/functions/ - scanFiles: - - ../../core/vendor/symfony/polyfill-php80/bootstrap.php - - ../../core/vendor/symfony/polyfill-php81/bootstrap.php - phpVersion: 70300 # PHP 7.3 treatPhpDocTypesAsCertain: false bootstrapFiles: diff --git a/install.php b/install.php index 9b7f7bc44..3437035ba 100644 --- a/install.php +++ b/install.php @@ -52,11 +52,20 @@ RexStanUserConfig::save(0, $paths, [], 70300); } +if (rex_version::compare(rex::getVersion(), '5.15.0-dev', '>=')) { + $configFileContent = '# rexstan auto generated file - do not edit, delete, rename'. PHP_EOL . PHP_EOL . + 'includes:'. PHP_EOL . + ' - ' . $addon->getPath('default-config.neon') . PHP_EOL . + ' - ' . $addon->getPath('config/_from-r5_15.neon') . PHP_EOL . + ' - ' . $userConfigPath. PHP_EOL; +} else { + $configFileContent = '# rexstan auto generated file - do not edit, delete, rename'. PHP_EOL . PHP_EOL . + 'includes:'. PHP_EOL . + ' - ' . $addon->getPath('default-config.neon') . PHP_EOL . + ' - ' . $addon->getPath('config/_up-to-r5_14.neon') . PHP_EOL . + ' - ' . $userConfigPath. PHP_EOL; +} -$configFileContent = '# rexstan auto generated file - do not edit, delete, rename'. PHP_EOL . PHP_EOL . - 'includes:'. PHP_EOL . - ' - ' . $addon->getPath('default-config.neon') . PHP_EOL . - ' - ' . $userConfigPath. PHP_EOL; $configPath = __DIR__.'/phpstan.neon'; if (false === rex_file::put($configPath, $configFileContent)) { $addon->setProperty('installmsg', sprintf('Unable to write rexstan config "%s"', $configPath));