diff --git a/.travis.yml b/.travis.yml index 34a4e5f63..a23ea2b08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,16 +9,6 @@ php: - '7.0' - '7.1' -matrix: - include: - - php: '5.3' - dist: precise - sudo: required - env: - - PHPCS_VERSION=2.9.1 - - LOCALE_GEN=1 - - ENABLE_LDAP=1 - services: - mysql - postgresql diff --git a/application/clicommands/WebCommand.php b/application/clicommands/WebCommand.php index 20e1e9128..7277a1fd4 100644 --- a/application/clicommands/WebCommand.php +++ b/application/clicommands/WebCommand.php @@ -30,15 +30,6 @@ class WebCommand extends Command */ public function serveAction() { - $minVersion = '5.4.0'; - if (version_compare(PHP_VERSION, $minVersion) < 0) { - throw new IcingaException( - 'You are running PHP %s, internal webserver requires %s.', - PHP_VERSION, - $minVersion - ); - } - $fork = $this->params->get('daemonize'); $listen = $this->params->get('listen'); $port = $this->params->get('port'); diff --git a/application/forms/Config/Resource/DbResourceForm.php b/application/forms/Config/Resource/DbResourceForm.php index 89fe75f15..c270f7d91 100644 --- a/application/forms/Config/Resource/DbResourceForm.php +++ b/application/forms/Config/Resource/DbResourceForm.php @@ -46,7 +46,6 @@ class DbResourceForm extends Form $dbChoices['oci'] = 'Oracle (OCI8)'; } - $offerSsl = false; $offerPostgres = false; $offerIbm = false; $offerMysql = false; @@ -55,9 +54,6 @@ class DbResourceForm extends Form $offerPostgres = true; } elseif ($dbChoice === 'mysql') { $offerMysql = true; - if (version_compare(Platform::getPhpVersion(), '5.4.0', '>=')) { - $offerSsl = true; - } } elseif ($dbChoice === 'ibm') { $offerIbm = true; } @@ -161,62 +157,60 @@ class DbResourceForm extends Form 'label' => $this->translate('Persistent') ) ); - if ($offerSsl) { + $this->addElement( + 'checkbox', + 'use_ssl', + array( + 'autosubmit' => true, + 'label' => $this->translate('Use SSL'), + 'description' => $this->translate( + 'Whether to encrypt the connection or to authenticate using certificates' + ) + ) + ); + if (isset($formData['use_ssl']) && $formData['use_ssl']) { $this->addElement( - 'checkbox', - 'use_ssl', + 'text', + 'ssl_key', array( - 'autosubmit' => true, - 'label' => $this->translate('Use SSL'), - 'description' => $this->translate( - 'Whether to encrypt the connection or to authenticate using certificates' + 'label' => $this->translate('SSL Key'), + 'description' => $this->translate('The client key file path') + ) + ); + $this->addElement( + 'text', + 'ssl_cert', + array( + 'label' => $this->translate('SSL Certificate'), + 'description' => $this->translate('The certificate file path') + ) + ); + $this->addElement( + 'text', + 'ssl_ca', + array( + 'label' => $this->translate('SSL CA'), + 'description' => $this->translate('The CA certificate file path') + ) + ); + $this->addElement( + 'text', + 'ssl_capath', + array( + 'label' => $this->translate('SSL CA Path'), + 'description' => $this->translate( + 'The trusted CA certificates in PEM format directory path' ) ) ); - if (isset($formData['use_ssl']) && $formData['use_ssl']) { - $this->addElement( - 'text', - 'ssl_key', - array( - 'label' => $this->translate('SSL Key'), - 'description' => $this->translate('The client key file path') - ) - ); - $this->addElement( - 'text', - 'ssl_cert', - array( - 'label' => $this->translate('SSL Certificate'), - 'description' => $this->translate('The certificate file path') - ) - ); - $this->addElement( - 'text', - 'ssl_ca', - array( - 'label' => $this->translate('SSL CA'), - 'description' => $this->translate('The CA certificate file path') - ) - ); - $this->addElement( - 'text', - 'ssl_capath', - array( - 'label' => $this->translate('SSL CA Path'), - 'description' => $this->translate( - 'The trusted CA certificates in PEM format directory path' - ) - ) - ); - $this->addElement( - 'text', - 'ssl_cipher', - array( - 'label' => $this->translate('SSL Cipher'), - 'description' => $this->translate('The list of permissible ciphers') - ) - ); - } + $this->addElement( + 'text', + 'ssl_cipher', + array( + 'label' => $this->translate('SSL Cipher'), + 'description' => $this->translate('The list of permissible ciphers') + ) + ); } return $this; diff --git a/library/Icinga/Chart/Donut.php b/library/Icinga/Chart/Donut.php index 79230a6a6..8e6c58920 100644 --- a/library/Icinga/Chart/Donut.php +++ b/library/Icinga/Chart/Donut.php @@ -374,13 +374,7 @@ class Donut protected function encode($content) { - if (version_compare(PHP_VERSION, '5.4.0') >= 0) { - $replaceFlags = ENT_COMPAT | ENT_SUBSTITUTE | ENT_HTML5; - } else { - $replaceFlags = ENT_COMPAT | ENT_IGNORE; - } - - return htmlspecialchars($content, $replaceFlags, 'UTF-8', true); + return htmlspecialchars($content, ENT_COMPAT | ENT_SUBSTITUTE | ENT_HTML5, 'UTF-8', true); } protected function renderAttributes(array $attributes) diff --git a/library/Icinga/Data/Filter/Filter.php b/library/Icinga/Data/Filter/Filter.php index 635de5660..f5d8bdf13 100644 --- a/library/Icinga/Data/Filter/Filter.php +++ b/library/Icinga/Data/Filter/Filter.php @@ -98,7 +98,7 @@ abstract class Filter } } - krsort($operators, version_compare(PHP_VERSION, '5.4.0') >= 0 ? SORT_NATURAL : SORT_REGULAR); + krsort($operators, SORT_NATURAL); foreach ($operators as $id => $operator) { $f = $filter->getById($id); if ($f->getOperatorName() !== $operator) { diff --git a/library/Icinga/Protocol/Ldap/LdapConnection.php b/library/Icinga/Protocol/Ldap/LdapConnection.php index 9a7346e91..5290894b3 100644 --- a/library/Icinga/Protocol/Ldap/LdapConnection.php +++ b/library/Icinga/Protocol/Ldap/LdapConnection.php @@ -427,10 +427,7 @@ class LdapConnection implements Selectable, Inspectable { $this->bind(); - if ($query->getUsePagedResults() - && version_compare(PHP_VERSION, '5.4.0') >= 0 - && $this->getCapabilities()->hasPagedResult() - ) { + if ($query->getUsePagedResults() && $this->getCapabilities()->hasPagedResult()) { return $this->runPagedQuery($query, $fields); } else { return $this->runQuery($query, $fields); @@ -1156,11 +1153,7 @@ class LdapConnection implements Selectable, Inspectable $sequenceOf = '30' . str_pad(dechex($sequenceOfOctets), 2, '0', STR_PAD_LEFT) . $sequenceOf; } - if (version_compare(PHP_VERSION, '5.4.0') >= 0) { - return hex2bin($sequenceOf); - } else { - return pack('H*', $sequenceOf); - } + return hex2bin($sequenceOf); } /** diff --git a/library/Icinga/Util/Json.php b/library/Icinga/Util/Json.php index b41da82d5..98e013919 100644 --- a/library/Icinga/Util/Json.php +++ b/library/Icinga/Util/Json.php @@ -23,9 +23,7 @@ class Json */ public static function encode($value, $options = 0, $depth = 512) { - if (version_compare(phpversion(), '5.4.0', '<')) { - $encoded = json_encode($value); - } elseif (version_compare(phpversion(), '5.5.0', '<')) { + if (version_compare(phpversion(), '5.5.0', '<')) { $encoded = json_encode($value, $options); } else { $encoded = json_encode($value, $options, $depth); @@ -49,11 +47,7 @@ class Json */ public static function decode($json, $assoc = false, $depth = 512, $options = 0) { - if (version_compare(phpversion(), '5.4.0', '<')) { - $decoded = json_decode($json, $assoc, $depth); - } else { - $decoded = json_decode($json, $assoc, $depth, $options); - } + $decoded = json_decode($json, $assoc, $depth, $options); if (json_last_error() !== JSON_ERROR_NONE) { throw new JsonDecodeException('%s: %s', static::lastErrorMsg(), var_export($json, true)); diff --git a/library/Icinga/Web/StyleSheet.php b/library/Icinga/Web/StyleSheet.php index 63eee3647..21a69f252 100644 --- a/library/Icinga/Web/StyleSheet.php +++ b/library/Icinga/Web/StyleSheet.php @@ -80,10 +80,6 @@ class StyleSheet */ public function __construct() { - // PHP had a rather conservative PCRE backtrack limit unless 5.3.7 - if (version_compare(PHP_VERSION, '5.3.7') <= 0) { - ini_set('pcre.backtrack_limit', 1000000); - } $app = Icinga::app(); $this->app = $app; $this->lessCompiler = new LessCompiler(); diff --git a/library/Icinga/Web/View.php b/library/Icinga/Web/View.php index 7568a0a9c..2d5bb4cc3 100644 --- a/library/Icinga/Web/View.php +++ b/library/Icinga/Web/View.php @@ -58,11 +58,6 @@ class View extends Zend_View_Abstract */ const CHARSET = 'UTF-8'; - /** - * The flags we use for htmlspecialchars depend on our PHP version - */ - private $replaceFlags; - /** * Flag to register stream wrapper * @@ -97,12 +92,6 @@ class View extends Zend_View_Abstract } } - if (version_compare(PHP_VERSION, '5.4.0') >= 0) { - $this->replaceFlags = ENT_COMPAT | ENT_SUBSTITUTE | ENT_HTML5; - } else { - $this->replaceFlags = ENT_COMPAT | ENT_IGNORE; - } - parent::__construct($config); } @@ -124,7 +113,7 @@ class View extends Zend_View_Abstract */ public function escape($value) { - return htmlspecialchars($value, $this->replaceFlags, self::CHARSET, true); + return htmlspecialchars($value, ENT_COMPAT | ENT_SUBSTITUTE | ENT_HTML5, self::CHARSET, true); } /** diff --git a/library/Icinga/Web/Widget/FilterEditor.php b/library/Icinga/Web/Widget/FilterEditor.php index d8f2ff763..9d5f82619 100644 --- a/library/Icinga/Web/Widget/FilterEditor.php +++ b/library/Icinga/Web/Widget/FilterEditor.php @@ -668,7 +668,7 @@ class FilterEditor extends AbstractWidget } } - krsort($operators, version_compare(PHP_VERSION, '5.4.0') >= 0 ? SORT_NATURAL : SORT_REGULAR); + krsort($operators, SORT_NATURAL); foreach ($operators as $id => $operator) { $f = $filter->getById($id); if ($f->getOperatorName() !== $operator) { diff --git a/modules/setup/application/locale/de_DE/LC_MESSAGES/setup.po b/modules/setup/application/locale/de_DE/LC_MESSAGES/setup.po index 64ddfb8c8..17d2742d2 100644 --- a/modules/setup/application/locale/de_DE/LC_MESSAGES/setup.po +++ b/modules/setup/application/locale/de_DE/LC_MESSAGES/setup.po @@ -884,11 +884,9 @@ msgstr "Root DN" #: ../../../../modules/setup/library/Setup/WebWizard.php:556 msgid "" -"Running Icinga Web 2 requires PHP version 5.3.2. Advanced features like the " -"built-in web server require PHP version 5.4." +"Running Icinga Web 2 requires PHP version 5.4." msgstr "" -"Der Betrieb von Icinga Web 2 erfordert die PHP-Version 5.3.2. Anspruchsvolle " -"Funktionalitäten wie der eingebaute Webserver erfordern die PHP-Version 5.4." +"Der Betrieb von Icinga Web 2 erfordert die PHP-Version 5.4." #: ../../../../modules/setup/library/Setup/Steps/ResourceStep.php:104 msgid "SSL Cert" diff --git a/modules/setup/application/locale/it_IT/LC_MESSAGES/setup.po b/modules/setup/application/locale/it_IT/LC_MESSAGES/setup.po index 8a765f2c1..ec1d04b3c 100644 --- a/modules/setup/application/locale/it_IT/LC_MESSAGES/setup.po +++ b/modules/setup/application/locale/it_IT/LC_MESSAGES/setup.po @@ -862,11 +862,9 @@ msgstr "Root DN" #: /usr/share/icingaweb2/modules/setup/library/Setup/WebWizard.php:552 msgid "" -"Running Icinga Web 2 requires PHP version 5.3.2. Advanced features like the " -"built-in web server require PHP version 5.4." +"Running Icinga Web 2 requires PHP version 5.4." msgstr "" -"Icinga Web 2 richiede PHP 5.3.2. Funzionalità avanzate come il web server " -"integrato richiedono PHP 5.4." +"Icinga Web 2 richiede PHP 5.4." #: /usr/share/icingaweb2/modules/setup/library/Setup/WebWizard.php:356 msgid "Setup Icinga Web 2" diff --git a/modules/setup/library/Setup/WebWizard.php b/modules/setup/library/Setup/WebWizard.php index e5d406946..2181cab59 100644 --- a/modules/setup/library/Setup/WebWizard.php +++ b/modules/setup/library/Setup/WebWizard.php @@ -568,11 +568,10 @@ class WebWizard extends Wizard implements SetupWizard $set = new RequirementSet(); $set->add(new PhpVersionRequirement(array( - 'condition' => array('>=', '5.3.2'), + 'condition' => array('>=', '5.4'), 'description' => mt( 'setup', - 'Running Icinga Web 2 requires PHP version 5.3.2. Advanced features' - . ' like the built-in web server require PHP version 5.4.' + 'Running Icinga Web 2 requires PHP version 5.4.' ) )));