Skip to content

v5.0.1

Choose a tag to compare

@TimurTurdyev TimurTurdyev released this 27 May 21:41
· 11 commits to main since this release

Bug Fix

Fix: SettingStorage::all() returns __PHP_Incomplete_Class instead of Collection when using the database cache driver (CACHE_STORE=database).

Root Cause

  1. Cross-request: all() cached a Collection object. The database cache driver uses serialize() — on unserialize() in the next request, if Collection isn't autoloaded yet, PHP returns __PHP_Incomplete_Class.

  2. Within-request: flushCache() used Cache::forget() which only clears the persistent store, leaving the MemoizedStore in-memory layer stale.

Changes

  • all() now caches a plain array (->toArray()) and wraps in collect() on read
  • flushCache() now uses Cache::memo()->forget() to clear both layers
  • Self-healing guard for legacy cached values

Upgrade

No breaking changes. composer update timurturdyev/simple-settings