/** * initiates the Config object and fetches the configuration * * @access private * @global Database $db */ private function __construct() { $this->db =& FrontController::globalDatabase(); $this->log = new Log('config'); $this->log->write(1, 'init', 'No params needed, fetching config from Database'); $this->fetch(); }
/** * deletes all entries which have no activ locks anymore * * @static * @access public * @global Database $db */ public static function clearIPBase() { $db =& FrontController::globalDatabase(); $colNames = $db->getColNames('ipbase'); $Cols = array(); for ($i = 2; $i < count($colNames); $i++) { $Cols[] = $colNames[$i]; } $query = 'DELETE FROM `PREFIX_ipbase` WHERE '; foreach ($Cols as $col) { $query .= "`{$col}`<=" . time() . ' AND '; } $query = preg_replace('/ AND $/i', '', $query); $db->PushData($query); }