當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。