silverstripe-framework/cli-script.php

20 lines
528 B
PHP
Raw Normal View History

<?php
2017-06-12 08:04:34 +02:00
// CLI specific bootstrapping
use SilverStripe\Core\AppKernel;
use SilverStripe\Core\HTTPApplication;
use SilverStripe\Core\Startup\OutputMiddleware;
use SilverStripe\Control\HTTPRequest;
2017-06-12 08:04:34 +02:00
require __DIR__ . '/src/includes/cli.php';
require __DIR__ . '/src/includes/autoload.php';
// Build request and detect flush
2017-06-12 08:04:34 +02:00
$request = HTTPRequest::createFromEnvironment();
// Default application
$kernel = new AppKernel();
2017-06-12 08:04:34 +02:00
$app = new HTTPApplication($kernel);
$app->addMiddleware(new OutputMiddleware());
$app->handle($request);