mirror of
https://github.com/getgrav/grav.git
synced 2025-12-05 15:29:57 +01:00
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:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user