mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 08:44:10 +02:00
Drop support for PHP < 5.6
This commit is contained in:
parent
d6c4df7a5d
commit
8990d6f46e
@ -3,8 +3,6 @@ dist: trusty
|
|||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
php:
|
php:
|
||||||
- '5.4'
|
|
||||||
- '5.5'
|
|
||||||
- '5.6'
|
- '5.6'
|
||||||
- '7.0'
|
- '7.0'
|
||||||
- '7.1'
|
- '7.1'
|
||||||
|
@ -14,9 +14,7 @@ chapter.
|
|||||||
|
|
||||||
* [Icinga 2](https://www.icinga.com/products/icinga-2/) with the IDO database backend (MySQL or PostgreSQL)
|
* [Icinga 2](https://www.icinga.com/products/icinga-2/) with the IDO database backend (MySQL or PostgreSQL)
|
||||||
* A web server, e.g. Apache or Nginx
|
* A web server, e.g. Apache or Nginx
|
||||||
* PHP version >= 5.6.0. Though Icinga Web 2 version 2.5.x is compatible with PHP version >= 5.3.2 there are modules
|
* PHP version >= 5.6.0
|
||||||
which require a higher PHP version. Also, future versions of Icinga Web 2 will drop support for outdated PHP versions.
|
|
||||||
Packages for Icinga Web 2 already require PHP >= 5.6.0
|
|
||||||
* The following PHP modules must be installed: cURL, gettext, intl, mbstring, OpenSSL and xml
|
* The following PHP modules must be installed: cURL, gettext, intl, mbstring, OpenSSL and xml
|
||||||
* Default time zone configured for PHP in the php.ini file
|
* Default time zone configured for PHP in the php.ini file
|
||||||
* LDAP PHP library when using Active Directory or LDAP for authentication
|
* LDAP PHP library when using Active Directory or LDAP for authentication
|
||||||
|
@ -54,11 +54,7 @@ class Json
|
|||||||
*/
|
*/
|
||||||
protected static function encodeAndSanitize($value, $options, $depth, $autoSanitize)
|
protected static function encodeAndSanitize($value, $options, $depth, $autoSanitize)
|
||||||
{
|
{
|
||||||
if (version_compare(phpversion(), '5.5.0', '<')) {
|
$encoded = json_encode($value, $options, $depth);
|
||||||
$encoded = json_encode($value, $options);
|
|
||||||
} else {
|
|
||||||
$encoded = json_encode($value, $options, $depth);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (json_last_error()) {
|
switch (json_last_error()) {
|
||||||
case JSON_ERROR_NONE:
|
case JSON_ERROR_NONE:
|
||||||
@ -72,7 +68,7 @@ class Json
|
|||||||
// Fallthrough
|
// Fallthrough
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new JsonEncodeException('%s: %s', static::lastErrorMsg(), var_export($value, true));
|
throw new JsonEncodeException('%s: %s', json_last_error_msg(), var_export($value, true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,39 +88,11 @@ class Json
|
|||||||
$decoded = json_decode($json, $assoc, $depth, $options);
|
$decoded = json_decode($json, $assoc, $depth, $options);
|
||||||
|
|
||||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||||
throw new JsonDecodeException('%s: %s', static::lastErrorMsg(), var_export($json, true));
|
throw new JsonDecodeException('%s: %s', json_last_error_msg(), var_export($json, true));
|
||||||
}
|
}
|
||||||
return $decoded;
|
return $decoded;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* {@link json_last_error_msg()} replacement for PHP < 5.5.0
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
protected static function lastErrorMsg()
|
|
||||||
{
|
|
||||||
if (version_compare(PHP_VERSION, '5.5.0', '>=')) {
|
|
||||||
return json_last_error_msg();
|
|
||||||
}
|
|
||||||
|
|
||||||
// All possible error codes before PHP 5.5.0 (except JSON_ERROR_NONE)
|
|
||||||
switch (json_last_error()) {
|
|
||||||
case JSON_ERROR_DEPTH:
|
|
||||||
return 'Maximum stack depth exceeded';
|
|
||||||
case JSON_ERROR_STATE_MISMATCH:
|
|
||||||
return 'State mismatch (invalid or malformed JSON)';
|
|
||||||
case JSON_ERROR_CTRL_CHAR:
|
|
||||||
return 'Control character error, possibly incorrectly encoded';
|
|
||||||
case JSON_ERROR_SYNTAX:
|
|
||||||
return 'Syntax error';
|
|
||||||
case JSON_ERROR_UTF8:
|
|
||||||
return 'Malformed UTF-8 characters, possibly incorrectly encoded';
|
|
||||||
default:
|
|
||||||
return 'Unknown error';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replace bad byte sequences in UTF-8 strings inside the given JSON-encodable structure with question marks
|
* Replace bad byte sequences in UTF-8 strings inside the given JSON-encodable structure with question marks
|
||||||
*
|
*
|
||||||
|
@ -884,9 +884,9 @@ msgstr "Root DN"
|
|||||||
|
|
||||||
#: ../../../../modules/setup/library/Setup/WebWizard.php:556
|
#: ../../../../modules/setup/library/Setup/WebWizard.php:556
|
||||||
msgid ""
|
msgid ""
|
||||||
"Running Icinga Web 2 requires PHP version 5.4."
|
"Running Icinga Web 2 requires PHP version 5.6."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Der Betrieb von Icinga Web 2 erfordert die PHP-Version 5.4."
|
"Der Betrieb von Icinga Web 2 erfordert die PHP-Version 5.6."
|
||||||
|
|
||||||
#: ../../../../modules/setup/library/Setup/Steps/ResourceStep.php:104
|
#: ../../../../modules/setup/library/Setup/Steps/ResourceStep.php:104
|
||||||
msgid "SSL Cert"
|
msgid "SSL Cert"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# Copyright (C) 2015 Icinga Development Team
|
# Copyright (C) 2015 Icinga Development Team
|
||||||
# This file is distributed under the same license as Setup Module.
|
# This file is distributed under the same license as Setup Module.
|
||||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||||
#
|
#
|
||||||
#, fuzzy
|
#, fuzzy
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
@ -862,9 +862,9 @@ msgstr "Root DN"
|
|||||||
|
|
||||||
#: /usr/share/icingaweb2/modules/setup/library/Setup/WebWizard.php:552
|
#: /usr/share/icingaweb2/modules/setup/library/Setup/WebWizard.php:552
|
||||||
msgid ""
|
msgid ""
|
||||||
"Running Icinga Web 2 requires PHP version 5.4."
|
"Running Icinga Web 2 requires PHP version 5.6."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Icinga Web 2 richiede PHP 5.4."
|
"Icinga Web 2 richiede PHP 5.6."
|
||||||
|
|
||||||
#: /usr/share/icingaweb2/modules/setup/library/Setup/WebWizard.php:356
|
#: /usr/share/icingaweb2/modules/setup/library/Setup/WebWizard.php:356
|
||||||
msgid "Setup Icinga Web 2"
|
msgid "Setup Icinga Web 2"
|
||||||
|
@ -568,10 +568,10 @@ class WebWizard extends Wizard implements SetupWizard
|
|||||||
$set = new RequirementSet();
|
$set = new RequirementSet();
|
||||||
|
|
||||||
$set->add(new PhpVersionRequirement(array(
|
$set->add(new PhpVersionRequirement(array(
|
||||||
'condition' => array('>=', '5.4'),
|
'condition' => array('>=', '5.6'),
|
||||||
'description' => mt(
|
'description' => mt(
|
||||||
'setup',
|
'setup',
|
||||||
'Running Icinga Web 2 requires PHP version 5.4.'
|
'Running Icinga Web 2 requires PHP version 5.6.'
|
||||||
)
|
)
|
||||||
)));
|
)));
|
||||||
|
|
||||||
|
@ -3,16 +3,10 @@
|
|||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
ICINGAWEB_HOME=${ICINGAWEB_HOME:="$(dirname "$(readlink -f $(dirname "$0"))")"}
|
ICINGAWEB_HOME=${ICINGAWEB_HOME:="$(dirname "$(readlink -f $(dirname "$0"))")"}
|
||||||
PHP_VERSION="$(php -r 'echo phpversion();')"
|
|
||||||
PHPCS_VERSION=${PHPCS_VERSION:=3.0.2}
|
PHPCS_VERSION=${PHPCS_VERSION:=3.0.2}
|
||||||
MOCKERY_VERSION=${MOCKERY_VERSION:=0.9.9}
|
MOCKERY_VERSION=${MOCKERY_VERSION:=0.9.9}
|
||||||
HAMCREST_VERSION=${HAMCREST_VERSION:=2.0.0}
|
HAMCREST_VERSION=${HAMCREST_VERSION:=2.0.0}
|
||||||
|
PHPUNIT_VERSION=${PHPUNIT_VERSION:=5.7}
|
||||||
if [ "$PHP_VERSION" '<' 5.6.0 ]; then
|
|
||||||
PHPUNIT_VERSION=${PHPUNIT_VERSION:=4.8}
|
|
||||||
else
|
|
||||||
PHPUNIT_VERSION=${PHPUNIT_VERSION:=5.7}
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd ${ICINGAWEB_HOME}
|
cd ${ICINGAWEB_HOME}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user