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


PHP Prado::unserialize方法代碼示例

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


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

示例1: load

 public function load()
 {
     if (($cache = $this->getApplication()->getCache()) !== null && ($value = $cache->get(self::CACHE_NAME)) !== false) {
         return Prado::unserialize($value);
     } else {
         if (($content = @file_get_contents($this->getStateFilePath())) !== false) {
             return Prado::unserialize($content);
         } else {
             return null;
         }
     }
 }
開發者ID:tejdeeps,項目名稱:tejcs.com,代碼行數:12,代碼來源:pradolite.php

示例2: unserialize

 /**
  * @param TPage
  * @param string serialized data
  * @return mixed unserialized state data, null if data is corrupted
  */
 public static function unserialize($page, $data)
 {
     $str = base64_decode($data);
     if ($str === '') {
         return null;
     }
     if ($str !== false) {
         $sm = $page->getApplication()->getSecurityManager();
         if ($page->getEnableStateEncryption()) {
             $str = $sm->decrypt($str);
         }
         if ($page->getEnableStateCompression() && extension_loaded('zlib')) {
             $str = @gzuncompress($str);
         }
         if ($page->getEnableStateValidation()) {
             if (($str = $sm->validateData($str)) !== false) {
                 return Prado::unserialize($str);
             }
         } else {
             return Prado::unserialize($str);
         }
     }
     return null;
 }
開發者ID:jetbill,項目名稱:hospital-universitario,代碼行數:29,代碼來源:TPage.php

示例3: initApplication

 protected function initApplication()
 {
     if ($this->_configFile !== null) {
         if ($this->_cacheFile === null || @filemtime($this->_cacheFile) < filemtime($this->_configFile)) {
             $config = new TApplicationConfiguration();
             $config->loadFromFile($this->_configFile);
             if ($this->_cacheFile !== null) {
                 file_put_contents($this->_cacheFile, Prado::serialize($config), LOCK_EX);
             }
         } else {
             $config = Prado::unserialize(file_get_contents($this->_cacheFile));
         }
         $this->applyConfiguration($config, false);
     }
     if (($serviceID = $this->getRequest()->resolveRequest(array_keys($this->_services))) === null) {
         $serviceID = $this->getPageServiceID();
     }
     $this->startService($serviceID);
 }
開發者ID:jetbill,項目名稱:hospital-universitario,代碼行數:19,代碼來源:pradolite.php

示例4: getValue

 /**
  * Retrieves a value from cache with a specified key.
  * This is the implementation of the method declared in the parent class.
  * @param string a unique key identifying the cached value
  * @return string the value stored in cache, false if the value is not in the cache or expired.
  */
 protected function getValue($key)
 {
     $sql = 'SELECT value FROM ' . self::CACHE_TABLE . ' WHERE key=\'' . $key . '\' AND (expire=0 OR expire>' . time() . ') LIMIT 1';
     if (($ret = $this->_db->query($sql)) != false && ($row = $ret->fetch(SQLITE_ASSOC)) !== false) {
         return Prado::unserialize($row['value']);
     } else {
         return false;
     }
 }
開發者ID:bailey-ann,項目名稱:stringtools,代碼行數:15,代碼來源:TSqliteCache.php

示例5: getValue

 /**
  * Retrieves a value from cache with a specified key.
  * This is the implementation of the method declared in the parent class.
  * @param string a unique key identifying the cached value
  * @return string the value stored in cache, false if the value is not in the cache or expired.
  */
 protected function getValue($key)
 {
     if (!$this->_cacheInitialized) {
         $this->initializeCache();
     }
     try {
         $sql = 'SELECT value FROM ' . $this->_cacheTable . ' WHERE itemkey=\'' . $key . '\' AND (expire=0 OR expire>' . time() . ') ORDER BY expire DESC';
         $command = $this->getDbConnection()->createCommand($sql);
         return Prado::unserialize($command->queryScalar());
     } catch (Exception $e) {
         $this->initializeCache(true);
         return Prado::unserialize($command->queryScalar());
     }
 }
開發者ID:tejdeeps,項目名稱:tejcs.com,代碼行數:20,代碼來源:TDbCache.php


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