Skip to content

Add PhpEngine cache shim#126

Draft
dereuromark wants to merge 7 commits into
masterfrom
backport-php-engine-cache
Draft

Add PhpEngine cache shim#126
dereuromark wants to merge 7 commits into
masterfrom
backport-php-engine-cache

Conversation

@dereuromark
Copy link
Copy Markdown
Owner

Summary

This backports CakePHP 6.x's cache PhpEngine into the shim plugin for CakePHP 5.

It adds:

  • Shim\Cache\Engine\PhpEngine
  • focused test coverage
  • docs for installing brick/varexporter
  • a local benchmark script for comparing File vs PhpEngine

Notes

brick/varexporter remains an app-installed dependency for consumers using this engine.

Verification

  • vendor/bin/phpunit tests/TestCase/Cache/Engine/PhpEngineTest.php
  • php tests/benchmark/cache_engine_benchmark.php --writes=5 --reads=10
  • php -d opcache.enable_cli=1 tests/benchmark/cache_engine_benchmark.php --writes=10 --reads=25

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 5, 2026

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 63.85542% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.13%. Comparing base (3594d6a) to head (ee01f7c).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/Cache/Engine/PhpEngine.php 63.85% 60 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #126      +/-   ##
============================================
- Coverage     81.40%   81.13%   -0.28%     
- Complexity      799      997     +198     
============================================
  Files            33       34       +1     
  Lines          1807     2226     +419     
============================================
+ Hits           1471     1806     +335     
- Misses          336      420      +84     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dereuromark
Copy link
Copy Markdown
Owner Author

dereuromark commented May 5, 2026

Benchmark note:

Best-case warmed read results, 5000 reads over 100 prewritten keys:

Payload File us/op PhpEngine us/op
translations 16.19 7.35
model_cache 15.90 7.49
nested_config 15.79 7.22
record_list 15.49 7.22

CacheEngine only gained EventDispatcherTrait in 5.2; on 5.1
getEventManager() is undefined, which broke the prefer-lowest
CI job. Skip dispatching when the parent does not expose it.
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.

2 participants