timegryd/opcache-reset-bundle
A Symfony bundle for resetting PHP OPcache, exposing simple endpoints and console commands so you can clear cached bytecode after deployments without restarting PHP-FPM.
Architecture fit. The package addresses an infrastructure concern, not an application concern: invalidating OPcache so PHP picks up changed files after a deploy. In the Laravel ecosystem this is normally handled out-of-band by php-fpm reload/SIGUSR2, a deployment hook, or a guarded endpoint calling opcache_reset(). A CLI wrapper is a thin facade over a single built-in function, which makes the package low-value to integrate and easy to reproduce. The naming (...Bundle) also signals Symfony conventions, not Laravel — Laravel does not have bundles, and there is no reason to expect a service provider, config publishing, or facade. Treat this as a Symfony component that would need an adapter layer.
Integration feasibility. Technically trivial — the underlying capability is one function call. The real question is whether the package's release/command contract is worth adopting versus writing a 15-line Artisan command. Given zero stars and zero dependents, there is no ecosystem validation to lean on.
Technical risk. The critical risk is semantic, not code quality. opcache_reset() only clears the OPcache shared memory segment owned by the SAPI process that invokes it. If the package's CLI command runs under the CLI SAPI (where opcache.enable_cli is typically 0), it will either be a no-op or reset an isolated segment that the FPM workers never see. The command may report success while the deployed code remains stale — the worst class of failure for a deploy tool. Secondary risks: exposing a reset trigger without authentication is a trivial CPU-exhaustion/DoS vector; the package is unmaintained, so supply-chain and PHP-version drift are unmanaged.
Key questions.
cachetool, use opcache_reset(), or reload the FPM master?Stack fit. Poor. A Symfony bundle dropped into a Laravel stack adds a dependency for capability Laravel can express natively. The pragmatic Laravel-native equivalent is a small Artisan command (or a signed, auth-guarded route) that calls opcache_reset() inside the FPM worker, plus a php-fpm reload in the deploy pipeline for cold-start correctness.
Migration path. If the team wants the package's CLI ergonomics, wrap it rather than depend on it: vendor or fork the command, reimplement as an Artisan command, and keep the interface (opcache:reset) stable so deploy scripts do not care which implementation sits behind it. This yields the same operator experience with none of the abandonment risk.
Compatibility. Validate against the actual runtime matrix before committing: PHP version (7.4/8.x), opcache.enable and opcache.enable_cli settings, FPM vs. Apache mod_php vs. CLI, and whether OPcache is even enabled in production. On containerized platforms (Kubernetes), the package has no concept of a fleet — each pod must be targeted individually, so a rollout restart is usually the correct primitive instead.
Sequencing.
Maintenance. Effectively zero upstream maintenance. Zero stars, zero dependents, zero score means no community to absorb PHP upgrades or security reports. Owning a forked copy is the only durable option, at which point the package is no longer a dependency but internal code — which is the honest framing.
Support. No vendor, no issue-tracker activity to rely on. Any incident involving OPcache invalidation will be diagnosed entirely in-house, and OPcache staleness is a notoriously confusing failure mode for on-call engineers.
Scaling. The weakest dimension. Reset is per-process/per-host; the package offers no fleet orchestration. At N app servers, the deploy pipeline must fan out the reset or perform a rolling reload. In autoscaled environments, new instances bypass the problem while long-lived instances retain stale bytecode — an inconsistent-fleet failure that is hard to observe.
Failure modes.
opcache.enable_cli=0) — highest likelihood, highest severity.Ramp-up. Developer ramp-up is near zero — the command surface is a single verb. Operational ramp-up is the cost: the team must understand OPcache's shared-memory model, SAPI boundaries, and deploy-time invalidation semantics to use this safely. That knowledge, not the package, is the actual deliverable.
Recommendation. Do not adopt as a dependency. The capability is one function call; the package's only differentiated value is a CLI wrapper, and it carries abandonment risk plus a misleading-success failure mode that is worse than the problem it solves. Build a small in-house Artisan command, pair it with an FPM reload in the deploy pipeline, and treat this repository as a reference implementation at most.
How can I help you explore Laravel packages today?