1
<?php
2

3
// CLI specific bootstrapping
4
use SilverStripe\Control\CLIRequestBuilder;
5
use SilverStripe\Control\HTTPApplication;
6
use SilverStripe\Core\CoreKernel;
7

8 0
require __DIR__ . '/src/includes/autoload.php';
9

10
// Ensure that people can't access this from a web-server
11 0
if (!in_array(PHP_SAPI, ["cli", "cgi", "cgi-fcgi"])) {
12 0
    echo "cli-script.php can't be run from a web request, you have to run it on the command-line.";
13 0
    die();
14
}
15

16
// Build request and detect flush
17 0
$request = CLIRequestBuilder::createFromEnvironment();
18

19
// Default application
20 0
$kernel = new CoreKernel(BASE_PATH);
21 0
$app = new HTTPApplication($kernel);
22 0
$response = $app->handle($request);
23 0
$response->output();

Read our documentation on viewing source code .

Loading