Download the PHP package osumionline/plugin-updater without Composer
On this page you can find all versions of the php package osumionline/plugin-updater. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download osumionline/plugin-updater
More information about osumionline/plugin-updater
Files in osumionline/plugin-updater
Package plugin-updater
Short Description Osumi Framework Composer plugin to run core migrations after framework updates.
License MIT
Informations about the package plugin-updater
Osumi Framework Updater Plugin
Composer plugin used by Osumi Framework to automatically execute framework migrations after Composer updates.
Purpose
osumionline/plugin-updater acts as the bridge between Composer and the migration system included in Osumi Framework.
The plugin itself does not contain application migrations.
Its responsibility is limited to:
- Detecting updates of the
osumionline/frameworkpackage. - Running after Composer has regenerated the autoloader.
- Detecting the currently installed Osumi Framework version.
- Calling the framework migration runner when available.
- Passing Composer-related execution options to the migration system.
All migration definitions, transformations, rollback handling and migration state are implemented by Osumi Framework itself.
Requirements
- PHP 8.5 or newer.
- Composer 2.x.
composer-plugin-api2.x.
Installation
The plugin is intended to be installed as a dependency of Osumi Framework.
It can also be installed manually with Composer:
Because this package is a Composer plugin, Composer must explicitly allow it to execute.
Add the following configuration to the root composer.json of the application:
Composer may also ask interactively whether the plugin should be trusted when it is installed for the first time.
How it works
During a Composer operation, the plugin listens for framework package updates and for the post-autoload-dump event.
When the Composer autoloader has been rebuilt, the plugin checks whether the Osumi Framework migration runner is available.
If available, it invokes:
The migration runner then determines which migrations still need to be executed using the migration state maintained by Osumi Framework.
This also allows migrations to run when the updater plugin itself is installed during the same Composer operation as a framework update.
If the installed framework version does not provide a migration runner, the plugin simply does nothing.
Migration state
Migration state is managed entirely by Osumi Framework.
The updater does not decide which migration steps have already been applied. It delegates that responsibility to the framework migration runner.
This makes the migration state authoritative even when:
- several framework versions are skipped during an update;
- the updater plugin is installed for the first time;
- Composer triggers more than one autoload event;
- no explicit framework update event was captured.
Git working tree protection
Osumi Framework migrations normally require a clean Git working tree.
During a Composer update, however, Composer may legitimately modify:
The updater explicitly allows those two files to be dirty when invoking the framework migration runner.
Changes to application source files or other project files are not ignored and continue to be protected by the framework migration safety checks.
Configuration
Optional updater behavior can be configured through the root application's composer.json:
Currently supported plugin option:
verbose: enables additional migration information during Composer operations.
Additional values inside extra.ofw are forwarded to the framework migration system through its extra options.
Environment variables
The following environment variables are supported:
OFW_DRY_RUN
Runs pending migrations in dry-run mode.
No migration changes are persisted.
OFW_FORCE
Bypasses migration safety checks that support forced execution.
Use this option carefully.
OFW_VERBOSE
Enables verbose updater and migration output.
Accepted boolean values include:
and:
Manual migrations
The updater is intended for migrations triggered automatically by Composer.
Osumi Framework also provides its own command-line migration tool for manual execution:
For example:
The CLI belongs to Osumi Framework itself and is independent from this Composer plugin.
Architecture
The responsibilities are intentionally separated:
This keeps Composer-specific functionality outside the framework migration engine and prevents the core migration system from depending on Composer APIs.
Version
Current version:
License
This project is licensed under the MIT License.
Author
Iñigo Gorosabel Osumi
All versions of plugin-updater with dependencies
composer-plugin-api Version ^2.0