Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/requeststream/AphrontRequestStream.php
| Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | if ($encoding === 'gzip') { | ||||
| 'zlib.inflate', | 'zlib.inflate', | ||||
| $encoding)); | $encoding)); | ||||
| } | } | ||||
| } | } | ||||
| return $stream; | return $stream; | ||||
| } | } | ||||
| public static function supportsGzip() { | |||||
| if (!function_exists('gzencode') || !function_exists('gzdecode')) { | |||||
| return false; | |||||
| } | |||||
| $has_zlib = false; | |||||
| // NOTE: At least locally, this returns "zlib.*", which is not terribly | |||||
| // reassuring. We care about "zlib.inflate". | |||||
| $filters = stream_get_filters(); | |||||
| foreach ($filters as $filter) { | |||||
| if (preg_match('/^zlib\\./', $filter)) { | |||||
| $has_zlib = true; | |||||
| } | |||||
| } | |||||
| return $has_zlib; | |||||
| } | |||||
| } | } | ||||