diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-07-31 11:17:27 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-07-31 11:17:27 +0000 |
commit | 9945bca5288ab004ff99701361350b6f250afa10 (patch) | |
tree | 2f0d5d5d36c9a73be312e4aa9d7c94b76c2443c4 /modules/system/system.module | |
parent | 202eee42a929a0f48ce693e10943cc156ef5a7ef (diff) | |
download | brdo-9945bca5288ab004ff99701361350b6f250afa10.tar.gz brdo-9945bca5288ab004ff99701361350b6f250afa10.tar.bz2 |
- Patch #9650 by Adrian: this change introduces a module_load function, which maintains a list of modules that have already been loaded in a static array, and will not load another module of the same name, or if the file does not exist.
Modules can be stored anywhere, as there is now a set of functions called module_get_filename, and module_set_filename .. which allow system_listing and module_list to specify the locations of the files.
A new function module_load_all() replaces the hardcoded includes in module_init, and loads all modules which have been enabled, using module_load.
module_listing no longer includes files itself, instead it just keeps the listing (and sets the filenames).
This patch is a requirement for the multisite configuration patch, as overriding modules are currently being loaded due to the only protection of loading them is include_once.
Diffstat (limited to 'modules/system/system.module')
-rw-r--r-- | modules/system/system.module | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/system/system.module b/modules/system/system.module index 265ae2b85..9ea7daac2 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -245,7 +245,9 @@ function system_listing($type) { } foreach ($files as $filename => $file) { - include_once($filename); + module_set_filename($file->name, $filename); + module_load($file->name); + if ($type == 'module') { $info->name = module_invoke($file->name, 'help', 'admin/modules#name') ? module_invoke($file->name, 'help', 'admin/modules#name') : module_invoke($file->name, 'system', 'name') ? module_invoke($file->name, 'system', 'name') : $file->name; $info->description = module_invoke($file->name, 'help', 'admin/modules#description') ? module_invoke($file->name, 'help', 'admin/modules#description') : module_invoke($file->name, 'system', 'description'); |