From: epriestley Date: Tue, 21 Aug 2012 00:26:42 +0000 (-0700) Subject: Improve management of zlib dependency X-Git-Tag: conduit-6~151 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=29ba92c0c257bdea55e0274a364d9d05459281ae;p=arcanist.git Improve management of zlib dependency Summary: - Add zlib functions to extension functions. - Provide a better error if the extension is actually missing. Test Plan: Eyeballed it. Reviewers: vrana, btrahan Reviewed By: btrahan CC: Korvin, aran Differential Revision: https://secure.phabricator.com/D3321 --- diff --git a/scripts/lib/PhutilLibraryMapBuilder.php b/scripts/lib/PhutilLibraryMapBuilder.php index 13981485..08646a2c 100755 --- a/scripts/lib/PhutilLibraryMapBuilder.php +++ b/scripts/lib/PhutilLibraryMapBuilder.php @@ -37,7 +37,7 @@ final class PhutilLibraryMapBuilder { const LIBRARY_MAP_VERSION = 2; const SYMBOL_CACHE_VERSION_KEY = '__symbol_cache_version__'; - const SYMBOL_CACHE_VERSION = 7; + const SYMBOL_CACHE_VERSION = 8; /* -( Mapping libphutil Libraries )---------------------------------------- */ diff --git a/scripts/php_extension_functions.txt b/scripts/php_extension_functions.txt index b4026c09..12170be1 100644 --- a/scripts/php_extension_functions.txt +++ b/scripts/php_extension_functions.txt @@ -51,6 +51,26 @@ curl_share_init curl_share_setopt curl_unescape curl_version +gzrewind +gzclose +gzeof +gzgetc +gzgets +gzgetss +gzread +gzopen +gzpassthru +gzseek +gztell +gzwrite +gzputs +gzfile +gzcompress +gzuncompress +gzdeflate +gzinflate +gzencode +gzdecode image2wbmp image_type_to_extension image_type_to_mime_type diff --git a/src/parser/ArcanistBundle.php b/src/parser/ArcanistBundle.php index e52a9352..ab9faa8e 100644 --- a/src/parser/ArcanistBundle.php +++ b/src/parser/ArcanistBundle.php @@ -655,6 +655,13 @@ final class ArcanistBundle { } private function emitBinaryDiffBody($data) { + if (!function_exists('gzcompress')) { + throw new Exception( + "This patch has binary data. The PHP zlib extension is required to ". + "apply patches with binary data to git. Install the PHP zlib ". + "extension to continue."); + } + // See emit_binary_diff_body() in diff.c for git's implementation. $buf = '';