From 62df4eca4517d9a0d93fe1fc0aef9f1a311db644 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Skej=C3=B8?= Date: Fri, 1 May 2009 21:48:01 +0200 Subject: [PATCH] modules/Installer/Installer.php: - Removed unnesscesary $this->dataModel()->populate() - installModule(): we should only try to create a data model if there actually is a data model - Commented postInitialization() out --- modules/Installer/Installer.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/Installer/Installer.php b/modules/Installer/Installer.php index 13a64e2..8973c3e 100644 --- a/modules/Installer/Installer.php +++ b/modules/Installer/Installer.php @@ -58,11 +58,11 @@ class Installer extends AOOSModule { return $m; } - public function postInitialization() { +/* public function postInitialization() { $m = $this->dataModel(); $m->setTable($this->core()->getSetting("module_table")); $m->populate(); - } +}*/ /** * Returns an array with names of all uninstalled modules @@ -101,7 +101,6 @@ class Installer extends AOOSModule { * @return array */ public function getAllModules() { - $this->dataModel()->populate(); $d = dir($this->core()->getSetting("module_dir")); $modules = array(); while (false !== ($entry = $d->read())) { @@ -124,12 +123,15 @@ class Installer extends AOOSModule { require $path; $deps = call_user_func(array($module,"dependencies")); + $deps = implode(",",$deps); $this->dataModel()->insert(array("NAME" => $module, - "DEPS" => implode(",",$deps))); + "DEPS" => $deps)); $this->dataModel()->save(); $m = $this->core()->loadModule($module); - $m->dataModel()->create(); + if ($dm = $m->dataModel()) { + $dm->create(); + } return true; } -- 2.11.4.GIT