Require PHP >= 7.0

[MAILPOET-2582]
This commit is contained in:
Jan Jakeš
2020-01-27 13:37:09 +01:00
committed by Jack Kitterhing
parent 4fd6f96f76
commit 26b6f340d1
6 changed files with 17 additions and 17 deletions

View File

@@ -381,9 +381,9 @@ class RoboFile extends \Robo\Tasks {
return $this->collectionBuilder() return $this->collectionBuilder()
// PHP >= 5.6 for lib & tests // PHP >= 7.0 for lib & tests
->taskExec($task) ->taskExec($task)
->rawArg('--runtime-set testVersion 5.6-7.3') ->rawArg('--runtime-set testVersion 7.0-7.4')
->arg('--ignore=' . implode(',', [ ->arg('--ignore=' . implode(',', [
'lib/Config/PopulatorData/Templates', 'lib/Config/PopulatorData/Templates',
'tests/_data', 'tests/_data',
@@ -396,14 +396,14 @@ class RoboFile extends \Robo\Tasks {
'tests', 'tests',
]) ])
// PHP >= 5.6 in plugin root directory // PHP >= 7.0 in plugin root directory
->taskExec($task) ->taskExec($task)
->rawArg('--runtime-set testVersion 5.6-7.3') ->rawArg('--runtime-set testVersion 7.0-7.4')
->rawArg('-l .') ->rawArg('-l .')
// PHP >= 7.2 for dev tools, etc. // PHP >= 7.2 for dev tools, etc.
->taskExec($task) ->taskExec($task)
->rawArg('--runtime-set testVersion 7.2-7.3') ->rawArg('--runtime-set testVersion 7.2-7.4')
->arg('--ignore=' . implode(',', [ ->arg('--ignore=' . implode(',', [
'prefixer/build', 'prefixer/build',
'prefixer/vendor', 'prefixer/vendor',
@@ -429,7 +429,7 @@ class RoboFile extends \Robo\Tasks {
->taskExec( ->taskExec(
'./tasks/code_sniffer/vendor/bin/phpcbf ' . './tasks/code_sniffer/vendor/bin/phpcbf ' .
'--standard=./tasks/code_sniffer/MailPoet ' . '--standard=./tasks/code_sniffer/MailPoet ' .
'--runtime-set testVersion 5.6-7.3 ' . '--runtime-set testVersion 7.0-7.4 ' .
$filePath . ' -n' $filePath . ' -n'
) )
->run(); ->run();

View File

@@ -6,7 +6,7 @@
} }
], ],
"require": { "require": {
"php": ">=5.6", "php": ">=7.0",
"mtdowling/cron-expression": "^1.1", "mtdowling/cron-expression": "^1.1",
"soundasleep/html2text": "dev-master", "soundasleep/html2text": "dev-master",
"tburry/pquery": "^1.1.1" "tburry/pquery": "^1.1.1"
@@ -87,7 +87,7 @@
}, },
"config": { "config": {
"platform": { "platform": {
"php": "5.6.30" "php": "7.0.33"
}, },
"sort-packages": true "sort-packages": true
} }

View File

@@ -25,8 +25,8 @@ if (!is_plugin_active('mailpoet/mailpoet.php')) {
} }
// Check for minimum supported PHP version // Check for minimum supported PHP version
if (version_compare(phpversion(), '5.6.0', '<')) { if (version_compare(phpversion(), '7.0.0', '<')) {
echo 'MailPoet requires PHP version 5.6 or newer (version 7.2 recommended).'; echo 'MailPoet requires PHP version 7.0 or newer (version 7.2 recommended).';
exit(1); exit(1);
} }

View File

@@ -39,7 +39,7 @@ if (version_compare(get_bloginfo('version'), '4.6', '<')) {
} }
// Check for minimum supported PHP version // Check for minimum supported PHP version
if (version_compare(phpversion(), '5.6.0', '<')) { if (version_compare(phpversion(), '7.0.0', '<')) {
add_action('admin_notices', 'mailpoet_php_version_notice'); add_action('admin_notices', 'mailpoet_php_version_notice');
// deactivate the plugin // deactivate the plugin
add_action('admin_init', 'mailpoet_deactivate_plugin'); add_action('admin_init', 'mailpoet_deactivate_plugin');
@@ -62,7 +62,7 @@ function mailpoet_php_version_notice() {
$notice = str_replace( $notice = str_replace(
'[link]', '[link]',
'<a href="https://kb.mailpoet.com/article/152-minimum-requirements-for-mailpoet-3#php_version" target="_blank">', '<a href="https://kb.mailpoet.com/article/152-minimum-requirements-for-mailpoet-3#php_version" target="_blank">',
__('MailPoet requires PHP version 5.6 or newer (version 7.2 recommended). Please read our [link]instructions[/link] on how to upgrade your site.', 'mailpoet') __('MailPoet requires PHP version 7.0 or newer (version 7.2 recommended). Please read our [link]instructions[/link] on how to upgrade your site.', 'mailpoet')
); );
$notice = str_replace('[/link]', '</a>', $notice); $notice = str_replace('[/link]', '</a>', $notice);
printf('<div class="error"><p>%1$s</p></div>', $notice); printf('<div class="error"><p>%1$s</p></div>', $notice);

View File

@@ -1,6 +1,6 @@
{ {
"require": { "require": {
"php": ">=5.6", "php": ">=7.0",
"cerdic/css-tidy": "^1.7", "cerdic/css-tidy": "^1.7",
"doctrine/common": "2.7.3", "doctrine/common": "2.7.3",
"doctrine/dbal": "2.5.13", "doctrine/dbal": "2.5.13",
@@ -32,7 +32,7 @@
}, },
"config": { "config": {
"platform": { "platform": {
"php": "5.6" "php": "7.0.33"
}, },
"sort-packages": true "sort-packages": true
} }

View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "e56b3eb2d1443ec19f4f57dff7063fb2", "content-hash": "2316a5d00e066a847c812d348bd0e99e",
"packages": [ "packages": [
{ {
"name": "cerdic/css-tidy", "name": "cerdic/css-tidy",
@@ -1738,10 +1738,10 @@
"prefer-stable": false, "prefer-stable": false,
"prefer-lowest": false, "prefer-lowest": false,
"platform": { "platform": {
"php": ">=5.6" "php": ">=7.0"
}, },
"platform-dev": [], "platform-dev": [],
"platform-overrides": { "platform-overrides": {
"php": "5.6" "php": "7.0.33"
} }
} }