File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ public function getApplication()
4646 if (file_exists ($ appAutoLoader )) {
4747 require $ appAutoLoader ;
4848 } else {
49- require ' ./vendor /autoload.php ' ;
49+ require $ this -> getVendorDir (). ' /autoload.php ' ;
5050 }
5151
5252 // environment loading as of Symfony 3.3
@@ -90,6 +90,20 @@ public function getApplication()
9090
9191 return $ app ;
9292 }
93+
94+ /**
95+ * Returns the vendor directory containing autoload.php
96+ *
97+ * @return string
98+ */
99+ protected function getVendorDir ()
100+ {
101+ if (getenv ('COMPOSER_VENDOR_DIR ' ) && file_exists (getenv ('COMPOSER_VENDOR_DIR ' ))) {
102+ return getenv ('COMPOSER_VENDOR_DIR ' );
103+ } else {
104+ return './vendor ' ;
105+ }
106+ }
93107
94108 /**
95109 * Does some necessary preparation before each request.
You can’t perform that action at this time.
0 commit comments