Skip to content

fix: report the discovery cache from the framework's cache manager - #26

Merged
ogorzalka merged 1 commit into
mainfrom
fix/discovery-cache-status
Oct 14, 2026
Merged

ogorzalka merged 1 commit into
mainfrom
fix/discovery-cache-status

Conversation

@ogorzalka

Copy link
Copy Markdown
Member

pollora_status answered discovery_cached: false on every site: it checked Cache::has('pollora-discoverer-cache-discovery'), a key the framework no longer writes (scans are cached by Spatie's driver under the pollora prefix, one entry per location).

It now asks the framework's DiscoveryCacheManager, as pollora:doctor does: true when the persistent cache is on and holds every class on disk, false in debug mode, when a location was never cached, or when a class added since is missing (what discovery:clear fixes). Frameworks before 13.34, which have neither method, answer false.

The old test asserted that the word false appeared somewhere in the response; the new ones cover each case, and the "cached" case fails on the previous code.

Pest 81/81, PHPStan, Pint, Rector clean.

pollora_status looked for a cache key the framework stopped writing, so
discovery_cached was always false. It now asks DiscoveryCacheManager, as
pollora:doctor does.
@ogorzalka
ogorzalka force-pushed the fix/discovery-cache-status branch from cfbf640 to 4804053 Compare October 13, 2026 17:18
@ogorzalka
ogorzalka merged commit c216951 into main Oct 14, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant