Remove all hardcoded older PHP required version, use GRAV_PHP_MIN constant instead

Thanks @MATsxm for the hint in https://github.com/getgrav/grav/pull/570
This commit is contained in:
Flavio Copes
2015-12-28 18:46:14 +01:00
parent 492b290845
commit 9b85c1b0f7
4 changed files with 16 additions and 15 deletions

View File

@@ -1,9 +1,6 @@
<?php
namespace Grav;
if (version_compare($ver = PHP_VERSION, $req = '5.4.0', '<')) {
throw new \RuntimeException(sprintf('You are running PHP %s, but Grav needs at least <strong>PHP %s</strong> to run.', $ver, $req));
}
// Ensure vendor libraries exist
$autoload = __DIR__ . '/vendor/autoload.php';
@@ -16,6 +13,10 @@ use Grav\Common\Grav;
// Register the auto-loader.
$loader = require_once $autoload;
if (version_compare($ver = PHP_VERSION, $req = GRAV_PHP_MIN, '<')) {
throw new \RuntimeException(sprintf('You are running PHP %s, but Grav needs at least <strong>PHP %s</strong> to run.', $ver, $req));
}
// Set timezone to default, falls back to system if php.ini not set
date_default_timezone_set(@date_default_timezone_get());