diff options
author | Bharat Mediratta <bharat@menalto.com> | 2008-12-22 04:49:30 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2008-12-22 04:49:30 +0000 |
commit | 17f77b8de4586d1ee4a3693561b71815eb2fc092 (patch) | |
tree | bce4ee9c8a1c34f9e2845269ec8bda4b346e2e3d | |
parent | 9cf2c5792111570fd831abfad9fc7496995d2e8b (diff) |
Remove module.info from infrastructure modules that are effectively
libraries that would ship with the core.
Refactor welcome.php to use the newly refactored module::available()
-rw-r--r-- | core/controllers/welcome.php | 24 | ||||
-rw-r--r-- | modules/atom/module.info | 3 | ||||
-rw-r--r-- | modules/forge/module.info | 3 | ||||
-rw-r--r-- | modules/gallery_unit_test/module.info | 3 | ||||
-rw-r--r-- | modules/unit_test/module.info | 3 |
5 files changed, 3 insertions, 33 deletions
diff --git a/core/controllers/welcome.php b/core/controllers/welcome.php index b253f13f..18ce0c1a 100644 --- a/core/controllers/welcome.php +++ b/core/controllers/welcome.php @@ -32,7 +32,7 @@ class Welcome_Controller extends Template_Controller { set_error_handler(array("Welcome_Controller", "_error_handler")); try { - $this->template->syscheck->modules = $this->_read_modules(); + $this->template->syscheck->modules = module::available(); $this->template->album_count = ORM::factory("item")->where("type", "album")->count_all(); $this->template->photo_count = ORM::factory("item")->where("type", "photo")->count_all(); $this->template->deepest_photo = ORM::factory("item") @@ -65,8 +65,8 @@ class Welcome_Controller extends Template_Controller { function install($module_name) { $to_install = array(); if ($module_name == "*") { - foreach ($this->_read_modules() as $module_name => $version) { - if (empty($version)) { + foreach (module::available() as $module_name => $info) { + if (empty($info->installed)) { $to_install[] = $module_name; } } @@ -417,24 +417,6 @@ class Welcome_Controller extends Template_Controller { } } - /** - * Create an array of all the modules that are install or available and the version number - * @return array(moduleId => version) - */ - private function _read_modules() { - $modules = module::available(); - try { - foreach (module::installed() as $installed_module) { - $modules->$installed_module->version = $installed_module->version; - } - } catch (Exception $e) { - // The database may not be installed - } - ksort($modules); - - return $modules; - } - private function _load_group_info() { if (class_exists("Group_Model")) { $this->template->groups = ORM::factory("group")->find_all(); diff --git a/modules/atom/module.info b/modules/atom/module.info deleted file mode 100644 index d4b7898b..00000000 --- a/modules/atom/module.info +++ /dev/null @@ -1,3 +0,0 @@ -name = Atom Publishing -description = Enables publishing Gallery resources in ATOM format -version = 1 diff --git a/modules/forge/module.info b/modules/forge/module.info deleted file mode 100644 index 9d2387f3..00000000 --- a/modules/forge/module.info +++ /dev/null @@ -1,3 +0,0 @@ -name = Forge -description = Form generation and validation framework -version = 1 diff --git a/modules/gallery_unit_test/module.info b/modules/gallery_unit_test/module.info deleted file mode 100644 index e22df5fc..00000000 --- a/modules/gallery_unit_test/module.info +++ /dev/null @@ -1,3 +0,0 @@ -name = Gallery Unit Test -description = Gallery extension to the unit test framework -version = 1 diff --git a/modules/unit_test/module.info b/modules/unit_test/module.info deleted file mode 100644 index 6a2c1dee..00000000 --- a/modules/unit_test/module.info +++ /dev/null @@ -1,3 +0,0 @@ -name = Unit Test -description = Unit test framework -version = 1 |