Commit 92286713 authored by Crell's avatar Crell

Move database files to the new lib directory and update code accordingly.

parent 86c93f3b
<?php
use Drupal\Database\Database;
use Drupal\Core\Database\Database;
use Symfony\Component\ClassLoader\UniversalClassLoader;
use Symfony\Component\ClassLoader\ApcUniversalClassLoader;
......
<?php
use Drupal\Database\Database;
use Drupal\Core\Database\Database;
/**
* @file
......
<?php
use Drupal\Database\Database;
use Drupal\Database\Query\Condition;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\Query\Condition;
/**
* @file
......
<?php
use Drupal\Database\Database;
use Drupal\Database\Install\TaskException;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\Install\TaskException;
/**
* @file
......@@ -234,7 +234,23 @@ function install_begin_request(&$install_state) {
// Ensure that the class loader is available so that we can leverage classes
// as part of the install routine.
drupal_initialize_classloader();
$loader = drupal_classloader();
// Register explicit vendor namespaces.
$loader->registerNamespaces(array(
// All Symfony-borrowed code lives in /core/includes/Symfony.
'Symfony' => DRUPAL_ROOT . '/core/vendor',
));
// Register the Drupal namespace for classes in core as a fallback.
// This allows to register additional namespaces within the Drupal namespace
// (e.g., for modules) and avoids an additional file_exists() on the Drupal
// core namespace, since the class loader can already determine the best
// namespace match based on a string comparison. It further allows modules to
// register/overload namespaces in Drupal core.
$loader->registerNamespaceFallbacks(array(
// All Drupal-namespaced code in core lives in /core/includes/Drupal.
'Drupal' => DRUPAL_ROOT . '/core/lib',
));
if (!$install_state['interactive']) {
drupal_override_server_variables($install_state['server']);
......
<?php
use Drupal\Database\Database;
use Drupal\Core\Database\Database;
/**
* Indicates that a module has not been installed yet.
......@@ -256,7 +256,7 @@ function drupal_get_database_types() {
// Because we have no registry yet, we need to also include the install.inc
// file for the driver explicitly.
require_once DRUPAL_ROOT . '/core/includes/database/database.inc';
foreach (file_scan_directory(DRUPAL_ROOT . '/core/includes/Drupal/Database/Driver', '/^[a-z]*$/i', array('recurse' => FALSE)) as $file) {
foreach (file_scan_directory(DRUPAL_ROOT . '/core/lib/Drupal/Core/Database/Driver', '/^[a-z]*$/i', array('recurse' => FALSE)) as $file) {
if (file_exists($file->uri . '/Install/Tasks.php')) {
$drivers[$file->filename] = $file->uri;
}
......@@ -1006,6 +1006,6 @@ function db_run_tasks($driver) {
function db_installer_object($driver) {
// We cannot use Database::getConnection->getDriverClass() here, because
// the connection object is not yet functional.
$task_class = "Drupal\\Database\\Driver\\{$driver}\\Install\\Tasks";
$task_class = "Drupal\\Core\\Database\\Driver\\{$driver}\\Install\\Tasks";
return new $task_class();
}
<?php
use Drupal\Database\Connection;
use Drupal\Database\Query\SelectExtender;
use Drupal\Database\Query\SelectInterface;
use Drupal\Core\Database\Connection;
use Drupal\Core\Database\Query\SelectExtender;
use Drupal\Core\Database\Query\SelectInterface;
/**
* @file
......
<?php
use Drupal\Database\Database;
use Drupal\Core\Database\Database;
/**
* @file
......
<?php
use Drupal\Database\Connection;
use Drupal\Database\Query\SelectExtender;
use Drupal\Database\Query\SelectInterface;
use Drupal\Core\Database\Connection;
use Drupal\Core\Database\Query\SelectExtender;
use Drupal\Core\Database\Query\SelectInterface;
/**
* @file
......
<?php
namespace Drupal\Database;
namespace Drupal\Core\Database;
use Drupal\Database\DatabaseTransactionNoActiveException;
use Drupal\Database\DatabaseTransactionOutOfOrderException;
use Drupal\Core\Database\DatabaseTransactionNoActiveException;
use Drupal\Core\Database\DatabaseTransactionOutOfOrderException;
use PDO;
use PDOException;
......@@ -70,7 +70,7 @@ abstract class Connection extends PDO {
*
* @var string
*/
protected $statementClass = '\\Drupal\\Database\\StatementBase';
protected $statementClass = '\\Drupal\\Core\\Database\\StatementBase';
/**
* Whether this database connection supports transactions.
......@@ -593,7 +593,7 @@ protected function expandArguments(&$query, &$args) {
public function getDriverClass($class) {
if (empty($this->driverClasses[$class])) {
$driver = $this->driver();
$driver_class = "Drupal\\Database\\Driver\\{$driver}\\{$class}";
$driver_class = "Drupal\\Core\\Database\\Driver\\{$driver}\\{$class}";
$this->driverClasses[$class] = class_exists($driver_class) ? $driver_class : $class;
}
return $this->driverClasses[$class];
......
<?php
namespace Drupal\Database;
namespace Drupal\Core\Database;
/**
* Primary front-controller for the database system.
......@@ -371,7 +371,7 @@ public static function addConnectionInfo($key, $target, $info) {
// We cannot rely on the registry yet, because the registry requires an
// open database connection.
$driver_class = "Drupal\\Database\\Driver\\{$driver}\\Connection";
$driver_class = "Drupal\\Core\\Database\\Driver\\{$driver}\\Connection";
$new_connection = new $driver_class(self::$databaseInfo[$key][$target]);
$new_connection->setTarget($target);
$new_connection->setKey($key);
......
<?php
namespace Drupal\Database\Driver\mysql;
namespace Drupal\Core\Database\Driver\mysql;
use Drupal\Database\Database;
use Drupal\Database\DatabaseTransactionCommitFailedException;
use Drupal\Database\Connection as DatabaseConnection;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\DatabaseTransactionCommitFailedException;
use Drupal\Core\Database\Connection as DatabaseConnection;
use PDO;
use PDOException;
......
<?php
namespace Drupal\Database\Driver\mysql;
namespace Drupal\Core\Database\Driver\mysql;
use Drupal\Database\Query\Delete as QueryDelete;
use Drupal\Core\Database\Query\Delete as QueryDelete;
class Delete extends QueryDelete { }
<?php
namespace Drupal\Database\Driver\mysql;
namespace Drupal\Core\Database\Driver\mysql;
use Drupal\Database\Query\Insert as QueryInsert;
use Drupal\Core\Database\Query\Insert as QueryInsert;
class Insert extends QueryInsert {
......
<?php
namespace Drupal\Database\Driver\mysql\Install;
namespace Drupal\Core\Database\Driver\mysql\Install;
use Drupal\Database\Install\Tasks as InstallTasks;
use Drupal\Core\Database\Install\Tasks as InstallTasks;
/**
* Specifies installation tasks for MySQL and equivalent databases.
......
<?php
namespace Drupal\Database\Driver\sqlite;
namespace Drupal\Core\Database\Driver\mysql;
use Drupal\Database\Query\Merge as QueryMerge;
use Drupal\Core\Database\Query\Merge as QueryMerge;
class Merge extends QueryMerge { }
<?php
namespace Drupal\Database\Driver\mysql;
namespace Drupal\Core\Database\Driver\mysql;
use Drupal\Database\Database;
use Drupal\Database\Query\Condition;
use Drupal\Database\SchemaObjectExistsException;
use Drupal\Database\SchemaObjectDoesNotExistException;
use Drupal\Database\Schema as DatabaseSchema;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\Query\Condition;
use Drupal\Core\Database\SchemaObjectExistsException;
use Drupal\Core\Database\SchemaObjectDoesNotExistException;
use Drupal\Core\Database\Schema as DatabaseSchema;
use Exception;
......
<?php
namespace Drupal\Database\Driver\mysql;
namespace Drupal\Core\Database\Driver\mysql;
use Drupal\Database\Query\Select as QuerySelect;
use Drupal\Core\Database\Query\Select as QuerySelect;
class Select extends QuerySelect { }
<?php
namespace Drupal\Database\Driver\sqlite;
namespace Drupal\Core\Database\Driver\mysql;
use Drupal\Database\Transaction as DatabaseTransaction;
use Drupal\Core\Database\Transaction as DatabaseTransaction;
class Transaction extends DatabaseTransaction { }
<?php
namespace Drupal\Database\Driver\mysql;
namespace Drupal\Core\Database\Driver\mysql;
use Drupal\Database\Query\Truncate as QueryTruncate;
use Drupal\Core\Database\Query\Truncate as QueryTruncate;
class Truncate extends QueryTruncate {
public function __toString() {
......
<?php
namespace Drupal\Database\Driver\mysql;
namespace Drupal\Core\Database\Driver\mysql;
use Drupal\Database\Query\Update as QueryUpdate;
use Drupal\Core\Database\Query\Update as QueryUpdate;
class Update extends QueryUpdate { }
<?php
namespace Drupal\Database\Driver\pgsql\Install;
namespace Drupal\Core\Database\Driver\pgsql\Install;
use Drupal\Database\Install\Tasks as InstallTasks;
use Drupal\Core\Database\Install\Tasks as InstallTasks;
/**
* PostgreSQL specific install functions
......
<?php
namespace Drupal\Database\Driver\sqlite;
use Drupal\Database\Database;
use Drupal\Database\TransactionNoActiveException;
use Drupal\Database\TransactionNameNonUniqueException;
use Drupal\Database\TransactionCommitFailedException;
use Drupal\Database\Driver\sqlite\Statement;
use Drupal\Database\Connection as DatabaseConnection;
namespace Drupal\Core\Database\Driver\sqlite;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\TransactionNoActiveException;
use Drupal\Core\Database\TransactionNameNonUniqueException;
use Drupal\Core\Database\TransactionCommitFailedException;
use Drupal\Core\Database\Driver\sqlite\Statement;
use Drupal\Core\Database\Connection as DatabaseConnection;
use PDO;
use Exception;
......
<?php
namespace Drupal\Database\Driver\sqlite;
namespace Drupal\Core\Database\Driver\sqlite;
use Drupal\Database\Query\Delete as QueryDelete;
use Drupal\Core\Database\Query\Delete as QueryDelete;
/**
* SQLite specific implementation of DeleteQuery.
......
<?php
namespace Drupal\Database\Driver\sqlite;
namespace Drupal\Core\Database\Driver\sqlite;
use Drupal\Database\Query\Insert as QueryInsert;
use Drupal\Core\Database\Query\Insert as QueryInsert;
/**
* SQLite specific implementation of InsertQuery.
......
<?php
namespace Drupal\Database\Driver\sqlite\Install;
namespace Drupal\Core\Database\Driver\sqlite\Install;
use Drupal\Database\Install\Tasks as InstallTasks;
use Drupal\Core\Database\Install\Tasks as InstallTasks;
use SplFileInfo;
......
<?php
namespace Drupal\Database\Driver\mysql;
namespace Drupal\Core\Database\Driver\sqlite;
use Drupal\Database\Query\Merge as QueryMerge;
use Drupal\Core\Database\Query\Merge as QueryMerge;
class Merge extends QueryMerge { }
<?php
namespace Drupal\Database\Driver\sqlite;
namespace Drupal\Core\Database\Driver\sqlite;
use Drupal\Database\SchemaObjectExistsException;
use Drupal\Database\SchemaObjectDoesNotExistException;
use Drupal\Database\Schema as DatabaseSchema;
use Drupal\Core\Database\SchemaObjectExistsException;
use Drupal\Core\Database\SchemaObjectDoesNotExistException;
use Drupal\Core\Database\Schema as DatabaseSchema;
use Exception;
......
<?php
namespace Drupal\Database\Driver\sqlite;
namespace Drupal\Core\Database\Driver\sqlite;
use Drupal\Database\Query\Select as QuerySelect;
use Drupal\Core\Database\Query\Select as QuerySelect;
class Select extends QuerySelect {
public function forUpdate($set = TRUE) {
......
<?php
namespace Drupal\Database\Driver\sqlite;
namespace Drupal\Core\Database\Driver\sqlite;
use Drupal\Database\StatementPrefetch;
use Drupal\Database\StatementInterface;
use Drupal\Core\Database\StatementPrefetch;
use Drupal\Core\Database\StatementInterface;
use Iterator;
use PDOException;
......
<?php
namespace Drupal\Database\Driver\mysql;
namespace Drupal\Core\Database\Driver\sqlite;
use Drupal\Database\Transaction as DatabaseTransaction;
use Drupal\Core\Database\Transaction as DatabaseTransaction;
class Transaction extends DatabaseTransaction { }
<?php
namespace Drupal\Database\Driver\sqlite;
namespace Drupal\Core\Database\Driver\sqlite;
use Drupal\Database\Query\Truncate as QueryTruncate;
use Drupal\Core\Database\Query\Truncate as QueryTruncate;
/**
* SQLite specific implementation of TruncateQuery.
......
<?php
namespace Drupal\Database\Driver\sqlite;
namespace Drupal\Core\Database\Driver\sqlite;
use Drupal\Database\Query\Condition;
use Drupal\Database\Query\ConditionInterface;
use Drupal\Database\Query\Update as QueryUpdate;
use Drupal\Core\Database\Query\Condition;
use Drupal\Core\Database\Query\ConditionInterface;
use Drupal\Core\Database\Query\Update as QueryUpdate;
/**
* SQLite specific implementation of UpdateQuery.
......
<?php
namespace Drupal\Database\Install;
namespace Drupal\Core\Database\Install;
use RuntimeException;
......
<?php
namespace Drupal\Database\Install;
namespace Drupal\Core\Database\Install;
use Drupal\Database\Database;
use Drupal\Core\Database\Database;
use PDO;
......
<?php
namespace Drupal\Database;
namespace Drupal\Core\Database;
/**
* Database query logger.
......
<?php
namespace Drupal\Database\Query;
namespace Drupal\Core\Database\Query;
/**
* Interface for a query that can be manipulated via an alter hook.
......
<?php
namespace Drupal\Database\Query;
namespace Drupal\Core\Database\Query;
use Drupal\Database\Connection;
use Drupal\Core\Database\Connection;
use Countable;
......
<?php
namespace Drupal\Database\Query;
namespace Drupal\Core\Database\Query;
use Drupal\Database\Connection;
use Drupal\Core\Database\Connection;
/**
* Interface for a conditional clause in a query.
......
<?php
namespace Drupal\Database\Query;
namespace Drupal\Core\Database\Query;
use Drupal\Database\Database;
use Drupal\Database\Connection;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\Connection;
/**
* General class for an abstracted DELETE operation.
......
<?php
namespace Drupal\Database\Query;
namespace Drupal\Core\Database\Query;
/**
* Interface for extendable query objects.
......
<?php
namespace Drupal\Database\Query;
namespace Drupal\Core\Database\Query;
use RuntimeException;
......
<?php
namespace Drupal\Database\Query;
namespace Drupal\Core\Database\Query;
use Drupal\Database\Database;
use Drupal\Core\Database\Database;
/**
* General class for an abstracted INSERT query.
......
<?php
namespace Drupal\Database\Query;
namespace Drupal\Core\Database\Query;
use Drupal\Database\Database;
use Drupal\Database\Connection;
use Drupal\Core\Database\Database;
use Drupal\Core\Database\Connection;
use Exception;
......
<?php
namespace Drupal\Database\Query;
namespace Drupal\Core\Database\Query;
use Exception;
......
<?php
namespace Drupal\Database\Query;
namespace Drupal\Core\Database\Query;
/**
* Interface for a query that accepts placeholders.
......