diff --git a/CHANGELOG.md b/CHANGELOG.md index e4f8b07..2278e3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.9.0] - 2026-11-23 + +### Added + +- The core guidelines list the `pollora:object-cache:enable`, `:disable`, `:status` and `:flush` commands of `pollora/object-cache`, the `--db=sqlite` option of `pollora:install` (development, CI and demos only), and the `pollora:doctor` checks that came with framework v13.43.2 (persistent object cache, SQLite, WordPress network). +- The framework guidelines of a Pollora 13 project have a "Persistent Object Cache" section: what the package does, that it needs `ext-redis` and `pollora:object-cache:enable`, the `wordpress` cache driver, the site prefix, and the doctor suggestion. + ### Changed - Accepts `pollora/discovery` ^0.3 (`^0.1 || ^0.2 || ^0.3 || ^1.0`) diff --git a/resources/boost/guidelines/core.blade.php b/resources/boost/guidelines/core.blade.php index 857fa30..eb05913 100644 --- a/resources/boost/guidelines/core.blade.php +++ b/resources/boost/guidelines/core.blade.php @@ -142,7 +142,7 @@ class InternalHelper {} ### Available Artisan Commands -- `pollora:install` — Full project installation (`--theme` to pick the generated theme; runs without interaction) +- `pollora:install` — Full project installation (`--theme` to pick the generated theme; `--db=sqlite` for development, CI and demos only, never production; runs without interaction) - `pollora:env:setup` — Install and configure WordPress - `pollora:make:theme` / `pollora:theme:delete` / `pollora:theme:status` — Themes - `pollora:make:plugin` / `pollora:plugin:list` / `pollora:plugin:status` — Plugins @@ -158,10 +158,11 @@ 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) - `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 -- `pollora:doctor` — Check the project for silent failures (core patch, patches lock, `.env`, discovery cache, theme build, patterns…) and print the fix for each, including bindings that can never show a value, typed meta that cannot register, users left with a removed role, and asynchronous actions nothing will run (ignored `#[Async]`, unavailable driver, overdue WP-Cron, jobs without a worker); the same checks are in Tools › Site Health. **Run it first when something fails without an error** +- `pollora:doctor` — Check the project for silent failures (core patch, patches lock, `.env`, discovery cache, theme build, patterns…) and print the fix for each, including bindings that can never show a value, typed meta that cannot register, users left with a removed role, and asynchronous actions nothing will run (ignored `#[Async]`, unavailable driver, overdue WP-Cron, jobs without a worker), a missing persistent object cache or drop-in (`object-cache-package`), the SQLite plugin and drop-in, and a WordPress network; the same checks are in Tools › Site Health. **Run it first when something fails without an error** Commands use the colon convention since v13.32; the former dashed names (`pollora:make-theme`…) still work as aliases. diff --git a/resources/boost/guidelines/framework.blade.php b/resources/boost/guidelines/framework.blade.php index 989d97e..d1b6dbd 100644 --- a/resources/boost/guidelines/framework.blade.php +++ b/resources/boost/guidelines/framework.blade.php @@ -123,6 +123,10 @@ WordPress is loaded from a service provider's `boot()`; `wp()` runs there. Since v13.35.1, `template_redirect` (then `pollora_loaded`) fires once every provider has booted, still before routing, so a plugin or theme rendering a view from `template_redirect` gets the theme's view composers and shared data. Code that relied on `template_redirect` having fired during the providers' boot must move to a later hook. +### 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. + ### Extracted Packages Some modules now live in their own packages, installed with the framework: `pollora/hook` (hook domain and adapters), `pollora/option`, `pollora/ajax`, `pollora/abilities`. diff --git a/tests/Feature/Guidelines/CoreGuidelinesTest.php b/tests/Feature/Guidelines/CoreGuidelinesTest.php index b2246ef..614f233 100644 --- a/tests/Feature/Guidelines/CoreGuidelinesTest.php +++ b/tests/Feature/Guidelines/CoreGuidelinesTest.php @@ -82,3 +82,11 @@ public function render(string $path): string expect($content)->toStartWith("---\nname: ".basename($skill)."\ndescription: "); })->with(fn (): array => glob(dirname(__DIR__, 3).'/resources/boost/skills/*', GLOB_ONLYDIR) ?: []); + +it('documents the object cache commands and the SQLite option', function () { + expect(renderCoreGuidelines()) + ->toContain('pollora:object-cache:enable') + ->toContain('`:flush`') + ->toContain('`--db=sqlite`') + ->toContain('object-cache-package'); +}); diff --git a/tests/Feature/Guidelines/FrameworkGuidelinesTest.php b/tests/Feature/Guidelines/FrameworkGuidelinesTest.php index 021395b..b38ebf5 100644 --- a/tests/Feature/Guidelines/FrameworkGuidelinesTest.php +++ b/tests/Feature/Guidelines/FrameworkGuidelinesTest.php @@ -38,3 +38,11 @@ public function render(string $path, array $data): string it('reads the installed framework when no major is given', function () { expect(renderFrameworkGuidelines())->toContain('## Pollora 13.x Specifics'); }); + +it('tells a Pollora 13 project about the persistent object cache, and not a Pollora 12 one', function () { + expect(renderFrameworkGuidelines(['polloraMajor' => 13])) + ->toContain('### Persistent Object Cache') + ->toContain("Cache::store('wordpress')") + ->toContain('pollora:object-cache:enable'); + expect(renderFrameworkGuidelines(['polloraMajor' => 12]))->not->toContain('### Persistent Object Cache'); +});