This repository has been archived on 2025-01-19. You can view files and clone it, but cannot push or open issues or pull requests.
drupalcampbristol/core/scripts/dump-database-d8-mysql.php

24 lines
743 B
PHP
Raw Normal View History

#!/usr/bin/env php
<?php
use Drupal\Core\Command\DbDumpApplication;
use Drupal\Core\Database\Database;
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';
require_once __DIR__ . '/../includes/bootstrap.inc';
$request = Request::createFromGlobals();
Settings::initialize(dirname(dirname(__DIR__)), DrupalKernel::findSitePath($request), $autoloader);
$kernel = DrupalKernel::createFromRequest($request, $autoloader, 'prod')->boot();
// Run the database dump command.
$application = new DbDumpApplication(Database::getConnection(), \Drupal::moduleHandler());
$application->run();