Skip to content

Commit

Permalink
Update minimum PHP version to 7.4 and recommended version to 8.0.0 (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaLuckers authored Mar 2, 2023
1 parent e7607a2 commit 31ad611
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

strategy:
matrix:
php-version: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
php-version: ['7.4', '8.0', '8.1', '8.2']

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"vendor-dir": "core/vendor"
},
"require": {
"php": ">=7.2.5",
"php": ">=7.4.0",
"xpdo/xpdo": "~3.1.0",
"league/flysystem": "^2.0",
"league/flysystem-aws-s3-v3": "^2.0",
Expand Down
2 changes: 1 addition & 1 deletion core/src/Revolution/Processors/System/ConfigCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function checkRemoteAccess()

public function checkSystem()
{
$require = $this->modx->getOption('configcheck_min_phpversion', null, '7.2.5');
$require = $this->modx->getOption('configcheck_min_phpversion', null, '7.4.0');

$compare = version_compare(PHP_VERSION, $require, '>=');
if (!$compare) {
Expand Down
6 changes: 1 addition & 5 deletions core/src/Revolution/modX.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,7 @@ public static function sanitize(array &$target, array $patterns= [], $depth= 99,
$iteration++;
}
}
if (version_compare(PHP_VERSION, '7.4.0', '<') && get_magic_quotes_gpc()) {
$target[$key]= stripslashes($value);
} else {
$target[$key]= $value;
}
$target[$key]= $value;
}
}
return $target;
Expand Down
4 changes: 2 additions & 2 deletions manager/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
}

/* check for correct version of php */
$php_ver_comp = version_compare(PHP_VERSION,'7.2.5', '>=');
$php_ver_comp = version_compare(PHP_VERSION,'7.4.0', '>=');
if (!$php_ver_comp) {
die('Wrong php version! You\'re using PHP version "'.PHP_VERSION.'", and MODX Revolution only works on 7.2.5 or higher.');
die('Wrong php version! You\'re using PHP version "'.PHP_VERSION.'", and MODX Revolution only works on 7.4.0 or higher.');
}

/* set the document_root */
Expand Down
4 changes: 2 additions & 2 deletions setup/includes/test/modinstalltest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ protected function _checkPHPVersion()
$this->title('php_version', $this->install->lexicon('test_php_version_start') . ' ');
$phpVersion = phpversion();

$recommended_version = "7.3";
$required_version = "7.2.5";
$recommended_version = "8.0.0";
$required_version = "7.4.0";

$php_ver_comp = version_compare($phpVersion, $required_version, '>=');

Expand Down
2 changes: 1 addition & 1 deletion setup/provisioner/requirements.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* files found in the top-level directory of this distribution.
*/

define('MODX_MINIMUM_REQUIRED_PHP_VERSION', '7.2.5');
define('MODX_MINIMUM_REQUIRED_PHP_VERSION', '7.4.0');
define('MODX_REQUIRED_EXTENSIONS', [
"curl",
"dom",
Expand Down

0 comments on commit 31ad611

Please sign in to comment.