/** * Cleans stale cache-data **/ function __cleanUp() { $staledate = dbal_date(time() - CACHE_TIMEOUT); $clauses = array( array('lastscanned', $staledate, '<') ); dbal_delete($this->page_table, $clauses); dbal_delete($this->meta_table, $clauses); }
function end($name) { if (array_key_exists($name, $this->measurements)) { $inserts = $this->measurements[$name]; $inserts['name'] = $name; $inserts['microtime'] = (microtime(TRUE) - $inserts['timestamp'])*1000; $inserts['timestamp'] = dbal_date($inserts['timestamp']); dbal_insert('stats', $inserts); unset($this->measurements[$name]); } }