mirror of
https://github.com/flarum/core.git
synced 2025-10-13 07:54:25 +02:00
Introduce a vendor path
This lets us or anyone modify the path from where dependencies (usually installed into /vendor by Composer) are loaded. We need to be able to tweak this in our integration tests, where the application code under test needs access to certain dependencies.
This commit is contained in:
@@ -67,11 +67,11 @@ class ExtensionManager
|
||||
*/
|
||||
public function getExtensions()
|
||||
{
|
||||
if (is_null($this->extensions) && $this->filesystem->exists($this->app->basePath().'/vendor/composer/installed.json')) {
|
||||
if (is_null($this->extensions) && $this->filesystem->exists($this->app->vendorPath().'/composer/installed.json')) {
|
||||
$extensions = new Collection();
|
||||
|
||||
// Load all packages installed by composer.
|
||||
$installed = json_decode($this->filesystem->get($this->app->basePath().'/vendor/composer/installed.json'), true);
|
||||
$installed = json_decode($this->filesystem->get($this->app->vendorPath().'/composer/installed.json'), true);
|
||||
|
||||
foreach ($installed as $package) {
|
||||
if (Arr::get($package, 'type') != 'flarum-extension' || empty(Arr::get($package, 'name'))) {
|
||||
@@ -326,6 +326,6 @@ class ExtensionManager
|
||||
*/
|
||||
protected function getExtensionsDir()
|
||||
{
|
||||
return $this->app->basePath().'/vendor';
|
||||
return $this->app->vendorPath();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user