本文整理汇总了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');
}
}
}