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()
46
46
if (file_exists ($ appAutoLoader )) {
47
47
require $ appAutoLoader ;
48
48
} else {
49
- require ' ./vendor /autoload.php ' ;
49
+ require $ this -> getVendorDir (). ' /autoload.php ' ;
50
50
}
51
51
52
52
// environment loading as of Symfony 3.3
@@ -90,6 +90,20 @@ public function getApplication()
90
90
91
91
return $ app ;
92
92
}
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
+ }
93
107
94
108
/**
95
109
* Does some necessary preparation before each request.
You can’t perform that action at this time.
0 commit comments