/** * Remove all variables for this module. * @param string $module_name */ static function clear_all_vars($module_name) { db::build()->delete("vars")->where("module_name", "=", $module_name)->execute(); Cache::instance()->delete("var_cache"); self::$var_cache = null; }
/** * Remove a variable for this module. * @param string $module_name * @param string $name */ static function clear_var($module_name, $name) { $var = ORM::factory("var")->where("module_name", "=", $module_name)->where("name", "=", $name)->find(); if ($var->loaded()) { $var->delete(); } db::build()->delete("vars")->where("module_name", "=", "gallery")->where("name", "=", "_cache")->execute(); self::$var_cache = null; }
/** * Remove a variable for this module. * @param string $module_name * @param string $name */ static function clear_var($module_name, $name) { $var = ORM::factory("var")->where("module_name", $module_name)->where("name", $name)->find(); if ($var->loaded) { $var->delete(); } Database::instance()->delete("vars", array("module_name" => "gallery", "name" => "_cache")); self::$var_cache = null; }
/** * 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"); }