webkernel/lifecycle

Supported Events

On this page

LCEventTarget defines the script event names accepted under extra.webkernel.lifecycle.events. A string or a non-empty callback list is required for every declared event.

Script events

Event namePhase
pre-install-cmdBefore install with a lock file.
post-install-cmdAfter install with a lock file.
pre-update-cmdBefore update, including install without a lock file.
post-update-cmdAfter update, including install without a lock file.
pre-autoload-dumpBefore autoloader generation.
post-autoload-dumpAfter autoloader generation.
post-root-package-installRoot installation during project creation, before dependency installation.
post-create-project-cmdAfter project creation.

Events only reach Lifecycle when its plugin is loaded and active. In particular, a project-local plugin cannot observe a creation or pre-install event that occurred before the plugin was available. See Composer's event documentation for event timing.

Script callbacks receive Composer\Script\Event when their target declares a parameter. StandardLCEvent wraps this object for run(). The LCEventTarget enum's string value and extraKey() result are the exact manifest event name.

Package operation subscriptions

The plugin also subscribes to these package operation events:

BeforeAfter
pre-package-installpost-package-install
pre-package-updatepost-package-update
pre-package-uninstallpost-package-uninstall

These subscriptions invalidate cached declarations and report recognized Webkernel package operations. They are internal subscriptions, not accepted keys in the lifecycle events object. Their Composer event type is Composer\Installer\PackageEvent.

Ordering

PhaseCurrent order
Event callbackswebkernel/codebase, then other package names alphabetically; list order within each package.
ChecksRoot discovery first, then Composer's installed repository order; list order within each package.
ActionsEmpty-name entry if present, then webkernel/codebase, then other names alphabetically; list order within each package.

A named root package is included by name in event/action sorting. The declaration format has no priority or dependency-order field. Declaring the same work in multiple places can invoke it multiple times.

See Composer Events for callback forms and invocation rules.