- Does this plugin work with Laravel 9+ and Composer 2.x?
- The plugin officially supports Composer 1.x and may not work out-of-the-box with Composer 2.x due to API changes. Test it in a staging environment first, especially if using Laravel 9+. If it fails, consider a custom Composer script or Laravel command as a fallback.
- How does the plugin mark the app as 'updating'? Is it file-based or database-backed?
- The plugin uses a file-based mechanism to store the 'updating' flag (likely in a temporary directory). This avoids database dependencies but could cause race conditions in CI/CD pipelines. For Laravel, you might need to integrate it with the filesystem disk for consistency.
- Can I trigger Laravel events (e.g., UpdatingStarted) when Composer runs?
- The plugin itself doesn’t emit Laravel events, but you can bridge it by creating a custom Laravel command or post-update-cmd script that checks the plugin’s flag and dispatches events like `UpdatingStarted`. This requires minimal setup.
- What happens if Composer fails mid-update? Will the app stay locked indefinitely?
- The plugin doesn’t include a timeout or auto-reset mechanism, so the 'updating' flag may persist if Composer crashes. Add a TTL (e.g., delete the lock file after 5 minutes) or a manual reset command to handle this.
- Is this plugin safe for production? Will it block legitimate traffic during updates?
- Yes, the plugin is designed to block access during Composer operations, which is ideal for production. Pair it with a reverse proxy (e.g., Nginx) or Laravel middleware to redirect users to a maintenance page while the lock is active.
- How do I install and configure this in a Laravel project?
- Install via Composer: `composer require ebitkov/app-lock-composer-plugin`. No additional configuration is needed—it hooks into Composer’s lifecycle automatically. For Laravel integration, add a post-update-cmd script in `composer.json` to handle the lock state.
- Will this work with PHP 8.x and typed properties?
- The plugin’s core functionality should work on PHP 8.x, but its downgraded Composer dependencies (1.0.1) may limit access to newer PHP features. Test it in your environment, especially if using modern Laravel features like typed properties.
- Are there alternatives if this plugin doesn’t fit my stack?
- For Composer 2.x/Laravel 9+ projects, consider a custom Composer script or a Laravel package like `spatie/laravel-maintenance-mode` (for blocking traffic) combined with a post-update hook. Alternatively, use `composer-exec` to run scripts during updates.
- How do I test this plugin before deploying to production?
- Simulate a Composer update in a staging environment with `composer update --dry-run` and verify the lock file is created. Test edge cases like interrupted updates or concurrent Composer runs to ensure the flag behaves as expected.
- Who maintains this plugin, and is it actively updated for Laravel 10+?
- The plugin is maintained by ebitkov, but its compatibility with newer Laravel/Composer versions isn’t guaranteed. Monitor the GitHub repo for updates or fork it to add Composer 2.x support. For long-term reliability, consider a custom solution if critical.