added the webui to the tarball

This commit is contained in:
SJ
2012-02-08 23:14:28 +01:00
parent 79cdeed1b6
commit 1211e9a39c
272 changed files with 26456 additions and 11 deletions

View File

@ -0,0 +1,43 @@
<?php
class ModelStatCounter extends Model {
public function getCounters(){
$counter = array();
if(MEMCACHED_ENABLED) {
$memcache = Registry::get('memcache');
$counter = $memcache->get(Registry::get('counters'));
if(isset($counter['_c:counters_last_update'])) { return $counter; }
}
$query = $this->db->query("SELECT * FROM " . TABLE_COUNTER);
if($query->num_rows == 1) {
$counter = $query->row;
}
return $counter;
}
public function resetCounters(){
if(MEMCACHED_ENABLED) {
$memcache = Registry::get('memcache');
foreach (Registry::get('counters') as $counter) {
$memcache->set($counter, 0);
}
}
$query = $this->db->query("UPDATE " . TABLE_COUNTER . " set rcvd=0, virus=0, duplicate=0, ignore=0");
return 0;
}
}
?>