mirror of
https://github.com/getgrav/grav.git
synced 2025-10-26 07:56:07 +01:00
Prevent fatal error when composer hasn't been run
This commit is contained in:
@@ -31,5 +31,8 @@
|
||||
"Grav\\": "system/src/"
|
||||
},
|
||||
"files": ["system/defines.php"]
|
||||
},
|
||||
"archive": {
|
||||
"exclude": ["VERSION"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,16 @@ namespace Grav;
|
||||
if (version_compare($ver = PHP_VERSION, $req = '5.4.0', '<')) {
|
||||
exit(sprintf('You are running PHP %s, but Grav needs at least <strong>PHP %s</strong> to run.', $ver, $req));
|
||||
}
|
||||
$autoload = __DIR__ . '/vendor/autoload.php';
|
||||
if (!is_file($autoload)) {
|
||||
exit('Please run: <i>composer install -o</i>');
|
||||
}
|
||||
|
||||
use Grav\Common\Grav;
|
||||
use Grav\Common\Debugger;
|
||||
|
||||
// Register the auto-loader.
|
||||
$loader = require_once __DIR__ . '/vendor/autoload.php';
|
||||
$loader = require_once $autoload;
|
||||
|
||||
if (!ini_get('date.timezone')) {
|
||||
date_default_timezone_set('UTC');
|
||||
|
||||
Reference in New Issue
Block a user