These are chat archives for composer/composer

18th
Oct 2016
Screaming Dev
@ScreamingDev_twitter
Oct 18 2016 09:20
Hello :) What script is triggered when a package is installed? I tried "post-package-install" but it didn't work. I have a project which load a package. Within this package there shall be a script executed after it has been installed. How do I do that?
Rob
@alcohol
Oct 18 2016 09:20
install only triggers when installing from lockfile
also, scripts dont trigger for dependencies
only for root project
when adding a dependency, or installing without a lock file, all events are post-update, not post-install
Screaming Dev
@ScreamingDev_twitter
Oct 18 2016 09:22
So the post-package-install is not fired when I install a new dependency? Or more specific: The package itself won't be noticed, right? But post-update will be passed thru?
Rob
@alcohol
Oct 18 2016 09:23
when you install a new dependency, it will trigger post-update script events that belong to the project to which you added the dependency, it ignores any script events that the dependency declares
Screaming Dev
@ScreamingDev_twitter
Oct 18 2016 09:25
Damn it. There is a file within the plugin which shall be transferred to a specific place within the project. :/ I guess my package needs to bring his own installer
Rob
@alcohol
Oct 18 2016 09:25
it sounds more like your package is just bad
files should not need to be moved
Screaming Dev
@ScreamingDev_twitter
Oct 18 2016 09:26
Yes, WordPress is bad ;D It forces me to do stuff I never wanted
Rob
@alcohol
Oct 18 2016 09:26
oh, wordpress.
good luck.
Screaming Dev
@ScreamingDev_twitter
Oct 18 2016 09:27
Yep. Everything is a workaround :P So it will be this time. Thanks anyway, now I understand the events a bit better.