Horde_Compress_Fast::decompress PHP Method

decompress() public method

Decompresses a string.
public decompress ( string $text ) : string
$text string The compressed string.
return string The decompressed string.
    public function decompress($text)
    {
        if (!is_scalar($text) && !is_null($text)) {
            throw new Horde_Compress_Fast_Exception('Data to decompress must be a string.');
        }
        return $this->_compress->decompress(strval($text));
    }

Usage Example

Ejemplo n.º 1
0
Archivo: Pack.php Proyecto: horde/horde
 /**
  * Unpack a string.
  *
  * @param string $data  The packed string.
  *
  * @return mixed  The unpacked data.
  * @throws Horde_Pack_Exception
  */
 public function unpack($data)
 {
     if (!$data) {
         return $data;
     }
     if (is_string($data)) {
         $mask = unpack('C*', $data[0]);
         $mask = reset($mask);
         $data = substr($data, 1);
         if ($mask & self::COMPRESS_MASK) {
             $data = self::$_compress->decompress($data);
             $mask ^= self::COMPRESS_MASK;
         }
         if (isset(self::$_drivers[$mask])) {
             try {
                 return self::$_drivers[$mask]->unpack($data);
             } catch (Horde_Pack_Exception $e) {
                 throw $e;
             } catch (Exception $e) {
                 /* Unknown exceptions are handled with the throw below. */
             }
         }
     }
     throw new Horde_Pack_Exception('Could not unpack data');
 }
All Usage Examples Of Horde_Compress_Fast::decompress