Skip to content

Commit

Permalink
support redaxo 5.15.0-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Jan 24, 2023
1 parent ba64ad7 commit 7061745
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 8 deletions.
4 changes: 4 additions & 0 deletions config/_from-r5_15.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# config settings required starting with redaxo 5.15.+

parameters:
phpVersion: 80100 # PHP 8.1
8 changes: 8 additions & 0 deletions config/_up-to-r5_14.neon
Original file line number Diff line number Diff line change
@@ -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
4 changes: 0 additions & 4 deletions default-config.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
17 changes: 13 additions & 4 deletions install.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 7061745

Please sign in to comment.