webkernel/lifecycle

Composer and Lifecycle

On this page

Composer owns the dependency graph. Lifecycle adds a declaration format and execution rules inside that workflow.

Responsibility map

ConcernOwner
Dependency resolution, downloads and lock-file updatesComposer.
Package installation, updates and removalComposer, using registered installers.
Generated autoload files and installed-package metadataComposer.
Permission to activate a pluginThe root project's config.allow-plugins.
extra.webkernel validation and callback dispatchLifecycle.
Supported Webkernel install destinationsLifecycle's installer.
Application-specific generated contentThe package declaring the action.

Why declarations live in package manifests

A package can describe the work it needs under extra.webkernel.lifecycle. Lifecycle gathers these declarations across the installed package set. You do not need to copy every dependency's callbacks into the root project's scripts section.

Composer's native scripts execution is rooted in the consuming project. Lifecycle explicitly reads dependency declarations through its plugin. Both mechanisms can coexist. See Composer's script documentation for the native event model.

Metadata changes

ChangeWhat to do
A lifecycle declaration in an installed symlinked path packageRun the relevant Composer command again. Its current installed manifest is read for declarations.
require, versions or other dependency metadataUpdate the affected package through Composer so the lock and installed metadata agree.
PSR-4 prefixes, class paths or autoload.filesRefresh the package metadata as needed, then regenerate the consuming project's autoloader.
An application runtime configuration fileFollow the application's own configuration/cache workflow.

Reading a live manifest for lifecycle declarations does not turn Composer dependency metadata into a live configuration system. Class-reference prefixes come from Composer's package autoload metadata.

Plugin activation

Activation enables optimized and APCu autoloader settings in the current Composer configuration, resolves the project base path and registers the installer. Composer generates the maps; APCu support depends on the PHP process. These activation settings do not install extensions or rewrite the application's composer.json.

For plugin permission, see Composer's allow-plugins configuration.

Next step

Read Composer-time and Runtime before choosing where to put a task.