db-tools.php 678 B

1234567891011121314151617181920212223242526
  1. #!/usr/bin/env php
  2. <?php
  3. /**
  4. * @file
  5. * A command line application to import a database generation script.
  6. */
  7. use Drupal\Core\Command\DbToolsApplication;
  8. use Drupal\Core\DrupalKernel;
  9. use Drupal\Core\Site\Settings;
  10. use Symfony\Component\HttpFoundation\Request;
  11. if (PHP_SAPI !== 'cli') {
  12. return;
  13. }
  14. // Bootstrap.
  15. $autoloader = require __DIR__ . '/../../autoload.php';
  16. $request = Request::createFromGlobals();
  17. Settings::initialize(dirname(__DIR__, 2), DrupalKernel::findSitePath($request), $autoloader);
  18. DrupalKernel::createFromRequest($request, $autoloader, 'prod')->boot();
  19. // Run the database dump command.
  20. $application = new DbToolsApplication();
  21. $application->run();