Commit cee43fca authored by Johan Cwiklinski's avatar Johan Cwiklinski Committed by Johan Cwiklinski

Requires PHP >= 5.5.0; fixes #1322

Add a constant for minimal PHP version
drop password_compat anid array_column that are native in PHP 5.5
parent 24409047
......@@ -19,9 +19,6 @@ script:
matrix:
include:
- php: 5.4
addons:
mariadb: 5.5
- php: 5.5
addons:
mariadb: 5.5
......
......@@ -31,7 +31,7 @@ It is distributed under the GNU GENERAL PUBLIC LICENSE Version 2 - please consul
* A web server (Apache, Nginx, IIS, etc.)
* MariaDB (or MySQL < 5.7)
* PHP 5.4 or higher
* PHP 5.5 or higher
* Mandatory PHP extensions:
- json
- mbstring
......
......@@ -11,7 +11,7 @@
"docs": "https://github.com/glpi-project/doc"
},
"require": {
"php": ">=5.4.0",
"php": ">=5.5.0",
"ext-mysqli": "*",
"ext-fileinfo": "*",
"ext-json": "*",
......@@ -19,7 +19,6 @@
"ext-gd": "*",
"ext-zlib": "*",
"ext-curl": "*",
"ircmaxell/password-compat": "~1.0.0",
"jasig/phpcas": "~1.3.0",
"iamcal/lib_autolink": "~1.7",
"phpmailer/phpmailer": "~5.2",
......@@ -30,7 +29,6 @@
"zendframework/zend-i18n": "~2.4.0",
"zendframework/zend-loader": "~2.4.0",
"zetacomponents/graph": "~1.5",
"ramsey/array_column": "^1.1.3",
"michelf/php-markdown": "^1.6",
"true/punycode": "^2.1",
"ircmaxell/random-lib": "^1.2"
......@@ -44,7 +42,7 @@
},
"config": {
"platform": {
"php": "5.4.0"
"php": "5.5.0"
}
}
}
......@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "bf4a5fc1045be86e633a6956c3ba93ea",
"content-hash": "b7fae723e06d057e4d7f15ef4f3fafb7",
"hash": "300b44764ee58f9af429bbb3ae18d370",
"content-hash": "6f2d94a3c2d7cc4829a6ea986890c7e1",
"packages": [
{
"name": "iamcal/lib_autolink",
......@@ -39,48 +39,6 @@
],
"time": "2015-05-22 17:10:41"
},
{
"name": "ircmaxell/password-compat",
"version": "v1.0.4",
"source": {
"type": "git",
"url": "https://github.com/ircmaxell/password_compat.git",
"reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ircmaxell/password_compat/zipball/5c5cde8822a69545767f7c7f3058cb15ff84614c",
"reference": "5c5cde8822a69545767f7c7f3058cb15ff84614c",
"shasum": ""
},
"require-dev": {
"phpunit/phpunit": "4.*"
},
"type": "library",
"autoload": {
"files": [
"lib/password.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Anthony Ferrara",
"email": "ircmaxell@php.net",
"homepage": "http://blog.ircmaxell.com"
}
],
"description": "A compatibility library for the proposed simplified password hashing algorithm: https://wiki.php.net/rfc/password_hash",
"homepage": "https://github.com/ircmaxell/password_compat",
"keywords": [
"hashing",
"password"
],
"time": "2014-11-20 16:49:30"
},
{
"name": "ircmaxell/random-lib",
"version": "v1.2.0",
......@@ -347,51 +305,6 @@
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"time": "2016-06-06 09:09:37"
},
{
"name": "ramsey/array_column",
"version": "1.1.3",
"source": {
"type": "git",
"url": "https://github.com/ramsey/array_column.git",
"reference": "f8e52eb28e67eb50e613b451dd916abcf783c1db"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ramsey/array_column/zipball/f8e52eb28e67eb50e613b451dd916abcf783c1db",
"reference": "f8e52eb28e67eb50e613b451dd916abcf783c1db",
"shasum": ""
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "0.8.*",
"phpunit/phpunit": "~4.5",
"satooshi/php-coveralls": "0.6.*",
"squizlabs/php_codesniffer": "~2.2"
},
"type": "library",
"autoload": {
"files": [
"src/array_column.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ben Ramsey",
"homepage": "http://benramsey.com"
}
],
"description": "Provides functionality for array_column() to projects using PHP earlier than version 5.5.",
"homepage": "https://github.com/ramsey/array_column",
"keywords": [
"array",
"array_column",
"column"
],
"time": "2015-03-20 22:07:39"
},
{
"name": "sabre/vobject",
"version": "3.5.3",
......@@ -1509,7 +1422,7 @@
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
"php": ">=5.4.0",
"php": ">=5.5.0",
"ext-mysqli": "*",
"ext-fileinfo": "*",
"ext-json": "*",
......@@ -1520,6 +1433,6 @@
},
"platform-dev": [],
"platform-overrides": {
"php": "5.4.0"
"php": "5.5.0"
}
}
......@@ -38,6 +38,7 @@
// Current version of GLPI
define("GLPI_VERSION","9.2");
define("GLPI_SCHEMA_VERSION","9.2");
define('GLPI_MIN_PHP', '5.5.0');
define('GLPI_YEAR', '2016');
define("GLPI_DEMO_MODE","0");
......
......@@ -881,8 +881,8 @@ class Toolbox {
echo "<tr class='tab_bg_1'><td class='b left'>".__('Testing PHP Parser')."</td>";
// PHP Version - exclude PHP3, PHP 4 and zend.ze1 compatibility
if (version_compare(PHP_VERSION, '5.4.0') >= 0) {
// PHP > 5.4 ok, now check PHP zend.ze1_compatibility_mode
if (version_compare(PHP_VERSION, GLPI_MIN_PHP) >= 0) {
// PHP version ok, now check PHP zend.ze1_compatibility_mode
if (ini_get("zend.ze1_compatibility_mode") == 1) {
$error = 2;
echo "<td class='red'>
......@@ -891,15 +891,15 @@ class Toolbox {
"</td>";
} else {
echo "<td><img src='".$CFG_GLPI['root_doc']."/pics/ok_min.png' alt=\"".
__s('PHP version is at least 5.4.0 - Perfect!')."\"
title=\"".__s('PHP version is at least 5.4.0 - Perfect!')."\"></td>";
sprintf(__s('PHP version is at least %s - Perfect!'), GLPI_MIN_PHP)."\"
title=\"".sprintf(__s('PHP version is at least %s - Perfect!'), GLPI_MIN_PHP)."\"></td>";
}
} else { // PHP <5
$error = 2;
echo "<td class='red'>
<img src='".$CFG_GLPI['root_doc']."/pics/ko_min.png'>".
__('You must install at least PHP 5.4.0.')."</td>";
sprintf(__('You must install at least PHP %s.'), GLPI_MIN_PHP)."</td>";
}
echo "</tr>";
......
......@@ -37,8 +37,8 @@
*/
// Check PHP version not to have trouble
if (version_compare(PHP_VERSION, "5.4.0") < 0) {
die("PHP >= 5.4.0 required");
if (version_compare(PHP_VERSION, GLPI_MIN_PHP) < 0) {
die(sprintf("PHP >= %s required", GLPI_MIN_PHP));
}
define('DO_NOT_CHECK_HTTP_REFERER', 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment