當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ObjectCache::writeLog方法代碼示例

本文整理匯總了PHP中ObjectCache::writeLog方法的典型用法代碼示例。如果您正苦於以下問題:PHP ObjectCache::writeLog方法的具體用法?PHP ObjectCache::writeLog怎麽用?PHP ObjectCache::writeLog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ObjectCache的用法示例。


在下文中一共展示了ObjectCache::writeLog方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: save

 public function save(array $data)
 {
     if (apc_add(parent::getName(), serialize($data), parent::getTimeToLive()) === false) {
         # logging me hearties
         # logging me hearties
         $types = parent::getTypes();
         $urgency = parent::getUrgency();
         parent::writeLog($types['error'], $urgency['high'], 'Could not successfully save to cache', 'APC Cache info: ' . PHP_EOL . serialize(apc_cache_info()));
         return false;
     }
     return true;
 }
開發者ID:RoneilZA,項目名稱:dashboards,代碼行數:12,代碼來源:CacheApc.2011.07.25.php

示例2: load

 public function load()
 {
     if ($this->__testForApc() === false) {
         return false;
     }
     if (($data = apc_fetch(parent::getName())) === false) {
         # logging me hearties
         $types = parent::getTypes();
         $urgency = parent::getUrgency();
         parent::writeLog($types['notice'], array_key_exists("low", $urgency) ? $urgency["low"] : "", 'Could not successfully read from cache', 'APC Cache info: ' . PHP_EOL . serialize(apc_cache_info()));
         return false;
     }
     return unserialize($data);
 }
開發者ID:RoneilZA,項目名稱:dashboards,代碼行數:14,代碼來源:CacheApc.php

示例3: _testForCacheDateTable

 private function _testForCacheDateTable()
 {
     $query = (string) "describe `cache_query_times`;";
     if (self::query($query, false) === false) {
         $query = (string) "create table `cache_query_times` (\n\t\t\t\t`id` integer(100) unsigned not null auto_increment primary key,\n\t\t\t\t`table` char(200),\n\t\t\t\t`timestamp` integer(100) unsigned not null default 0,\n\t\t\t\tindex `cacheQueryTimes` (`table`(100), `timestamp`)\n\t\t\t) engine=InnoDb default charset=UTF8;";
         if (self::query($query, false) === false) {
             # logging me hearties
             $types = parent::getTypes();
             $urgency = parent::getUrgency();
             parent::writeLog($types['error'], $urgency['high'], 'Could not successfully create table for cache timing', "mySQL returned the following error: " . self::getConnection()->real_escape_string(self::getConnection()->error) . "\n");
             return false;
         }
         return true;
     }
     return true;
 }
開發者ID:RoneilZA,項目名稱:dashboards,代碼行數:16,代碼來源:CacheMysql.php


注:本文中的ObjectCache::writeLog方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。