- $caller->info("Recompiling " .($barrel ? "plugin cache for barrel '$barrel'" : "global plugin cache"));
-
- // get the list of all plugins present on the system
- $allplugins = array();
- $plugfiles = System::find($this->plugdir.' -type f -name *.php');
- foreach ($plugfiles as $file) {
- $name = basename($file);
- $name = substr($name, 0, -4);
- array_push($allplugins, $name);
- }
-
- $defcache = array();
- // fill initial values
- foreach ($allplugins as $plugin)
- {
- $plug_h = $this->load($plugin);
- $defcache[$plugin] = $plug_h->toArray();
- }
-
- // get DB values
- $dbcache = array();
-
- $sql_limit = $barrel ? " where barrel='{$barrel}' or barrel=''" : "";
- $sql = "select barrel, page, plugin, status, params from diogenes_plugin" . $sql_limit;
- $res = $this->dbh->query($sql);
- while($row = mysql_fetch_row($res))
- {
- $c_barrel = array_shift($row);
- $c_page = array_shift($row);
- $plugin = array_shift($row);
- $plugentry = array(
- 'status' => $row[0],
- 'params' => ($row[1] ? var_decode_bin($row[1]) : array())
- );
- $plug_h = $this->load($plugin, $plugentry);
- //echo "Got params from DB for '$plugin', barrel '$c_barrel', page '$c_page' : ".$row[2]."<br/>";
- $dbcache[$c_barrel][$c_page][$plugin] = $plug_h->toArray();