Преглед на файлове

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';