Initial Drupal 11 with DDEV setup
This commit is contained in:
26
web/core/scripts/dump-database-d8-mysql.php
Normal file
26
web/core/scripts/dump-database-d8-mysql.php
Normal file
@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* A command line application to dump a database to a generation script.
|
||||
*/
|
||||
|
||||
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();
|
||||
Settings::initialize(dirname(__DIR__, 2), DrupalKernel::findSitePath($request), $autoloader);
|
||||
DrupalKernel::createFromRequest($request, $autoloader, 'prod')->boot();
|
||||
|
||||
// Run the database dump command.
|
||||
$application = new DbDumpApplication();
|
||||
$application->run();
|
||||
Reference in New Issue
Block a user