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


PHP lzf_decompress函数代码示例

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


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

示例1: decompress

 /**
  * Decompress the given value with the specific compression
  *
  * @param String $sValue
  *
  * @return String
  *
  * @throws Exception
  */
 public function decompress($sValue)
 {
     if (!is_string($sValue)) {
         throw new Exception('Invalid first argument, must be a string');
     }
     return lzf_decompress($sValue);
 }
开发者ID:joostina,项目名称:joostina,代码行数:16,代码来源:LzfCompression.php

示例2: uncompress

 public function uncompress($data = '', $small = 0)
 {
     if (!isValue($data)) {
         return Error::set(lang('Error', 'valueParameter', '1.(data)'));
     }
     return lzf_decompress($data);
 }
开发者ID:Allopa,项目名称:ZN-Framework-Starter,代码行数:7,代码来源:LZFDriver.php

示例3: decompress

 /**
  * Decompresses the given content
  *
  * @param  string $content
  * @return string
  */
 public function decompress($content)
 {
     $compressed = lzf_decompress($content);
     if (!$compressed) {
         throw new Zend_Filter_Exception('Error during compression');
     }
     return $compressed;
 }
开发者ID:kobmaki,项目名称:icingaweb2,代码行数:14,代码来源:Lzf.php

示例4: decompress

 /**
  * Decompresses the given content
  *
  * @param  string $content
  * @return string
  * @throws Exception\RuntimeException if error occurs during decompression
  */
 public function decompress($content)
 {
     $compressed = lzf_decompress($content);
     if (!$compressed) {
         throw new Exception\RuntimeException('Error during decompression');
     }
     return $compressed;
 }
开发者ID:eltondias,项目名称:Relogio,代码行数:15,代码来源:Lzf.php

示例5: decompress

 /**
  * Decompresses the given content
  *
  * @param  string $content
  * @return string
  */
 public function decompress($content)
 {
     $compressed = lzf_decompress($content);
     if (!$compressed) {
         require_once 'Zend/Filter/Exception.php';
         throw new Zend_Filter_Exception('Error during compression');
     }
     return $compressed;
 }
开发者ID:Yaoming9,项目名称:Projet-Web-PhP,代码行数:15,代码来源:Lzf.php

示例6: decompress

 /**
  * Decompresses the given content
  *
  * @param  string $content
  * @return string
  */
 public function decompress($content)
 {
     $compressed = lzf_decompress($content);
     if (!$compressed) {
         require_once IFW_PSN_LIB_ROOT . 'IfwPsn/Vendor/Zend/Filter/Exception.php';
         throw new IfwPsn_Vendor_Zend_Filter_Exception('Error during compression');
     }
     return $compressed;
 }
开发者ID:jasmun,项目名称:Noco100,代码行数:15,代码来源:Lzf.php

示例7: _decodeData

 public function _decodeData($data)
 {
     switch (substr($data, 0, 4)) {
         // asking the data which library it uses allows for transparent changes of libraries
         case ':sn:':
             return snappy_uncompress(substr($data, 4));
         case ':lz:':
             return lzf_decompress(substr($data, 4));
         case ':gz:':
             return gzuncompress(substr($data, 4));
     }
     return $data;
 }
开发者ID:asavchenko,项目名称:Magento_CrossAreaSessions,代码行数:13,代码来源:Redis.php

示例8: read_sub

 /**
  * バックアップファイルの内容を圧縮形式に応じて取得する
  * TODO:gzとbz2解凍がスレッドセーフでない
  * @access    private
  *
  * @return    Array     ファイルの内容
  */
 private function read_sub($ext, $join)
 {
     // ファイルを取得
     $data = '';
     switch ($ext) {
         case '.txt':
             $data = parent::get();
             break;
         case '.lzf':
             $data = lzf_decompress(parent::get());
             break;
         case '.gz':
             $handle = gzopen($this->filename, 'r');
             while (!gzeof($handle)) {
                 $data .= gzread($handle, 1024);
             }
             gzclose($handle);
             break;
         case '.bz2':
             $handle = bzopen($this->filename, 'r');
             while (!feof($handle)) {
                 $data .= bzread($handle, 1024);
             }
             bzclose($handle);
             break;
     }
     // 取得した内容を改行ごとに配列として返す
     return $join ? $data : explode("\n", $data);
 }
开发者ID:logue,项目名称:pukiwiki_adv,代码行数:36,代码来源:BackupFile.php

示例9: decompress

 /**
  * Decompress data
  *
  * @param string $data
  * @return string
  * @throws Exception
  */
 protected function decompress($data)
 {
     switch ($this->compression) {
         case self::COMPRESSION_LZ4:
             $decompressedData = @lz4_uncompress($data);
             if (false === $decompressedData) {
                 throw new Exception('Error decompressing with lz4_uncompress.');
             }
             break;
         case self::COMPRESSION_SNAPPY:
             $decompressedData = @snappy_uncompress($data);
             if (false === $decompressedData) {
                 throw new Exception('Error decompressing with snappy_uncompress.');
             }
             break;
         case self::COMPRESSION_LZF:
             $decompressedData = @lzf_decompress($data);
             if (false === $decompressedData) {
                 throw new Exception('Error decompressing with lzf_decompress.');
             }
             break;
         case self::COMPRESSION_GZ:
             $decompressedData = @gzuncompress($data);
             if (false === $decompressedData) {
                 throw new Exception('Error decompressing with gzuncompress.');
             }
             break;
         case self::COMPRESSION_NONE:
         default:
             $decompressedData = $data;
     }
     return $decompressedData;
 }
开发者ID:layeredcache,项目名称:layeredcache,代码行数:40,代码来源:CacheLayer.php

示例10: decompress

 /**
  */
 public function decompress($text)
 {
     return strlen($text) ? @lzf_decompress($text) : '';
 }
开发者ID:horde,项目名称:horde,代码行数:6,代码来源:Lzf.php

示例11: get

 /**
  * Return cached data.
  *
  * @param string $key  Cache key.
  *
  * @return mixed  Cache data, or false if not found.
  */
 public function get($key)
 {
     if ($this->_mask & self::APC) {
         $data = apc_fetch($key);
     } elseif ($this->_mask & self::XCACHE) {
         $data = xcache_get($key);
     } elseif ($this->_mask & self::EACCELERATOR) {
         $data = eaccelerator_get($key);
     } elseif ($this->_mask & self::TEMPFILE) {
         $data = @file_get_contents($this->_tempdir . '/' . $key);
         if ($data === false) {
             unlink($this->_tempdir . '/' . $key);
         }
     } else {
         return false;
     }
     if ($data) {
         if ($this->_mask & self::LZ4) {
             $data = @horde_lz4_uncompress($data);
         } elseif ($this->_mask & self::LZF) {
             $data = @lzf_decompress($data);
         }
     }
     return $data === false ? false : $this->_mask & self::MSGPACK ? msgpack_unpack($data) : @json_decode($data, true);
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:32,代码来源:Bootstrap.php

示例12: _decodeData

 /**
  * @param bool|string $data
  * @return string
  */
 protected function _decodeData($data)
 {
     if (substr($data, 2, 3) == self::COMPRESS_PREFIX) {
         switch (substr($data, 0, 2)) {
             case 'sn':
                 return snappy_uncompress(substr($data, 5));
             case 'lz':
                 return lzf_decompress(substr($data, 5));
             case 'gz':
             case 'zc':
                 return gzuncompress(substr($data, 5));
         }
     }
     return $data;
 }
开发者ID:RabeaWahab,项目名称:Rabee3_Cache_Backend_RedisCluster,代码行数:19,代码来源:RedisCluster.php

示例13: _unserialize

 /**
  * Unserialize data.
  *
  * @param mixed $data    The data to be unserialized.
  * @param mixed $mode    The mode of unserialization. Can be either a
  *                       single mode or array of modes.  If array, will be
  *                       unserialized in the order provided.
  * @param mixed $params  Any additional parameters the unserialization
  *                       method requires.
  *
  * @return mixed  Unserialized data.
  * @throws Horde_Serialize_Exception
  */
 protected static function _unserialize(&$data, $mode, $params = null)
 {
     switch ($mode) {
         case self::NONE:
             break;
         case self::RAW:
             $data = rawurldecode($data);
             break;
         case self::URL:
             $data = urldecode($data);
             break;
         case self::WDDX:
             $data = wddx_deserialize($data);
             break;
         case self::BZIP:
             // $params['small'] = Use bzip2 'small memory' mode?
             $data = bzdecompress($data, isset($params['small']) ? $params['small'] : false);
             break;
         case self::IMAP8:
             $data = quoted_printable_decode($data);
             break;
         case self::IMAPUTF7:
             $data = Horde_String::convertCharset(Horde_Imap_Client_Utf7imap::Utf7ImapToUtf8($data), 'UTF-8', 'ISO-8859-1');
             break;
         case self::IMAPUTF8:
             $data = Horde_Mime::encode($data);
             break;
         case self::BASIC:
             $data2 = @unserialize($data);
             // Unserialize can return false both on error and if $data is the
             // false value.
             if ($data2 === false && $data == serialize(false)) {
                 return $data2;
             }
             $data = $data2;
             break;
         case self::GZ_DEFLATE:
             $data = gzinflate($data);
             break;
         case self::BASE64:
             $data = base64_decode($data);
             break;
         case self::GZ_COMPRESS:
             $data = gzuncompress($data);
             break;
             // $params = Output character set
         // $params = Output character set
         case self::UTF7:
             $data = Horde_String::convertCharset($data, 'utf-7', $params);
             break;
             // $params = Output character set
         // $params = Output character set
         case self::UTF7_BASIC:
             $data = self::unserialize($data, array(self::BASIC, self::UTF7), $params);
             break;
         case self::JSON:
             $out = json_decode($data);
             if (!is_null($out) || strcasecmp($data, 'null') === 0) {
                 return $out;
             }
             break;
         case self::LZF:
             $data = @lzf_decompress($data);
             break;
     }
     if ($data === false) {
         throw new Horde_Serialize_Exception('Unserialization failed.');
     }
     return $data;
 }
开发者ID:jubinpatel,项目名称:horde,代码行数:83,代码来源:Serialize.php

示例14: decompress

 /**
  * Static method to decompress data
  *
  * @param  string $data
  * @return mixed
  */
 public static function decompress($data)
 {
     return lzf_decompress($data);
 }
开发者ID:akinyeleolubodun,项目名称:PhireCMS2,代码行数:10,代码来源:Lzf.php

示例15: decompress

 protected function decompress()
 {
     switch ($this->compress) {
         case self::COMPRESS_GZIP:
             $this->payload = gzinflate($this->payload);
             break;
         case self::COMPRESS_BZIP:
             $this->payload = bzdecompress($this->payload);
             break;
         case self::COMPRESS_LZF:
             $this->payload = lzf_decompress($this->payload);
             break;
         case self::COMPRESS_OFF:
         default:
             //anything but known values result in OFF
             break;
     }
     return true;
 }
开发者ID:openlss,项目名称:lib-xport,代码行数:19,代码来源:Stream.php


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