diff --git a/core/includes/schema.inc b/core/includes/schema.inc index 578142b..4af147d 100644 --- a/core/includes/schema.inc +++ b/core/includes/schema.inc @@ -55,7 +55,7 @@ function drupal_get_complete_schema($rebuild = FALSE) { } /** - * Returns an array of available schema currentVersions for a module. + * Returns an array of available schema versions for a module. * * @param string $module * A module name. diff --git a/core/lib/Drupal/Core/Schema/Schema.php b/core/lib/Drupal/Core/Schema/Schema.php index f6cd79d..8f81d89 100644 --- a/core/lib/Drupal/Core/Schema/Schema.php +++ b/core/lib/Drupal/Core/Schema/Schema.php @@ -81,7 +81,7 @@ class Schema implements SchemaInterface { * The module handler. * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend * The cache backend. - * @param \Drupal\Core\KeyValueStore\KeyValueFactory $key_value_factory + * @param \Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value_factory * The key value factory. * @param \Drupal\Core\Database\Connection $connection * The database connection. @@ -145,7 +145,7 @@ public function getComplete($rebuild = FALSE) { Cache::invalidateTags(array('schema')); } // If the schema is empty, avoid saving it. - if (!empty($this->completeSchema) && $this->isFullDrupalBootstrapPhase()) { + if (!empty($this->completeSchema) && (drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL)) { $this->cacheBackend->set('schema', $this->completeSchema, Cache::PERMANENT, array('schema' => TRUE)); } } @@ -317,9 +317,9 @@ public function getFieldValue(array $info, $value) { * @param string $module * The module for which hook_schema() was invoked. * @param bool $remove_descriptions - * (optional) Whether to additionally remove 'description' keys of all tables - * and fields to improve performance of serialize() and unserialize(). - * Defaults to TRUE. + * (optional) Whether to additionally remove 'description' keys of all + * tables and fields to improve performance of serialize() and + * unserialize(). Defaults to TRUE. */ protected function initialize(&$schema, $module, $remove_descriptions = TRUE) { // Set the name and module key for all tables. @@ -339,13 +339,4 @@ protected function initialize(&$schema, $module, $remove_descriptions = TRUE) { } } - /** - * Determines if the drupal bootstrap phase is full. - * - * @return bool - */ - protected function isFullDrupalBootstrapPhase() { - return drupal_get_bootstrap_phase() == DRUPAL_BOOTSTRAP_FULL; - } - } diff --git a/core/lib/Drupal/Core/Schema/SchemaInterface.php b/core/lib/Drupal/Core/Schema/SchemaInterface.php index 8b779d8..8fd3f82 100644 --- a/core/lib/Drupal/Core/Schema/SchemaInterface.php +++ b/core/lib/Drupal/Core/Schema/SchemaInterface.php @@ -5,7 +5,6 @@ * Contains \Drupal\Core\Schema\SchemaInterface. */ - namespace Drupal\Core\Schema; /** @@ -25,9 +24,11 @@ * module that implements hook_schema_alter(). * * @param string $table - * The name of the table. If not given, the schema of all tables is returned. + * (optional) The name of the table. Defaults to NULL, which means that the + * schema of all tables is returned. * @param bool $rebuild - * If TRUE, the schema will be rebuilt instead of retrieved from the cache. + * (optional) If TRUE, the schema will be rebuilt instead of retrieved from + * the cache. Defaults to FALSE. */ public function get($table = NULL, $rebuild = FALSE); @@ -38,7 +39,8 @@ public function get($table = NULL, $rebuild = FALSE); * module that implements hook_schema_alter(). * * @param bool $rebuild - * If TRUE, the schema will be rebuilt instead of retrieved from the cache. + * (optional) If TRUE, the schema will be rebuilt instead of retrieved from + * the cache. Defaults to FALSE. */ public function getComplete($rebuild = FALSE); @@ -60,10 +62,11 @@ public function getVersions($module); * @param string $module * A module name. * @param bool $reset - * Set to TRUE after installing or uninstalling an extension. + * (optional) Set to TRUE after installing or uninstalling an extension. + * Defaults to FALSE. * @param bool $array - * Set to TRUE if you want to get information about all modules in the - * system. + * (optional) Set to TRUE if you want to get information about all modules + * in the system. Defaults to FALSE. * * @return string|int * The currently installed schema version, or static::UNINSTALLED if the @@ -132,8 +135,8 @@ public function uninstall($module); * @param string $module * The module to which the table belongs. * @param string $table - * The name of the table. If not given, the module's complete schema - * is returned. + * (optional) The name of the table. Defaults to NULL, which means that the + * module's complete schema is returned. */ public function getUnprocessed($module, $table = NULL); @@ -145,7 +148,7 @@ public function getUnprocessed($module, $table = NULL); * @param string $table * The name of the table from which to retrieve fields. * @param string $prefix - * An optional prefix to to all fields. + * (optional) An optional prefix to to all fields. * * @return array * An array of fields.