• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP kQueryCache类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中kQueryCache的典型用法代码示例。如果您正苦于以下问题:PHP kQueryCache类的具体用法?PHP kQueryCache怎么用?PHP kQueryCache使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了kQueryCache类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: execute

 public function execute($input_parameters = null)
 {
     if (!kQueryCache::isCurrentQueryHandled()) {
         kApiCache::disableConditionalCache();
     }
     $search = array();
     $replace = array();
     if (is_null($input_parameters)) {
         $search = array_reverse(array_keys($this->values));
         $replace = array_reverse($this->values);
     } else {
         $i = 1;
         foreach ($input_parameters as $value) {
             $search[] = ':p' . $i++;
             if (is_null($value)) {
                 $replace[] = "NULL";
             } else {
                 $replace[] = "'{$value}'";
             }
         }
         $search = array_reverse($search);
         $replace = array_reverse($replace);
     }
     $sql = str_replace($search, $replace, $this->queryString);
     KalturaLog::debug($sql);
     $sqlStart = microtime(true);
     if (self::$dryRun && !preg_match('/^(\\/\\*.+\\*\\/ )?SELECT/i', $sql)) {
         KalturaLog::debug("Sql dry run - " . (microtime(true) - $sqlStart) . " seconds");
     } else {
         try {
             parent::execute($input_parameters);
         } catch (PropelException $pex) {
             KalturaLog::alert($pex->getMessage());
             throw new PropelException("Database error");
         }
         $sqlTook = microtime(true) - $sqlStart;
         KalturaLog::debug("Sql took - " . $sqlTook . " seconds");
         KalturaMonitorClient::monitorDatabaseAccess($sql, $sqlTook);
     }
 }
开发者ID:DBezemer,项目名称:server,代码行数:40,代码来源:KalturaStatement.php


示例2: doSelect

 /**
  * Method to do selects.
  *
  * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
  * @param      PropelPDO $con
  * @return     array Array of selected Objects
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function doSelect(Criteria $criteria, PropelPDO $con = null)
 {
     $criteriaForSelect = MetadataProfilePeer::prepareCriteriaForSelect($criteria);
     $queryDB = kQueryCache::QUERY_DB_UNDEFINED;
     $cacheKey = null;
     $cachedResult = kQueryCache::getCachedQueryResults($criteriaForSelect, kQueryCache::QUERY_TYPE_SELECT, 'MetadataProfilePeer', $cacheKey, $queryDB);
     if ($cachedResult !== null) {
         $cacheKey = null;
         MetadataProfilePeer::filterSelectResults($cachedResult, $criteriaForSelect);
         MetadataProfilePeer::updateInstancePool($cachedResult);
         return $cachedResult;
     }
     $con = MetadataProfilePeer::alternativeCon($con, $queryDB);
     $queryResult = MetadataProfilePeer::populateObjects(BasePeer::doSelect($criteriaForSelect, $con));
     if ($criteriaForSelect instanceof KalturaCriteria) {
         $criteriaForSelect->applyResultsSort($queryResult);
     }
     if ($cacheKey !== null) {
         kQueryCache::cacheQueryResults($cacheKey, $queryResult);
         $cacheKey = null;
     }
     MetadataProfilePeer::filterSelectResults($queryResult, $criteria);
     MetadataProfilePeer::addInstancesToPool($queryResult);
     return $queryResult;
 }
开发者ID:DBezemer,项目名称:server,代码行数:34,代码来源:BaseMetadataProfilePeer.php


示例3: postUpdate

 /**
  * Code to be run after updating the object in database
  * @param PropelPDO $con
  */
 public function postUpdate(PropelPDO $con = null)
 {
     if ($this->alreadyInSave) {
         return;
     }
     kQueryCache::invalidateQueryCache($this);
     parent::postUpdate($con);
 }
开发者ID:DBezemer,项目名称:server,代码行数:12,代码来源:BaseSchedulerStatus.php


示例4: postUpdate

 /**
  * Code to be run after updating the object in database
  * @param PropelPDO $con
  */
 public function postUpdate(PropelPDO $con = null)
 {
     if ($this->alreadyInSave) {
         return;
     }
     if ($this->isModified()) {
         kQueryCache::invalidateQueryCache($this);
         kEventsManager::raiseEvent(new kObjectChangedEvent($this, $this->tempModifiedColumns));
     }
     $this->tempModifiedColumns = array();
     parent::postUpdate($con);
 }
开发者ID:DBezemer,项目名称:server,代码行数:16,代码来源:BaseScheduledTaskProfile.php


示例5: postUpdate

 /**
  * Code to be run after updating the object in database
  * @param PropelPDO $con
  */
 public function postUpdate(PropelPDO $con = null)
 {
     if ($this->alreadyInSave) {
         return;
     }
     if ($this->isModified()) {
         kQueryCache::invalidateQueryCache($this);
         $modifiedColumns = $this->tempModifiedColumns;
         $modifiedColumns[kObjectChangedEvent::CUSTOM_DATA_OLD_VALUES] = $this->oldCustomDataValues;
         kEventsManager::raiseEvent(new kObjectChangedEvent($this, $modifiedColumns));
     }
     $this->tempModifiedColumns = array();
     parent::postUpdate($con);
 }
开发者ID:wzur,项目名称:server,代码行数:18,代码来源:Basekshow.php


示例6: initGlobalMemcache

 protected static function initGlobalMemcache()
 {
     if (self::$s_memcacheInited) {
         return;
     }
     self::$s_memcacheInited = true;
     self::$s_memcacheKeys = kCacheManager::getSingleLayerCache(kCacheManager::CACHE_TYPE_QUERY_CACHE_KEYS);
     if (self::$s_memcacheKeys === null) {
         // no reason to init the queries server, the query cache won't be used anyway
         return;
     }
     self::$s_memcacheQueries = kCacheManager::getSingleLayerCache(kCacheManager::CACHE_TYPE_QUERY_CACHE_QUERIES);
 }
开发者ID:DBezemer,项目名称:server,代码行数:13,代码来源:kQueryCache.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP kString类代码示例发布时间:2022-05-23
下一篇:
PHP kPluginableEnumsManager类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap