当前位置: 首页>>代码示例>>PHP>>正文


PHP owa_coreAPI::cacheSingleton方法代码示例

本文整理汇总了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;
 }
开发者ID:nishantmendiratta,项目名称:Open-Web-Analytics,代码行数:12,代码来源:optionsFlushCache.php

示例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);
 }
开发者ID:nishantmendiratta,项目名称:Open-Web-Analytics,代码行数:13,代码来源:browscap.php

示例3: action

 function action()
 {
     $cache = owa_coreAPI::cacheSingleton();
     $cache->flush();
     $this->e->notice("Cache Flushed");
 }
开发者ID:ashutoshdev,项目名称:Open-Web-Analytics,代码行数:6,代码来源:flushCacheCli.php

示例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');
         }
     }
 }
开发者ID:nishantmendiratta,项目名称:Open-Web-Analytics,代码行数:31,代码来源:owa_entity.php


注:本文中的owa_coreAPI::cacheSingleton方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。