Update to Drupal 8.1.5. For more information, see https://www.drupal.org/project/drupal/releases/8.1.5
This commit is contained in:
parent
13b6ca7cc2
commit
38ba7c357d
342 changed files with 7814 additions and 1534 deletions
|
@ -753,14 +753,11 @@ abstract class Connection {
|
|||
*/
|
||||
public function getDriverClass($class) {
|
||||
if (empty($this->driverClasses[$class])) {
|
||||
$driver = $this->driver();
|
||||
if (!empty($this->connectionOptions['namespace'])) {
|
||||
$driver_class = $this->connectionOptions['namespace'] . '\\' . $class;
|
||||
}
|
||||
else {
|
||||
// Fallback for Drupal 7 settings.php.
|
||||
$driver_class = "Drupal\\Core\\Database\\Driver\\{$driver}\\{$class}";
|
||||
if (empty($this->connectionOptions['namespace'])) {
|
||||
// Fallback for Drupal 7 settings.php and the test runner script.
|
||||
$this->connectionOptions['namespace'] = (new \ReflectionObject($this))->getNamespaceName();
|
||||
}
|
||||
$driver_class = $this->connectionOptions['namespace'] . '\\' . $class;
|
||||
$this->driverClasses[$class] = class_exists($driver_class) ? $driver_class : $class;
|
||||
}
|
||||
return $this->driverClasses[$class];
|
||||
|
|
|
@ -246,6 +246,9 @@ class Tasks extends InstallTasks {
|
|||
// concurrency issues, when both try to update at the same time.
|
||||
try {
|
||||
$connection = Database::getConnection();
|
||||
// When testing, two installs might try to run the CREATE FUNCTION queries
|
||||
// at the same time. Do not let that happen.
|
||||
$connection->query('SELECT pg_advisory_lock(1)');
|
||||
// Don't use {} around pg_proc table.
|
||||
if (!$connection->query("SELECT COUNT(*) FROM pg_proc WHERE proname = 'rand'")->fetchField()) {
|
||||
$connection->query('CREATE OR REPLACE FUNCTION "rand"() RETURNS float AS
|
||||
|
@ -264,6 +267,7 @@ class Tasks extends InstallTasks {
|
|||
[ 'allow_delimiter_in_query' => TRUE ]
|
||||
);
|
||||
}
|
||||
$connection->query('SELECT pg_advisory_unlock(1)');
|
||||
|
||||
$this->pass(t('PostgreSQL has initialized itself.'));
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ class Tasks extends InstallTasks {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function minimumVersion() {
|
||||
return '3.6.8';
|
||||
return '3.7.11';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -420,8 +420,12 @@ class Schema extends DatabaseSchema {
|
|||
*
|
||||
* @param $table
|
||||
* Name of the table.
|
||||
*
|
||||
* @return
|
||||
* An array representing the schema, from drupal_get_schema().
|
||||
*
|
||||
* @throws \Exception
|
||||
* If a column of the table could not be parsed.
|
||||
*/
|
||||
protected function introspectSchema($table) {
|
||||
$mapped_fields = array_flip($this->getFieldTypeMap());
|
||||
|
@ -459,7 +463,7 @@ class Schema extends DatabaseSchema {
|
|||
}
|
||||
}
|
||||
else {
|
||||
new \Exception("Unable to parse the column type " . $row->type);
|
||||
throw new \Exception("Unable to parse the column type " . $row->type);
|
||||
}
|
||||
}
|
||||
$indexes = array();
|
||||
|
@ -710,7 +714,7 @@ class Schema extends DatabaseSchema {
|
|||
// Can't use query placeholders for the schema because the query would
|
||||
// have to be :prefixsqlite_master, which does not work. We also need to
|
||||
// ignore the internal SQLite tables.
|
||||
$result = db_query("SELECT name FROM " . $schema . ".sqlite_master WHERE type = :type AND name LIKE :table_name AND name NOT LIKE :pattern", array(
|
||||
$result = $this->connection->query("SELECT name FROM " . $schema . ".sqlite_master WHERE type = :type AND name LIKE :table_name AND name NOT LIKE :pattern", array(
|
||||
':type' => 'table',
|
||||
':table_name' => $table_expression,
|
||||
':pattern' => 'sqlite_%',
|
||||
|
|
|
@ -6,11 +6,11 @@ namespace Drupal\Core\Database\Query;
|
|||
* Interface for extendable query objects.
|
||||
*
|
||||
* "Extenders" follow the "Decorator" OOP design pattern. That is, they wrap
|
||||
* and "decorate" another object. In our case, they implement the same interface
|
||||
* as select queries and wrap a select query, to which they delegate almost all
|
||||
* operations. Subclasses of this class may implement additional methods or
|
||||
* override existing methods as appropriate. Extenders may also wrap other
|
||||
* extender objects, allowing for arbitrarily complex "enhanced" queries.
|
||||
* and "decorate" another object. In our case, they implement the same
|
||||
* interface as select queries and wrap a select query, to which they delegate
|
||||
* almost all operations. Subclasses of this class may implement additional
|
||||
* methods or override existing methods as appropriate. Extenders may also wrap
|
||||
* other extender objects, allowing for arbitrarily complex "enhanced" queries.
|
||||
*/
|
||||
interface ExtendableInterface {
|
||||
|
||||
|
@ -18,9 +18,12 @@ interface ExtendableInterface {
|
|||
* Enhance this object by wrapping it in an extender object.
|
||||
*
|
||||
* @param $extender_name
|
||||
* The base name of the extending class. The base name will be checked
|
||||
* against the current database connection to allow driver-specific subclasses
|
||||
* as well, using the same logic as the query objects themselves.
|
||||
* The fully-qualified name of the extender class, without the leading '\'
|
||||
* (for example, Drupal\my_module\myExtenderClass). The extender name will
|
||||
* be checked against the current database connection to allow
|
||||
* driver-specific subclasses as well, using the same logic as the query
|
||||
* objects themselves.
|
||||
*
|
||||
* @return \Drupal\Core\Database\Query\ExtendableInterface
|
||||
* The extender object, which now contains a reference to this object.
|
||||
*/
|
||||
|
|
|
@ -39,7 +39,7 @@ class Select extends Query implements SelectInterface {
|
|||
* 'type' => $join_type (one of INNER, LEFT OUTER, RIGHT OUTER),
|
||||
* 'table' => $table,
|
||||
* 'alias' => $alias_of_the_table,
|
||||
* 'condition' => $condition_clause_on_which_to_join,
|
||||
* 'condition' => $join_condition (string or Condition object),
|
||||
* 'arguments' => $array_of_arguments_for_placeholders_in_the condition.
|
||||
* 'all_fields' => TRUE to SELECT $alias.*, FALSE or NULL otherwise.
|
||||
* )
|
||||
|
@ -47,6 +47,10 @@ class Select extends Query implements SelectInterface {
|
|||
* If $table is a string, it is taken as the name of a table. If it is
|
||||
* a Select query object, it is taken as a subquery.
|
||||
*
|
||||
* If $join_condition is a Condition object, any arguments should be
|
||||
* incorporated into the object; a separate array of arguments does not
|
||||
* need to be provided.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $tables = array();
|
||||
|
@ -196,6 +200,10 @@ class Select extends Query implements SelectInterface {
|
|||
if ($table['table'] instanceof SelectInterface) {
|
||||
$args += $table['table']->arguments();
|
||||
}
|
||||
// If the join condition is an object, grab its arguments recursively.
|
||||
if (!empty($table['condition']) && $table['condition'] instanceof ConditionInterface) {
|
||||
$args += $table['condition']->arguments();
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->expressions as $expression) {
|
||||
|
@ -225,6 +233,10 @@ class Select extends Query implements SelectInterface {
|
|||
if ($table['table'] instanceof SelectInterface) {
|
||||
$table['table']->compile($connection, $queryPlaceholder);
|
||||
}
|
||||
// Make sure join conditions are also compiled.
|
||||
if (!empty($table['condition']) && $table['condition'] instanceof ConditionInterface) {
|
||||
$table['condition']->compile($connection, $queryPlaceholder);
|
||||
}
|
||||
}
|
||||
|
||||
// If there are any dependent queries to UNION, compile it recursively.
|
||||
|
@ -248,6 +260,11 @@ class Select extends Query implements SelectInterface {
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
if (!empty($table['condition']) && $table['condition'] instanceof ConditionInterface) {
|
||||
if (!$table['condition']->compiled()) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($this->union as $union) {
|
||||
|
@ -822,7 +839,7 @@ class Select extends Query implements SelectInterface {
|
|||
$query .= $table_string . ' ' . $this->connection->escapeTable($table['alias']);
|
||||
|
||||
if (!empty($table['condition'])) {
|
||||
$query .= ' ON ' . $table['condition'];
|
||||
$query .= ' ON ' . (string) $table['condition'];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue