Fix syntax error in PHP 5.3. Move the version check before requiring the autoloaded deps

This commit is contained in:
Flavio Copes
2017-02-16 10:16:30 +01:00
parent 724f24335a
commit e2cc55a4e3
3 changed files with 7 additions and 6 deletions

View File

@@ -3,6 +3,7 @@
1. [](#bugfix)
* Fix for double extensions getting added during some redirects [#1307](https://github.com/getgrav/grav/issues/1307)
* Fix syntax error in PHP 5.3. Move the version check before requiring the autoloaded deps
# v1.1.16
## 02/10/2017
@@ -17,7 +18,7 @@
* Various code cleanups (return types, missing variables in doclbocks, etc.)
1. [](#bugfix)
* Fix blueprints slug validation [https://github.com/getgrav/grav-plugin-admin/issues/955](https://github.com/getgrav/grav-plugin-admin/issues/955)
# v1.1.15
## 01/30/2017

View File

@@ -7,6 +7,7 @@
*/
namespace Grav;
define('GRAV_PHP_MIN', '5.5.9');
// Ensure vendor libraries exist
$autoload = __DIR__ . '/vendor/autoload.php';
@@ -23,13 +24,13 @@ if (PHP_SAPI == 'cli-server') {
use Grav\Common\Grav;
use RocketTheme\Toolbox\Event\Event;
// Register the auto-loader.
$loader = require_once $autoload;
if (version_compare($ver = PHP_VERSION, $req = GRAV_PHP_MIN, '<')) {
die(sprintf('You are running PHP %s, but Grav needs at least <strong>PHP %s</strong> to run.', $ver, $req));
}
// Register the auto-loader.
$loader = require_once $autoload;
// Set timezone to default, falls back to system if php.ini not set
date_default_timezone_set(@date_default_timezone_get());
@@ -50,6 +51,6 @@ $grav = Grav::instance(
try {
$grav->process();
} catch (\Exception $e) {
$grav->fireEvent('onFatalException', new Event(['exception' => $e]));
$grav->fireEvent('onFatalException', new Event(array('exception' => $e)));
throw $e;
}

View File

@@ -11,7 +11,6 @@ define('GRAV', true);
define('GRAV_VERSION', '1.1.16');
define('GRAV_TESTING', false);
define('DS', '/');
define('GRAV_PHP_MIN', '5.5.9');
// Directories and Paths
if (!defined('GRAV_ROOT')) {