first commit

This commit is contained in:
2024-07-15 12:33:27 +02:00
commit ce50ae282b
22084 changed files with 2623791 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
<?php
namespace Drupal\Core\Database\Driver\CoreFake;
use Drupal\Driver\Database\fake\Connection as BaseConnection;
class Connection extends BaseConnection {
/**
* {@inheritdoc}
*/
public $driver = 'CoreFake';
}

View File

@@ -0,0 +1,16 @@
<?php
namespace Drupal\Core\Database\Driver\CoreFake\Install;
use Drupal\Core\Database\Install\Tasks as InstallTasks;
class Tasks extends InstallTasks {
/**
* {@inheritdoc}
*/
public function name() {
return 'CoreFake';
}
}

View File

@@ -0,0 +1,7 @@
<?php
namespace Drupal\Driver\Database\CoreFake;
use Drupal\Core\Database\Driver\CoreFake\Connection as CoreFakeConnection;
class Connection extends CoreFakeConnection {}

View File

@@ -0,0 +1,9 @@
<?php
namespace Drupal\Driver\Database\CoreFake\Install;
use Drupal\Core\Database\Driver\CoreFake\Install\Tasks as BaseInstallTasks;
class Tasks extends BaseInstallTasks {
}

View File

@@ -0,0 +1,167 @@
<?php
namespace Drupal\Driver\Database\fake;
use Drupal\Core\Database\Connection as CoreConnection;
use Drupal\Core\Database\ExceptionHandler;
use Drupal\Core\Database\Query\Condition;
use Drupal\Core\Database\Query\Delete;
use Drupal\Core\Database\Query\Insert;
use Drupal\Core\Database\Query\Merge;
use Drupal\Core\Database\Query\Select;
use Drupal\Core\Database\Query\Truncate;
use Drupal\Core\Database\Query\Update;
use Drupal\Core\Database\Query\Upsert;
use Drupal\Core\Database\StatementWrapper;
use Drupal\Core\Database\Transaction;
/**
* A fake Connection class for testing purposes.
*/
class Connection extends CoreConnection {
/**
* {@inheritdoc}
*/
protected $statementClass = NULL;
/**
* {@inheritdoc}
*/
protected $statementWrapperClass = StatementWrapper::class;
/**
* {@inheritdoc}
*/
protected $identifierQuotes = ['"', '"'];
/**
* Public property so we can test driver loading mechanism.
*
* @var string
* @see driver().
*/
public $driver = 'fake';
/**
* {@inheritdoc}
*/
public function queryRange($query, $from, $count, array $args = [], array $options = []) {
return NULL;
}
/**
* {@inheritdoc}
*/
public function driver() {
return $this->driver;
}
/**
* {@inheritdoc}
*/
public function databaseType() {
return 'fake';
}
/**
* {@inheritdoc}
*/
public function createDatabase($database) {}
/**
* {@inheritdoc}
*/
public function mapConditionOperator($operator) {
return NULL;
}
/**
* {@inheritdoc}
*/
public function nextId($existing_id = 0) {
@trigger_error('Drupal\Core\Database\Connection::nextId() is deprecated in drupal:10.2.0 and is removed from drupal:11.0.0. Modules should use instead the keyvalue storage for the last used id. See https://www.drupal.org/node/3349345', E_USER_DEPRECATED);
return 0;
}
/**
* {@inheritdoc}
*/
public function exceptionHandler() {
return new ExceptionHandler();
}
/**
* {@inheritdoc}
*/
public function select($table, $alias = NULL, array $options = []) {
return new Select($this, $table, $alias, $options);
}
/**
* {@inheritdoc}
*/
public function insert($table, array $options = []) {
return new Insert($this, $table, $options);
}
/**
* {@inheritdoc}
*/
public function merge($table, array $options = []) {
return new Merge($this, $table, $options);
}
/**
* {@inheritdoc}
*/
public function upsert($table, array $options = []) {
return new Upsert($this, $table, $options);
}
/**
* {@inheritdoc}
*/
public function update($table, array $options = []) {
return new Update($this, $table, $options);
}
/**
* {@inheritdoc}
*/
public function delete($table, array $options = []) {
return new Delete($this, $table, $options);
}
/**
* {@inheritdoc}
*/
public function truncate($table, array $options = []) {
return new Truncate($this, $table, $options);
}
/**
* {@inheritdoc}
*/
public function schema() {
if (empty($this->schema)) {
$this->schema = new Schema($this);
}
return $this->schema;
}
/**
* {@inheritdoc}
*/
public function condition($conjunction) {
return new Condition($conjunction, FALSE);
}
/**
* {@inheritdoc}
*/
public function startTransaction($name = '') {
return new Transaction($this, $name);
}
}

View File

@@ -0,0 +1,16 @@
<?php
namespace Drupal\Driver\Database\fake\Install;
use Drupal\Core\Database\Install\Tasks as InstallTasks;
class Tasks extends InstallTasks {
/**
* {@inheritdoc}
*/
public function name() {
return 'fake';
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFake;
use Drupal\Driver\Database\fake\Connection as BaseConnection;
/**
* CoreFake implementation of \Drupal\Core\Database\Connection.
*/
class Connection extends BaseConnection {
/**
* {@inheritdoc}
*/
public $driver = 'CoreFake';
}

View File

@@ -0,0 +1,19 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFake\Install;
use Drupal\Core\Database\Install\Tasks as InstallTasks;
/**
* Specifies installation tasks for CoreFake.
*/
class Tasks extends InstallTasks {
/**
* {@inheritdoc}
*/
public function name() {
return 'CoreFake';
}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
use Drupal\Core\Database\Query\Condition as QueryCondition;
/**
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Condition.
*/
class Condition extends QueryCondition {
}

View File

@@ -0,0 +1,97 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
use Drupal\Driver\Database\fake\Connection as BaseConnection;
/**
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Connection.
*/
class Connection extends BaseConnection {
/**
* {@inheritdoc}
*/
public $driver = 'CoreFakeWithAllCustomClasses';
/**
* {@inheritdoc}
*/
public function exceptionHandler() {
return new ExceptionHandler();
}
/**
* {@inheritdoc}
*/
public function select($table, $alias = NULL, array $options = []) {
return new Select($this, $table, $alias, $options);
}
/**
* {@inheritdoc}
*/
public function insert($table, array $options = []) {
return new Insert($this, $table, $options);
}
/**
* {@inheritdoc}
*/
public function merge($table, array $options = []) {
return new Merge($this, $table, $options);
}
/**
* {@inheritdoc}
*/
public function upsert($table, array $options = []) {
return new Upsert($this, $table, $options);
}
/**
* {@inheritdoc}
*/
public function update($table, array $options = []) {
return new Update($this, $table, $options);
}
/**
* {@inheritdoc}
*/
public function delete($table, array $options = []) {
return new Delete($this, $table, $options);
}
/**
* {@inheritdoc}
*/
public function truncate($table, array $options = []) {
return new Truncate($this, $table, $options);
}
/**
* {@inheritdoc}
*/
public function schema() {
if (empty($this->schema)) {
$this->schema = new Schema($this);
}
return $this->schema;
}
/**
* {@inheritdoc}
*/
public function condition($conjunction) {
return new Condition($conjunction, FALSE);
}
/**
* {@inheritdoc}
*/
public function startTransaction($name = '') {
return new Transaction($this, $name);
}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
use Drupal\Core\Database\Query\Delete as QueryDelete;
/**
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Delete.
*/
class Delete extends QueryDelete {
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
use Drupal\Core\Database\ExceptionHandler as BaseExceptionHandler;
/**
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\ExceptionHandler.
*/
class ExceptionHandler extends BaseExceptionHandler {
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
use Drupal\Core\Database\Query\Insert as QueryInsert;
/**
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Insert.
*/
class Insert extends QueryInsert {
}

View File

@@ -0,0 +1,19 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses\Install;
use Drupal\Core\Database\Install\Tasks as InstallTasks;
/**
* Specifies installation tasks for CoreFakeWithAllCustomClasses.
*/
class Tasks extends InstallTasks {
/**
* {@inheritdoc}
*/
public function name() {
return 'CoreFakeWithAllCustomClasses';
}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
use Drupal\Core\Database\Query\Merge as QueryMerge;
/**
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Merge.
*/
class Merge extends QueryMerge {
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
use Drupal\Core\Database\Query\PagerSelectExtender as QueryPagerSelectExtender;
/**
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Query\PagerSelectExtender.
*/
class PagerSelectExtender extends QueryPagerSelectExtender {
}

View File

@@ -0,0 +1,77 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
use Drupal\Core\Database\Schema as DatabaseSchema;
/**
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Schema.
*/
class Schema extends DatabaseSchema {
/**
* {@inheritdoc}
*/
public function getFieldTypeMap() {}
/**
* {@inheritdoc}
*/
public function renameTable($table, $new_name) {}
/**
* {@inheritdoc}
*/
public function dropTable($table) {}
/**
* {@inheritdoc}
*/
public function addField($table, $field, $spec, $keys_new = []) {}
/**
* {@inheritdoc}
*/
public function dropField($table, $field) {}
/**
* {@inheritdoc}
*/
public function indexExists($table, $name) {}
/**
* {@inheritdoc}
*/
public function addPrimaryKey($table, $fields) {}
/**
* {@inheritdoc}
*/
public function dropPrimaryKey($table) {}
/**
* {@inheritdoc}
*/
public function addUniqueKey($table, $name, $fields) {}
/**
* {@inheritdoc}
*/
public function dropUniqueKey($table, $name) {}
/**
* {@inheritdoc}
*/
public function addIndex($table, $name, $fields, array $spec) {}
/**
* {@inheritdoc}
*/
public function dropIndex($table, $name) {}
/**
* {@inheritdoc}
*/
public function changeField($table, $field, $field_new, $spec, $keys_new = []) {}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
use Drupal\search\SearchQuery as CoreSearchQuery;
/**
* CoreFakeWithAllCustomClasses implementation of \Drupal\search\SearchQuery.
*/
class SearchQuery extends CoreSearchQuery {
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
use Drupal\Core\Database\Query\Select as QuerySelect;
/**
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Select.
*/
class Select extends QuerySelect {
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
use Drupal\Core\Database\Query\TableSortExtender as QueryTableSortExtender;
/**
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Query\TableSortExtender.
*/
class TableSortExtender extends QueryTableSortExtender {
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
use Drupal\Core\Database\Transaction as DatabaseTransaction;
/**
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Transaction.
*/
class Transaction extends DatabaseTransaction {
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
use Drupal\Core\Database\Query\Truncate as QueryTruncate;
/**
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Truncate.
*/
class Truncate extends QueryTruncate {
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
use Drupal\Core\Database\Query\Update as QueryUpdate;
/**
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Update.
*/
class Update extends QueryUpdate {
}

View File

@@ -0,0 +1,22 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
use Drupal\Core\Database\Query\Upsert as QueryUpsert;
/**
* CoreFakeWithAllCustomClasses implementation of \Drupal\Core\Database\Upsert.
*/
class Upsert extends QueryUpsert {
/**
* {@inheritdoc}
*/
public function execute() {}
/**
* {@inheritdoc}
*/
public function __toString() {}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace Drupal\core_fake\Driver\Database\CoreFakeWithAllCustomClasses;
use Drupal\search\ViewsSearchQuery as CoreViewsSearchQuery;
/**
* CoreFakeWithAllCustomClasses implementation of \Drupal\search\ViewsSearchQuery.
*/
class ViewsSearchQuery extends CoreViewsSearchQuery {
}