ebitkov/app-lock-composer-plugin
Composer plugin for Laravel/PHP apps that marks the application as “updating” while Composer runs, helping prevent access or inconsistent state during dependency updates.
Use Case Alignment: The plugin’s core functionality—marking an app as "updating" during Composer operations—remains niche but aligns with deployment workflows requiring state awareness (e.g., CI/CD pipelines, rollback triggers, or feature flag coordination). The downgraded Composer dependency requirements (now compatible with older versions) broaden its applicability to legacy systems but do not fundamentally alter its niche focus. Key considerations:
post-update-cmd scripts or custom events).Updated Dependency Context:
The downgraded composer and composer-api requirements (1.0.1) reduce version conflicts but introduce potential compatibility risks with modern Composer 2.x+ setups. This may limit adoption in newer Laravel projects (v9+) unless explicitly tested.
Composer Plugin Integration: The plugin’s simplicity and Composer hook-based design remain low-friction, but the downgraded dependencies introduce trade-offs:
config.platform.check changes).post-update-cmd scripts, but testing is required for Composer 2.x compatibility.Customization Limits: The plugin’s minimalism persists, with no new configurability in 1.0.1. Critical questions remain:
Illuminate\Events consume the plugin’s state? If not, a custom bridge (e.g., a Laravel command reading the plugin’s flag) is needed.vendor/laravel/framework updates).getConfig() vs. getPackage()). Test with:
composer update --platform-check --no-plugins
file_put_contents with LOCK_EX).filesystem disk for consistency.UpdatingStarted) without custom scripts? If not, what’s the minimal bridge required?php artisan update:lock).Composer-Centric: The plugin remains 100% compatible with PHP/Composer stacks but now explicitly targets older versions. For Laravel projects:
composer.json config.platform.check adjustment.post-update-cmd scripts calling Laravel Artisan commands.Tooling Synergy:
spatie/laravel-package-tools or custom scripts).# Composer 1.x
composer require ebitkov/app-lock-composer-plugin:^1.0.1
composer update --verbose
# Composer 2.x (if supported)
composer update --platform-check
composer.json with a conditional allow-plugins rule:
{
"config": {
"allow-plugins": {
"ebitkov/app-lock-composer-plugin": true
}
}
}
AppServiceProvider to watch the plugin’s state file (e.g., storage/app/.composer-updating) and dispatch events.# composer.json
"scripts": {
"post-update-cmd": [
"php artisan update:lock",
"@php artisan optimize"
]
}
app/Console/Commands/UpdateLock.php:
public function handle()
{
file_put_contents(storage_path('.composer-updating'), 'locked');
}
composer.json config block to override platform checks.getConfig()).storage/ is writable).env, ensure Laravel’s .env is loaded before Composer runs (unlikely, but possible in custom setups).composer.json hooks for conflicts.composer.json config to suppress platform checks:
"config": {
"platform-check": false,
"allow-plugins": { "ebitkov/app-lock-composer-plugin": true }
}
php artisan check:update-lock) to verify state consistency.composer.json to avoid surprises.How can I help you explore Laravel packages today?