/** * method for updating module version in module registry * * @param float $new_version the version to upgrade to * @param int $id the id of the module to be upgraded * @return boolean true or throws an error on failure */ public function updateRegistry($new_version, $id) { $db = new db(); $values = array('module_version' => $new_version, 'run_level' => $this->installInfo['RUN_LEVEL']); $result = $db->update('modules', $values, $id); return $result; }
/** * Method for setting a profile's template * @param string $template * @return boolean $res */ public function setProfileTemplate($template = null) { $db = new db(); $db->connect(); if (isset($template)) { $this->profileTemplate = $template; } $ini_file = conf::pathHtdocs() . "/templates/{$this->profileTemplate}/{$this->profileTemplate}.ini"; $ini_file_dist = $ini_file . "-dist"; if (conf::isCli()) { if (file_exists($ini_file_dist)) { copy($ini_file_dist, $ini_file); } } $values = array('template' => $this->profileTemplate); return $db->update('settings', $values, 1); }