]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Improve management of zlib dependency
authorepriestley <git@epriestley.com>
Tue, 21 Aug 2012 00:26:42 +0000 (17:26 -0700)
committerepriestley <git@epriestley.com>
Tue, 21 Aug 2012 00:26:42 +0000 (17:26 -0700)
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

scripts/lib/PhutilLibraryMapBuilder.php
scripts/php_extension_functions.txt
src/parser/ArcanistBundle.php

index 139814858e5b186217bf9486d31cbc802247f30c..08646a2c19612fab80abe1ff65b544d2d1d82b80 100755 (executable)
@@ -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  )---------------------------------------- */
index b4026c09416e9372c125a491361dfddf11da006c..12170be106bbea347e14bc8a05a5a830bea7004b 100644 (file)
@@ -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
index e52a9352ae099b3e94991feb159fe59aaa26092b..ab9faa8e4ceef360bf040707c39d09fe5c138a43 100644 (file)
@@ -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 = '';