Beispiel #1
0
 /**
  * Load the active modules.  This is called at bootstrap time.
  */
 static function load_modules()
 {
     self::$modules = array();
     self::$active = array();
     $kohana_modules = array();
     // In version 32 we introduced a weight column so we can specify the module order
     // If we try to use that blindly, we'll break earlier versions before they can even
     // run the upgrader.
     $modules = module::get_version("gallery") < 32 ? ORM::factory("module")->find_all() : ORM::factory("module")->order_by("weight")->find_all();
     foreach ($modules as $module) {
         self::$modules[$module->name] = $module;
         if (!$module->active) {
             continue;
         }
         if ($module->name == "gallery") {
             $gallery = $module;
         } else {
             self::$active[] = $module;
             $kohana_modules[] = MODPATH . $module->name;
         }
     }
     self::$active[] = $gallery;
     // put gallery last in the module list to match core.modules
     $config = Kohana_Config::instance();
     $config->set("core.modules", array_merge($kohana_modules, $config->get("core.modules")));
 }
Beispiel #2
0
 /**
  * Load the active modules.  This is called at bootstrap time.
  */
 static function load_modules()
 {
     // Reload module list from the config file since we'll do a refresh after calling install()
     $core = Kohana::config_load("core");
     $kohana_modules = $core["modules"];
     $modules = ORM::factory("module")->find_all();
     self::$modules = array();
     self::$active = array();
     foreach ($modules as $module) {
         self::$modules[$module->name] = $module;
         if ($module->active) {
             self::$active[] = $module;
         }
         $kohana_modules[] = MODPATH . $module->name;
         // @todo: force 'gallery' to be at the end
     }
     Kohana::config_set("core.modules", $kohana_modules);
 }
Beispiel #3
0
 /**
  * Load the active modules.  This is called at bootstrap time.
  */
 static function load_modules()
 {
     self::$modules = array();
     self::$active = array();
     $kohana_modules = array();
     foreach (ORM::factory("module")->find_all() as $module) {
         self::$modules[$module->name] = $module;
         if (!$module->active) {
             continue;
         }
         if ($module->name == "gallery") {
             $gallery = $module;
         } else {
             self::$active[] = $module;
             $kohana_modules[] = MODPATH . $module->name;
         }
     }
     self::$active[] = $gallery;
     // put gallery last in the module list to match core.modules
     Kohana::config_set("core.modules", array_merge($kohana_modules, Kohana::config("core.modules")));
 }
Beispiel #4
0
 /**
  * Load the active modules.  This is called at bootstrap time.
  */
 static function load_modules()
 {
     // Reload module list from the config file since we'll do a refresh after calling install()
     $core = Kohana::config_load("core");
     $kohana_modules = $core["modules"];
     self::$module_names = array();
     self::$modules = array();
     // This is one of the first database operations that we'll do, so it may fail if there's no
     // install yet.  Try to handle this situation gracefully expecting that the scaffolding will
     // Do The Right Thing.
     // Reverting from installer stage 1.
     // @todo get rid of this extra error checking when we have an installer.
     set_error_handler(array("module", "dummy_error_handler"));
     try {
         $modules = ORM::factory("module")->find_all();
     } catch (Exception $e) {
         return;
     }
     try {
         foreach ($modules as $module) {
             self::$module_names[$module->name] = $module->name;
             self::$modules[$module->name] = $module;
             $kohana_modules[] = MODPATH . $module->name;
         }
         Kohana::config_set("core.modules", $kohana_modules);
     } catch (Exception $e) {
         self::$module_names = array();
         self::$modules = array();
     }
     self::event("gallery_ready");
 }