瀏覽代碼

Allowing the base path used by the build_bootstrap.php script to be configurable as an argument

This is especially useful if your entire Symfony vendor directory is a sunlink. The hardcoded path in build_bootstrap.php means that the target directory is actually the parent directory of where vendor directory symlink target is, not the actual project. This causes the bootstrap files to be built in the wrong directory.
Ryan Weaver 13 年之前
父節點
當前提交
dc8a195574
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. 9 2
      Resources/bin/build_bootstrap.php

+ 9 - 2
Resources/bin/build_bootstrap.php

@@ -10,8 +10,15 @@
  * file that was distributed with this source code.
  */
 
-if (!$baseDir = realpath(__DIR__.'/../../../../../../..')) {
-    exit('Looks like you don\'t have a standard layout.');
+$argv = $_SERVER['argv'];
+
+// allow the base path to be passed as the first argument, or default
+if (isset($argv[1])) {
+    $baseDir = $argv[1];
+} else {
+    if (!$baseDir = realpath(__DIR__.'/../../../../../../..')) {
+        exit('Looks like you don\'t have a standard layout.');
+    }
 }
 
 require_once $baseDir.'/vendor/symfony/src/Symfony/Component/ClassLoader/UniversalClassLoader.php';