Piece of Cake 2CakePHP 2, maintained for modern PHP
pieceofcake2/cakephp is a community-maintained fork of CakePHP 2.x that runs on PHP 8.0–8.5.
pieceofcake2/cakephp is a community-maintained fork of CakePHP 2.x that runs on PHP 8.0–8.5.

Modern PHP
Runs on PHP 8.0–8.5. Installed and managed with Composer, with code that follows the CakePHP 5 coding standard. The framework classes are in the Cake\ namespace: applications and plugins can keep their global classes as they are, or use namespaced classes and the CakePHP 5 directory layout.
Security fixes
Vulnerabilities found in CakePHP 2.x keep being fixed after the upstream end of life.
Tested
PHPUnit 9.6 test suites run in CI on every supported PHP version, together with PHPStan static analysis.
Modern tooling through plugins
Vite asset integration, Twig views, CAPTCHA, End-to-End tests with Symfony Panther and more.
Create a new application from the application skeleton:
composer create-project pieceofcake2/app my_appSee Installation for the next steps. CakePHP 2 is for maintaining existing applications; if you are starting a new project, consider CakePHP 5.
Replace cakephp/cakephp with pieceofcake2/cakephp:
composer remove --no-update cakephp/cakephp
composer require pieceofcake2/cakephpThen follow Migrating from CakePHP 2.10 for the composer.json settings and the breaking changes.
Every package is installed with Composer. Each name links to its documentation.
The CakePHP 2.x framework
Application skeleton with the modern directory layout
Code generation tool
Upgrade utility (CakePHP 1.3 to 2.0)
PHPStan extension for static analysis
PHP_CodeSniffer standard for CakePHP 2
End-to-End tests with Symfony Panther
Storybook for the Elements of an application
A4 PDF reports printed by a headless Chrome, for Panther and the security checks
The security checks (SCA, SAST and DAST) in one command
Known vulnerabilities of the Composer packages, as a PDF report
Static analysis of the code and the configuration with Semgrep or PHPStan, as a PDF report
Scan of the running application with OWASP ZAP, as a PDF report
The security headers of every response, with a Content Security Policy that allows other sites and Google's tags by name
Debug toolbar
AWS SDK integration
AsyncAws integration
Monolog integration
Error tracking and monitoring
Twig template engine
CSV view class
Markdown helper
Navigation menu helper
Vite asset helper with dev server support
Webpack Encore asset helper
Extended form helper
Form utilities and enhancements
CAPTCHA widget and server-side verification with Cloudflare Turnstile, Google reCAPTCHA v2/v3 or hCaptcha
HTML sanitization of model fields with HTML Purifier
Additional datasources (CSV / TSV files, arrays and more)
Authentication classes
Console tools for managing ACL tables
Navigation menus of the actions allowed by ACL
Two-factor authentication with one-time passwords (TOTP)
File upload handling
File attachment for model records, stored in a local directory, in the database or on Amazon S3
Image processing library wrapper
Validation of uploaded images by their contents (JPEG, PNG, GIF, WebP and SVG)
PDF generation
Search engine optimization
Sitemap generation
Localization utilities
Please do not report vulnerabilities in public issues or pull requests. Use GitHub's private vulnerability reporting: open the Security tab of the affected repository and click Report a vulnerability. See the security policy for details, and Security Fixes for the vulnerabilities fixed so far.
For your own applications, the security packages check and harden them. pieceofcake2/security-check runs the checks of the known vulnerabilities of the Composer packages (SCA), of the code (SAST) and of the running application (DAST) in one command, each with a PDF report, and pieceofcake2/security-headers adds the security headers to every response. See Security Checks.
Bug reports (especially PHP 8.x compatibility issues) and pull requests are welcome. Read the contribution guide before you start.