SFAPIclient/Requests.php
protected static function decompress($data) {
		if (substr($data, 0, 2) !== "\x1f\x8b") {
			// Not actually compressed. Probably cURL ruining this for us.
			return $data;
		}

		if (function_exists('gzdecode') && ($decoded = gzdecode($data)) !== false) {
			return $decoded;
		}
		elseif (function_exists('gzinflate') && ($decoded = @gzinflate($data)) !== false) {
			return $decoded;
		}
		elseif (($decoded = self::compatible_gzinflate($data)) !== false) {
			return $decoded;
		}
		elseif (function_exists('gzuncompress') && ($decoded = @gzuncompress($data)) !== false) {
			return $decoded;
		}

		return $data;
	}
protected static function decompress($data) {
		if (substr($data, 0, 2) !== "\x1f\x8b") {
			// Not actually compressed. Probably cURL ruining this for us.
			return $data;
		}

		if (function_exists('gzdecode') && ($decoded = gzdecode($data)) !== false) {
			return $decoded;
		}
		elseif (function_exists('gzinflate') && ($decoded = @gzinflate($data)) !== false) {
			return $decoded;
		}
		elseif (($decoded = self::compatible_gzinflate($data)) !== false) {
			return $decoded;
		}
		elseif (function_exists('gzuncompress') && ($decoded = @gzuncompress($data)) !== false) {
			return $decoded;
		}

		return $data;
	}
protected static function decompress ( $ data ) { if ( substr ( $ data , 0 , 2 ) !== "\x1f\x8b" ) { // Not actually compressed. Probably cURL ruining this for us. return $ data ; } if ( function_exists ( 'gzdecode' ) && ( $ decoded = gzdecode ( $ data ) ) !== false ) { return $ decoded ; } elseif ( function_exists ( 'gzinflate' ) && ( $ decoded = @ gzinflate ( $ data ) ) !== false ) { return $ decoded ; } elseif ( ( $ decoded = self :: compatible_gzinflate ( $ data ) ) !== false ) { return $ decoded ; } elseif ( function_exists ( 'gzuncompress' ) && ( $ decoded = @ gzuncompress ( $ data ) ) !== false ) { return $ decoded ; } return $ data ; }
Decompress an encoded body

Implements gzip, compress and deflate. Guesses which it is by attempting
to decode.

@todo Make this smarter by defaulting to whatever the headers say first
@param string $data Compressed data in one of the above formats
@return string Decompressed string
Decompress an encoded body