Mercurial > hg > isophonics-drupal-site
diff core/scripts/db-tools.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/core/scripts/db-tools.php Wed Nov 29 16:09:58 2017 +0000 @@ -0,0 +1,27 @@ +#!/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'; +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 DbToolsApplication(); +$application->run();