db-tools.php

Same filename in other branches
  1. 9 core/scripts/db-tools.php
  2. 8.9.x core/scripts/db-tools.php
  3. 10 core/scripts/db-tools.php

A command line application to import a database generation script.

File

core/scripts/db-tools.php

View source
#!/usr/bin/env php
<?php


/**
 * @file
 * A command line application to import a database generation script.
 */
use Drupal\Core\Command\DbToolsApplication;
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 DbToolsApplication();
$application->run();

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.