Custom Installer and moving (temporary?) files from vcs repositories within vendor/ #11365
-
Hi! I'm creating my own custom installer. I have multiple helper composer packages that contain skeleton files that I can merge into a composer project. These skeleton files are scattered throughout a project (i.e. in My idea was to make each composer package define a set of "move rules" within their respective composer.json files, i.e.:
My custom installer would then iterate this That worked flawlessly when I had my packages inside the repository as a simple I debugged this happens because within the How would I make my custom installer know this actual directory location? I cannot seem to find any API method like I do know that https://github.com/composer/installers/blob/main/src/Composer/Installers/BaseInstaller.php uses So my hope is that actually I can get a packages' temporary location at the time where (I only worked with custom composer installers for the better of a day, so please excuse me if I missed a thing. Sadly the docs in https://getcomposer.org/doc/articles/custom-installers.md are rather brief and missing actual examples. If anyone can point me into a direction, I'd love to help improving the documentation for this!) Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
OK, so I had to take a deep dive into promises. I found my mistake. I implemented the install/update methods like this:
which is pretty wrong of course; my unpackage() method passed on the $return value of the parent method, but it seems the code contained in said return promise was not executed. So I figured the correct way would need to be:
So first the parent method is called, and append to its promise, my custom unpackaging script gets called. Regards, |
Beta Was this translation helpful? Give feedback.
OK, so I had to take a deep dive into promises. I found my mistake.
I implemented the install/update methods like this:
which is pretty wrong of course; my unpackage() method passed on the $return value of the parent method, but it se…