diff --git a/core/includes/install.inc b/core/includes/install.inc index c308a2d..b73f554 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -1103,6 +1103,8 @@ function db_run_tasks($driver) { * * @param $driver * The name of the driver. + * + * @return \Drupal\Core\Database\Install\Tasks */ function db_installer_object($driver) { // We cannot use Database::getConnection->getDriverClass() here, because diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php b/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php index 1d04883..5a1f1ae 100644 --- a/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php @@ -24,22 +24,21 @@ class Tasks extends InstallTasks { protected $pdoDriver = 'mysql'; /** - * Returns a human-readable name string for MySQL and equivalent databases. + * {@inheritdoc} */ public function name() { return t('MySQL, MariaDB, Percona Server, or equivalent'); } /** - * Returns the minimum version for MySQL. + * {@inheritdoc} */ public function minimumVersion() { return '5.0.15'; } /** - * Check database connection and attempt to create database if the database is - * missing. + * {@inheritdoc} */ protected function connect() { try { diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php index bb30901..481c484 100644 --- a/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php @@ -13,11 +13,18 @@ use Drupal\Core\Database\DatabaseNotFoundException; /** - * PostgreSQL specific install functions + * Specifies installation tasks for PostgreSQL databases. */ class Tasks extends InstallTasks { + + /** + * {@inheritdoc} + */ protected $pdoDriver = 'pgsql'; + /** + * Constructs a \Drupal\Core\Database\Driver\pgsql\Install\Tasks object. + */ public function __construct() { $this->tasks[] = array( 'function' => 'checkEncoding', @@ -33,17 +40,22 @@ public function __construct() { ); } + /** + * {@inheritdoc} + */ public function name() { return t('PostgreSQL'); } + /** + * {@inheritdoc} + */ public function minimumVersion() { return '8.3'; } /** - * Check database connection and attempt to create database if the database is - * missing. + * {@inheritdoc} */ protected function connect() { try { @@ -126,7 +138,7 @@ protected function checkEncoding() { * * Unserializing does not work on Postgresql 9 when bytea_output is 'hex'. */ - function checkBinaryOutput() { + public function checkBinaryOutput() { // PostgreSQL < 9 doesn't support bytea_output, so verify we are running // at least PostgreSQL 9. $database_connection = Database::getConnection(); @@ -178,7 +190,7 @@ protected function checkBinaryOutputSuccess() { /** * Make PostgreSQL Drupal friendly. */ - function initializeDatabase() { + public function initializeDatabase() { // We create some functions using global names instead of prefixing them // like we do with table names. This is so that we don't double up if more // than one instance of Drupal is running on a single database. We therefore diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php index 1079688..08aa250 100644 --- a/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php @@ -12,22 +12,34 @@ use Drupal\Core\Database\DatabaseNotFoundException; use Drupal\Core\Database\Install\Tasks as InstallTasks; +/** + * Specifies installation tasks for SQLite databases. + */ class Tasks extends InstallTasks { + + /** + * {@inheritdoc} + */ protected $pdoDriver = 'sqlite'; + /** + * {@inheritdoc} + */ public function name() { return t('SQLite'); } /** - * Minimum engine version. - * - * @todo Consider upping to 3.6.8 in Drupal 8 to get SAVEPOINT support. + * {@inheritdoc} */ public function minimumVersion() { + // @todo Consider upping to 3.6.8 in Drupal 8 to get SAVEPOINT support. return '3.3.7'; } + /** + * {@inheritdoc} + */ public function getFormOptions($database) { $form = parent::getFormOptions($database); @@ -43,8 +55,7 @@ public function getFormOptions($database) { } /** - * Check database connection and attempt to create database if the database is - * missing. + * {@inheritdoc} */ protected function connect() { try { diff --git a/core/lib/Drupal/Core/Database/Install/Tasks.php b/core/lib/Drupal/Core/Database/Install/Tasks.php index d46251b..d16cc70 100644 --- a/core/lib/Drupal/Core/Database/Install/Tasks.php +++ b/core/lib/Drupal/Core/Database/Install/Tasks.php @@ -19,6 +19,13 @@ abstract class Tasks { /** + * The name of the PDO driver this database type requires. + * + * @var string + */ + protected $pdoDriver; + + /** * Structure that describes each task to run. * * @var array