File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/StimulusBundle/src/Ux Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 11
11
12
12
namespace Symfony \UX \StimulusBundle \Ux ;
13
13
14
+ use Composer \InstalledVersions ;
15
+
14
16
/**
15
17
* @internal
16
18
*
@@ -28,7 +30,12 @@ public function readPackageMetadata(string $packageName): UxPackageMetadata
28
30
{
29
31
// remove the '@' from the name to get back to the PHP package name
30
32
$ phpPackageName = substr ($ packageName , 1 );
31
- $ phpPackagePath = $ this ->projectDir .'/vendor/ ' .$ phpPackageName ;
33
+ if (class_exists (InstalledVersions::class) && InstalledVersions::isInstalled ($ phpPackageName )) {
34
+ $ phpPackagePath = InstalledVersions::getInstallPath ($ phpPackageName );
35
+ } else {
36
+ $ phpPackagePath = $ this ->projectDir .'/vendor/ ' .$ phpPackageName ;
37
+ }
38
+
32
39
if (!is_dir ($ phpPackagePath )) {
33
40
throw new \RuntimeException (sprintf ('Could not find package "%s" referred to from controllers.json. ' , $ phpPackageName ));
34
41
}
You can’t perform that action at this time.
0 commit comments