2007-07-19 12:40:28 +02:00
|
|
|
<?php
|
2012-03-31 09:09:45 +02:00
|
|
|
|
2017-06-07 08:07:33 +02:00
|
|
|
use SilverStripe\Core\AppKernel;
|
|
|
|
use SilverStripe\Core\HTTPApplication;
|
|
|
|
use SilverStripe\Core\Startup\ErrorControlChainMiddleware;
|
|
|
|
use SilverStripe\Core\Startup\OutputMiddleware;
|
|
|
|
use SilverStripe\Control\HTTPRequest;
|
|
|
|
|
|
|
|
require __DIR__ . '/src/includes/autoload.php';
|
|
|
|
|
2017-06-13 04:10:59 +02:00
|
|
|
// Build request and detect flush
|
2017-06-07 08:07:33 +02:00
|
|
|
$request = HTTPRequest::createFromEnvironment();
|
2017-06-13 04:10:59 +02:00
|
|
|
$flush = $request->getVar('flush') || strpos($request->getURL(), 'dev/build') === 0;
|
|
|
|
|
|
|
|
// Default application
|
|
|
|
$kernel = new AppKernel($flush);
|
2017-06-07 08:07:33 +02:00
|
|
|
$app = new HTTPApplication($kernel);
|
|
|
|
$app->addMiddleware(new OutputMiddleware());
|
|
|
|
$app->addMiddleware(new ErrorControlChainMiddleware($app, $request));
|
|
|
|
$app->handle($request);
|