Security update to Drupal 8.4.6
[yaffs-website] / web / core / scripts / dump-database-d8-mysql.php
1 #!/usr/bin/env php
2 <?php
3
4 /**
5  * @file
6  * A command line application to dump a database to a generation script.
7  */
8
9 use Drupal\Core\Command\DbDumpApplication;
10 use Drupal\Core\DrupalKernel;
11 use Drupal\Core\Site\Settings;
12 use Symfony\Component\HttpFoundation\Request;
13
14 if (PHP_SAPI !== 'cli') {
15   return;
16 }
17
18 // Bootstrap.
19 $autoloader = require __DIR__ . '/../../autoload.php';
20 require_once __DIR__ . '/../includes/bootstrap.inc';
21 $request = Request::createFromGlobals();
22 Settings::initialize(dirname(dirname(__DIR__)), DrupalKernel::findSitePath($request), $autoloader);
23 $kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod')->boot();
24
25 // Run the database dump command.
26 $application = new DbDumpApplication();
27 $application->run();