/** * read structure */ function readStructure($a_force = false, $a_dir = "", $a_comp_prefix = "", $a_plugin_path = "") { global $ilDB; if (!$a_force && $this->ini->readVariable("db", "structure_reload") != "1") { return; } require_once './Services/UICore/classes/class.ilCachedCtrl.php'; ilCachedCtrl::flush(); require_once './Services/GlobalCache/classes/class.ilGlobalCache.php'; ilGlobalCache::flushAll(); // prefix for component $this->comp_prefix = $a_comp_prefix; // plugin path $this->plugin_path = $a_plugin_path; // only run one time per db_update request if (!$this->executed) { if ($a_dir == "") { $this->start_dir = ILIAS_ABSOLUTE_PATH; $this->read(ILIAS_ABSOLUTE_PATH); } else { $this->start_dir = $a_dir; $this->read($a_dir); } $this->store(); $this->determineClassFileIds(); $this->executed = true; if (!$a_force) { $this->ini->setVariable("db", "structure_reload", "0"); $this->ini->write(); } } // read module information // not clear whether this is a good place for module reading info // or not include_once "./Services/UICore/classes/class.ilCtrl.php"; $ctrl = new ilCtrl(); // $ctrl->storeCommonStructures(); }
/** * Read info of class * * @param object $a_class class name */ private function readClassInfo($a_class) { global $ilDB; $a_class = strtolower($a_class); if (isset($this->info_read_class[$a_class])) { return; } $cached_ctrl = ilCachedCtrl::getInstance(); $rec = $cached_ctrl->lookupClassFile($a_class); // $set = $ilDB->query("SELECT * FROM ctrl_classfile ". // " WHERE class = ".$ilDB->quote($a_class, "text") // ); // if ($rec = $ilDB->fetchAssoc($set)) if ($rec) { $this->cid_class[$rec["cid"]] = $a_class; $this->class_cid[$a_class] = $rec["cid"]; } // $set = $ilDB->query("SELECT * FROM ctrl_calls ". // " WHERE parent = ".$ilDB->quote($a_class, "text") // ); $recs = $cached_ctrl->lookupCall($a_class); // while ($rec = $ilDB->fetchAssoc($set)) foreach ($recs as $rec) { if (!isset($this->calls[$a_class]) || !is_array($this->calls[$a_class]) || !in_array($rec["child"], $this->calls[$a_class])) { if ($rec["child"] != "") { $this->calls[$a_class][] = $rec["child"]; } } } $this->info_read_class[$a_class] = true; $this->info_read_cid[$this->class_cid[$a_class]] = true; }
public static function flush() { ilGlobalCache::getInstance(ilGlobalCache::COMP_ILCTRL)->flush(); self::$instance = NULL; }