silverstripe-framework/cli-script.php

22 lines
551 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';
$_SERVER['SCRIPT_FILENAME'] = __FILE__;
2017-06-12 08:04:34 +02:00
chdir(__DIR__);
2017-06-12 08:04:34 +02:00
require __DIR__ . '/src/includes/autoload.php';
2017-06-12 08:04:34 +02:00
// Default application
$request = HTTPRequest::createFromEnvironment();
$kernel = new AppKernel();
$app = new HTTPApplication($kernel);
$app->addMiddleware(new OutputMiddleware());
$app->handle($request);