Exemplo n.º 1
0
 /**
  * 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);
 }
Exemplo n.º 2
0
 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]);
     }
 }