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 1111
1212namespace Symfony \UX \StimulusBundle \Ux ;
1313
14+ use Composer \InstalledVersions ;
15+
1416/**
1517 * @internal
1618 *
@@ -28,7 +30,12 @@ public function readPackageMetadata(string $packageName): UxPackageMetadata
2830 {
2931 // remove the '@' from the name to get back to the PHP package name
3032 $ 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+
3239 if (!is_dir ($ phpPackagePath )) {
3340 throw new \RuntimeException (sprintf ('Could not find package "%s" referred to from controllers.json. ' , $ phpPackageName ));
3441 }
You can’t perform that action at this time.
0 commit comments