Przeglądaj źródła

Allow vendors checkout transport method to be overridden manually.

Drak 13 lat temu
rodzic
commit
86a8b9f567
1 zmienionych plików z 10 dodań i 0 usunięć
  1. 10 0
      vendors.php

+ 10 - 0
vendors.php

@@ -25,6 +25,12 @@ if (!is_dir($vendorDir = dirname(__FILE__).'/vendor')) {
     mkdir($vendorDir, 0777, true);
 }
 
+// optional transport change
+$transport = false;
+if (isset($argv[1]) && in_array($argv[1], array('--transport=http', '--transport=https', '--transport=git'))) {
+    $transport = preg_replace('/^--transport=(.*)$/', '$1', $argv[1]);
+}
+
 $deps = array(
     array('doctrine', 'http://github.com/doctrine/doctrine2.git', '2.1.2'),
     array('doctrine-dbal', 'http://github.com/doctrine/dbal.git', '2.1.3'),
@@ -36,6 +42,10 @@ $deps = array(
 
 foreach ($deps as $dep) {
     list($name, $url, $rev) = $dep;
+    
+    if ($transport) {
+        $url = preg_replace('/^(http:|https:|git:)(.*)/', $transport . ':$2', $url);
+    }
 
     echo "> Installing/Updating $name\n";