grav/index.php

36 lines
677 B
PHP
Raw Normal View History

2014-08-02 21:11:33 +02:00
<?php
2014-08-18 13:13:51 +02:00
namespace Grav;
2014-08-02 21:11:33 +02:00
2014-08-06 20:46:49 +02:00
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));
2014-08-06 20:46:49 +02:00
}
$autoload = __DIR__ . '/vendor/autoload.php';
if (!is_file($autoload)) {
exit('Please run: <i>bin/grav install</i>');
}
2014-08-06 20:46:49 +02:00
2014-08-18 13:13:51 +02:00
use Grav\Common\Grav;
2014-08-02 21:11:33 +02:00
// Register the auto-loader.
$loader = require_once $autoload;
2014-08-02 21:11:33 +02:00
if (!ini_get('date.timezone')) {
date_default_timezone_set('UTC');
2014-08-02 21:11:33 +02:00
}
2014-08-18 13:13:51 +02:00
$grav = Grav::instance(
array(
'loader' => $loader
)
2014-08-18 13:13:51 +02:00
);
try {
$grav->process();
} catch (\Exception $e) {
2014-08-19 17:45:42 +02:00
$grav->fireEvent('onFatalException');
throw $e;
}
2014-08-02 21:11:33 +02:00