]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Explicitly check for cURL in "arc"
authorepriestley <git@epriestley.com>
Mon, 7 May 2012 13:06:38 +0000 (06:06 -0700)
committerepriestley <git@epriestley.com>
Mon, 7 May 2012 13:06:38 +0000 (06:06 -0700)
Summary: We do this in Windows, but it's not available by default in Ubuntu

Test Plan: Ran "arc" after faking the function name, got a reasonable error.

Reviewers: btrahan, jungejason

Reviewed By: btrahan

CC: aran
Differential Revision: https://secure.phabricator.com/D2404

scripts/arcanist.php

index 96e42d56f87b9e6252822ba2bde89b684bf4e5f1..f73fdc297b209e0d76893351e96999bb6eab572c 100755 (executable)
@@ -332,7 +332,12 @@ function sanity_check_environment() {
     );
   } else {
     $need_functions = array(
-      'json_decode'   => array('flag',        '--without-json'),
+      'curl_init'     => array(
+        'text',
+        "You need to install the cURL PHP extension, maybe with ".
+        "'apt-get install php5-curl' or 'yum install php53-curl' or ".
+        "something similar."),
+      'json_decode'   => array('flag', '--without-json'),
     );
   }
 
@@ -378,6 +383,11 @@ function sanity_check_environment() {
         "'extension={$which}'.";
     }
 
+    if ($what == 'text') {
+      $generic = false;
+      $problems[] = $which;
+    }
+
     if ($generic) {
       $problems[] =
         "This build of PHP is missing the required function '{$fname}()'. ".