2015-06-10 21:00:58 +00:00
|
|
|
#!/usr/bin/env php
|
|
|
|
<?php
|
|
|
|
|
2016-02-11 20:54:33 +00:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* A command line application to dump a database to a generation script.
|
|
|
|
*/
|
|
|
|
|
2015-06-10 21:00:58 +00:00
|
|
|
use Drupal\Core\Command\DbDumpApplication;
|
|
|
|
use Drupal\Core\DrupalKernel;
|
|
|
|
use Drupal\Core\Site\Settings;
|
|
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
|
|
|
|
|
|
if (PHP_SAPI !== 'cli') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Bootstrap.
|
|
|
|
$autoloader = require __DIR__ . '/../../autoload.php';
|
|
|
|
$request = Request::createFromGlobals();
|
2020-04-23 16:15:14 +00:00
|
|
|
Settings::initialize(dirname(__DIR__, 2), DrupalKernel::findSitePath($request), $autoloader);
|
2015-06-10 21:00:58 +00:00
|
|
|
$kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod')->boot();
|
|
|
|
|
|
|
|
// Run the database dump command.
|
2015-10-02 18:59:39 +00:00
|
|
|
$application = new DbDumpApplication();
|
2015-06-10 21:00:58 +00:00
|
|
|
$application->run();
|