Improved PHP Min Version Check (#5846)

This commit is contained in:
Lucas Bartholemy 2022-08-15 17:25:24 +02:00 committed by GitHub
parent c577bf5fc6
commit aeb046df1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 2 deletions

View File

@ -9,6 +9,7 @@ HumHub Changelog
- Fix #5814: Fix numerated lists in mail summary content
- Fix #5830: Fix cron job of search index rebuilding
- Fix #5838: Fix deprecated null value for `file_exists()` on PHP 8.1
- Enh #5846: Improved PHP minimum version checks
- Fix #5845: Fix unknown `streamQuery` on load `Filter`
1.12.0 (July 27, 2022)

View File

@ -49,6 +49,22 @@ class Application extends \yii\web\Application
parent::__construct($config);
}
/**
* @inheritdoc
*/
public function init()
{
if (version_compare(phpversion(), $this->minSupportedPhpVersion, '<')) {
throw new \Exception(sprintf(
'Installed PHP Version is too old! Required minimum version is PHP %s (Installed: %s)',
$this->minSupportedPhpVersion,
phpversion()
));
}
parent::init();
}
/**
* @inheritdoc
*/

View File

@ -57,8 +57,12 @@ class Application extends \yii\console\Application
*/
public function init()
{
if (version_compare(phpversion(), '5.6', '<')) {
throw new Exception('Installed PHP Version is too old! Required minimum version is PHP 5.6 (Installed: ' . phpversion() . ')');
if (version_compare(phpversion(), $this->minSupportedPhpVersion, '<')) {
throw new Exception(sprintf(
'Installed PHP Version is too old! Required minimum version is PHP %s (Installed: %s)',
$this->minSupportedPhpVersion,
phpversion()
));
}
if (BaseSettingsManager::isDatabaseInstalled()) {