function action() { $cache =& owa_coreAPI::cacheSingleton(); $cache->flush(); $this->e->notice("Cache Flushed"); $data = array(); $data['do'] = 'base.optionsGeneral'; $data['view_method'] = 'redirect'; //$data['configuration'] = $nbsettings; $data['status_code'] = 2500; return $data; }
function __construct($ua = '') { parent::__construct(); // set user agent $this->ua = $ua; // init cache $this->cache =& owa_coreAPI::cacheSingleton(); $this->cacheExpiration = owa_coreAPI::getSetting('base', 'default_cache_expiration_period'); $this->cache->setCollectionExpirationPeriod('browscap', $this->cacheExpiration); //lookup robot in main browscap db $this->browser = $this->lookup($this->ua); $this->e->debug('Browser Name : ' . $this->browser->Browser); }
function action() { $cache = owa_coreAPI::cacheSingleton(); $cache->flush(); $this->e->notice("Cache Flushed"); }
function getByColumn($col, $value) { if (!$col) { owa_coreAPI::debug('No column name passed to getByColumn in entity:' . getName()); return; } $cache_obj = ''; if ($this->isCachable()) { $cache =& owa_coreAPI::cacheSingleton(); $cache->setCollectionExpirationPeriod($this->getTableName(), $this->getCacheExpirationPeriod()); $cache_obj = $cache->get($this->getTableName(), $col . $value); } if (!empty($cache_obj)) { $cache_obj_properties = $cache_obj->_getProperties(); $this->setProperties($cache_obj_properties); $this->wasPersisted = true; } else { $db = owa_coreAPI::dbSingleton(); $db->selectFrom($this->getTableName()); $db->selectColumn('*'); $db->where($col, $value); $properties = $db->getOneRow(); if (!empty($properties)) { $this->setProperties($properties); $this->wasPersisted = true; // add to cache $this->addToCache($col); owa_coreAPI::debug('entity loaded from db'); } } }