diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/simpletest/tests/registry.test | 6 | ||||
-rw-r--r-- | modules/system/system.install | 29 | ||||
-rw-r--r-- | modules/system/system.module | 2 |
3 files changed, 32 insertions, 5 deletions
diff --git a/modules/simpletest/tests/registry.test b/modules/simpletest/tests/registry.test index a167178b6..794403dac 100644 --- a/modules/simpletest/tests/registry.test +++ b/modules/simpletest/tests/registry.test @@ -122,11 +122,9 @@ class RegistryParseFilesTestCase extends DrupalWebTestCase { function getFiles() { $files = array(); foreach ($this->fileTypes as $fileType) { + $files[$this->$fileType->fileName] = array('module' => '', 'weight' => 0); if ($fileType == 'existing_changed') { - $files[$this->$fileType->fileName] = array('md5' => $this->$fileType->fakeMD5); - } - else { - $files[$this->$fileType->fileName] = array(); + $files[$this->$fileType->fileName]['md5'] = $this->$fileType->fakeMD5; } } return $files; diff --git a/modules/system/system.install b/modules/system/system.install index dbd6c8f29..f84bc570c 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -1092,8 +1092,31 @@ function system_schema() { 'length' => 255, 'not null' => TRUE, ), + 'module' => array( + 'description' => t('Name of the module the file belongs to.'), + 'type' => 'varchar', + 'length' => 255, + 'not null' => TRUE, + 'default' => '' + ), + 'suffix' => array( + 'description' => t("The part of the function name after the module, which is the hook this function implements, if any."), + 'type' => 'varchar', + 'length' => 68, + 'not null' => TRUE, + 'default' => '' + ), + 'weight' => array( + 'description' => t("The order in which this module's hooks should be invoked relative to other modules. Equal-weighted modules are ordered by name."), + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + ), ), 'primary key' => array('name', 'type'), + 'indexes' => array( + 'hook' => array('type', 'suffix', 'weight', 'module'), + ), ); $schema['registry_file'] = array( @@ -2931,8 +2954,14 @@ function system_update_7006() { 'name' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), 'type' => array('type' => 'varchar', 'length' => 9, 'not null' => TRUE, 'default' => ''), 'filename' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'module' => array('type' => 'varchar', 'length' => 255, 'not null' => TRUE, 'default' => ''), + 'suffix' => array('type' => 'varchar', 'length' => 69, 'not null' => TRUE, 'default' => ''), + 'weight' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), ), 'primary key' => array('name', 'type'), + 'indexes' => array( + 'hook' => array('type', 'suffix', 'weight', 'module'), + ), ); $schema['registry_file'] = array( 'fields' => array( diff --git a/modules/system/system.module b/modules/system/system.module index c448a9143..48ac89a63 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -935,7 +935,7 @@ function system_check_directory($form_element) { */ function system_get_files_database(&$files, $type) { // Extract current files from database. - $result = db_query("SELECT filename, name, type, status, schema_version FROM {system} WHERE type = '%s'", $type); + $result = db_query("SELECT filename, name, type, status, schema_version, weight FROM {system} WHERE type = '%s'", $type); while ($file = db_fetch_object($result)) { if (isset($files[$file->name]) && is_object($files[$file->name])) { $file->old_filename = $file->filename; |