File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -44,8 +44,15 @@ public function getInstallPath(PackageInterface $package)
4444 }
4545 }
4646
47- // 2️⃣ Read from dependent packages (like moox/press)
48- if (!$ installationDir ) {
47+ // 2️⃣ Read from dependent packages (like moox/press) - SAFE version
48+ if (
49+ !$ installationDir &&
50+ $ this ->composer &&
51+ method_exists ($ this ->composer , 'getRepositoryManager ' ) &&
52+ $ this ->composer ->getRepositoryManager () &&
53+ method_exists ($ this ->composer ->getRepositoryManager (), 'getLocalRepository ' ) &&
54+ $ this ->composer ->getRepositoryManager ()->getLocalRepository ()
55+ ) {
4956 foreach ($ this ->composer ->getRepositoryManager ()->getLocalRepository ()->getPackages () as $ pkg ) {
5057 $ pkgExtra = $ pkg ->getExtra ();
5158 if (!empty ($ pkgExtra ['wordpress-install-dir ' ])) {
You can’t perform that action at this time.
0 commit comments