本文整理匯總了PHP中owa_coreAPI::cacheSingleton方法的典型用法代碼示例。如果您正苦於以下問題:PHP owa_coreAPI::cacheSingleton方法的具體用法?PHP owa_coreAPI::cacheSingleton怎麽用?PHP owa_coreAPI::cacheSingleton使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類owa_coreAPI
的用法示例。
在下文中一共展示了owa_coreAPI::cacheSingleton方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: action
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;
}
示例2: __construct
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);
}
示例3: action
function action()
{
$cache = owa_coreAPI::cacheSingleton();
$cache->flush();
$this->e->notice("Cache Flushed");
}
示例4: getByColumn
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');
}
}
}