I assume you are now registered to the post-install
event. That only applies to the root package. You should register to the post-package-install
event instead.
Using this event, you get a PackageEvent
instance, which gives you access to the current operation (using PackageEvent#getOperation()
). The operation contains the current installed package:
use Composer\Script\PackageEvent;
class YourInstaller
{
public static function postPackageUpdate(PackageEvent $event)
{
$packageName = $event->getOperation()->getPackage()->getName();
// ... do something great
}
}