当前位置: 首页>>代码示例>>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;未经允许,请勿转载。