/** * setDB function. * * @access public * @param mixed $dbHost * @param mixed $dbUser * @param mixed $dbPassword * @param mixed $dbName * @param mixed $dbSystem * @return void */ public static function setDB($dbHost, $dbUser, $dbPassword, $dbName, $dbSystem) { $options = array(PDO::ATTR_PERSISTENT => true); try { self::$db = new PDO($dbSystem . ':host=' . $dbHost . ';dbname=' . $dbName, $dbUser, $dbPassword, $options); } catch (PDOException $e) { throw new AOXException($e->getMessage(), $e->getCode()); } }
/** * isValidModule function. * checks if a given module is installed * * @access public * @param mixed $moduleID * @param bool $enabled. (default: false) * @return void */ public static function isValidModule($moduleID, $enabled = false) { $sql = "SELECT moduleID\n\t\t\t\t\t\tFROM " . DB_PREFIX . "module\n\t\t\t\t\t\tWHERE moduleID = '%s'"; if ($enabled) { $sql .= " AND enabled = 1"; } $db = aoxPages::getDB(); $query = $db->query($sql, $moduleID); return $db->numRows($query) == 1 ? true : false; }
* __autoload function. * * @access public * @param mixed $className * @return void */ function __autoload($className) { if ($className == "AbstractModule") { require AOX_MODULE_PATH . "/AbstractModule.class.php"; } } set_exception_handler('writeException'); OutlineTpl::globalAssign('pageTitle', 'aoxPages Devel'); try { aoxPages::setDB($dbHost, $dbUser, $dbPassword, $dbName, $dbSystem); } catch (Exception $e) { writeException($e); } try { $_config = new Config(); $configID = $_config->getOption('standardConfigID'); $_config->resetConfig($configID); } catch (Exception $e) { writeException($e); } $getModule = $_GET['module']; if (empty($getModule)) { $getModule = $_config->getOption('standardModule'); } $module = NULL;
protected function setDBOption($key, $value) { $db = aoxPages::getDB(); $query = $db->query(" UPDATE " . DB_PREFIX . "config\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSET value = '%s'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE field = '%s'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND configID = %d", $value, $key, $this->configID); }