summaryrefslogtreecommitdiffstats
path: root/core/includes/schema.inc
diff options
context:
space:
mode:
Diffstat (limited to 'core/includes/schema.inc')
-rw-r--r--core/includes/schema.inc18
1 files changed, 13 insertions, 5 deletions
diff --git a/core/includes/schema.inc b/core/includes/schema.inc
index e599923..b370145 100644
--- a/core/includes/schema.inc
+++ b/core/includes/schema.inc
@@ -77,7 +77,16 @@ function drupal_get_complete_schema($rebuild = FALSE) {
else {
$schema = array();
// Load the .install files to get hook_schema.
- drupal_container()->get('module_handler')->loadAllIncludes('install');
+ // On some databases this function may be called before bootstrap has
+ // been completed, so we force the functions we need to load just in case.
+ if (function_exists('module_load_all_includes')) {
+ // This function can be called very early in the bootstrap process, so
+ // we force the system_list() static cache to be refreshed to ensure
+ // that it contains the complete list of modules before we go on to call
+ // module_load_all_includes().
+ system_list_reset();
+ module_load_all_includes('install');
+ }
require_once DRUPAL_ROOT . '/core/includes/common.inc';
// Invoke hook_schema for all modules.
@@ -121,7 +130,8 @@ function drupal_get_schema_versions($module) {
$updates = &drupal_static(__FUNCTION__, NULL);
if (!isset($updates[$module])) {
$updates = array();
- foreach (drupal_container()->get('module_handler')->getModuleList() as $loaded_module => $filename) {
+
+ foreach (module_list() as $loaded_module) {
$updates[$loaded_module] = array();
}
@@ -331,9 +341,7 @@ function _drupal_schema_initialize(&$schema, $module, $remove_descriptions = TRU
* An array of fields.
*/
function drupal_schema_fields_sql($table, $prefix = NULL) {
- if (!$schema = drupal_get_schema($table)) {
- return array();
- }
+ $schema = drupal_get_schema($table);
$fields = array_keys($schema['fields']);
if ($prefix) {
$columns = array();