diff --git a/CHANGELOG.md b/CHANGELOG.md index 2278e3c..b1ef092 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- The "Persistent Object Cache" guideline and the `pollora:object-cache:*` commands follow `pollora/object-cache` 0.3: the package ships with the framework from v13.43.3 (nothing to require), `pollora:object-cache:enable` is run again after an update from 0.1 or 0.2 (drop-in version 2), and the doctor check warns on a missing or foreign drop-in. + ## [1.9.0] - 2026-11-23 ### Added diff --git a/resources/boost/guidelines/core.blade.php b/resources/boost/guidelines/core.blade.php index eb05913..1b7f79f 100644 --- a/resources/boost/guidelines/core.blade.php +++ b/resources/boost/guidelines/core.blade.php @@ -158,7 +158,7 @@ class InternalHelper {} - `pollora:roles:list` / `pollora:roles:show {role}` — Roles with their origin; the effective capabilities of one role and where each comes from - `pollora:roles:prune` / `pollora:roles:import {role}` / `pollora:roles:dump` — Clean up roles removed from the code, turn a stored role into a `#[Role]` class, write the code's roles to the database; dry run unless `--force` - `pollora:binding:list` — Binding sources, their fields, and the blocks WordPress lets bind -- `pollora:object-cache:enable` / `:disable` / `:status` / `:flush` — Only with `pollora/object-cache` installed: copy or remove the `object-cache.php` drop-in (another object cache's drop-in is never replaced unless `enable --force`), show drop-in, phpredis, Redis and key prefix, empty this site's keys (never the Redis database) +- `pollora:object-cache:enable` / `:disable` / `:status` / `:flush` — `pollora/object-cache` ships with the framework from v13.43.3 (earlier: only when the package is installed): copy or remove the `object-cache.php` drop-in (another object cache's drop-in is never replaced unless `enable --force`), show drop-in, phpredis, Redis and key prefix, empty this site's keys (never the Redis database) - `discovery:run` / `discovery:clear` — Manage component discovery cache - `pollora:schedule:list` / `pollora:schedule:migrate` / `pollora:schedule:recover` — Scheduled events and the driver that keeps each (v13.36+); move them between drivers; send again the events a queue lost (`laravel` driver) - `pollora:status` — Show framework status diff --git a/resources/boost/guidelines/framework.blade.php b/resources/boost/guidelines/framework.blade.php index d1b6dbd..6339ac4 100644 --- a/resources/boost/guidelines/framework.blade.php +++ b/resources/boost/guidelines/framework.blade.php @@ -125,7 +125,7 @@ ### Persistent Object Cache -`pollora/object-cache` (0.1, not yet used in production, pin the version) keeps what WordPress caches in Redis between requests. It needs `ext-redis`; without it the drop-in defines nothing and WordPress keeps its own in-memory cache. Install it, then run `php artisan pollora:object-cache:enable` to copy the drop-in to `wp-content/object-cache.php`; installing alone changes nothing. The connection comes from Laravel's `database.redis` (connection `default`, not `cache`: `cache:clear` on a Redis cache store empties the whole database), the settings from `pollora.object-cache`. Every key carries a site prefix, so a flush empties this site only. `Cache::store('wordpress')` (`'driver' => 'wordpress'` in `config/cache.php`) reads and writes the same cache in the `laravel` group; `php artisan cache:clear` also empties the site's object cache unless `laravel.flush_with_cache_clear` is `false`. When Redis stops answering, reads miss and nothing throws. `pollora:doctor` suggests the package when phpredis is loaded and no drop-in persists the cache. +`pollora/object-cache` (0.3, not yet used in production) keeps what WordPress caches in Redis between requests. From v13.43.3 it ships with the framework: nothing to `composer require` (a project on an older Pollora installs it with Composer and needs v13.43.3 or later for the 0.3 package). It needs `ext-redis`; without it the drop-in defines nothing and WordPress keeps its own in-memory cache. Run `php artisan pollora:object-cache:enable` to copy the drop-in to `wp-content/object-cache.php`; the package changes nothing until then, and a project that had 0.1 or 0.2 runs it again to get the version 2 drop-in. The connection comes from Laravel's `database.redis` (connection `default`, not `cache`: `cache:clear` on a Redis cache store empties the whole database), the settings from `pollora.object-cache`. Every key carries a site prefix, so a flush empties this site only. `Cache::store('wordpress')` (`'driver' => 'wordpress'` in `config/cache.php`) reads and writes the same cache in the `laravel` group; `php artisan cache:clear` also empties the site's object cache unless `laravel.flush_with_cache_clear` is `false`. When Redis stops answering, reads miss and nothing throws. The package also runs outside Pollora (the `WP_OBJECT_CACHE_CONFIG` constant and `wp object-cache`): in a Pollora project only the `pollora.object-cache` settings and the Artisan commands apply. `pollora:doctor` warns when the drop-in is missing or belongs to another object cache. ### Extracted Packages diff --git a/tests/Feature/Guidelines/FrameworkGuidelinesTest.php b/tests/Feature/Guidelines/FrameworkGuidelinesTest.php index b38ebf5..728693b 100644 --- a/tests/Feature/Guidelines/FrameworkGuidelinesTest.php +++ b/tests/Feature/Guidelines/FrameworkGuidelinesTest.php @@ -43,6 +43,8 @@ public function render(string $path, array $data): string expect(renderFrameworkGuidelines(['polloraMajor' => 13])) ->toContain('### Persistent Object Cache') ->toContain("Cache::store('wordpress')") - ->toContain('pollora:object-cache:enable'); + ->toContain('pollora:object-cache:enable') + ->toContain('ships with the framework') + ->not->toContain('(0.1,'); expect(renderFrameworkGuidelines(['polloraMajor' => 12]))->not->toContain('### Persistent Object Cache'); });