2024-09-26 07:16:47 +02:00
|
|
|
#!/usr/bin/env php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
use SilverStripe\Cli\Sake;
|
2024-10-09 01:18:03 +02:00
|
|
|
use SilverStripe\ORM\DB;
|
2024-09-26 07:16:47 +02:00
|
|
|
|
|
|
|
// Ensure that people can't access this from a web-server
|
|
|
|
if (!in_array(PHP_SAPI, ['cli', 'cgi', 'cgi-fcgi'])) {
|
|
|
|
echo 'sake cannot be run from a web request, you have to run it on the command-line.';
|
|
|
|
die();
|
|
|
|
}
|
|
|
|
|
|
|
|
require_once __DIR__ . '/../src/includes/autoload.php';
|
|
|
|
|
2024-10-09 01:18:03 +02:00
|
|
|
// CLI scripts must only use the primary database connection and not replicas
|
|
|
|
DB::setMustUsePrimary();
|
|
|
|
|
2024-09-26 07:16:47 +02:00
|
|
|
$sake = new Sake();
|
|
|
|
$sake->run();
|