pieceofcake2 / cakephp
The CakePHP 2 framework
Requires
- php: >=8.0
- ext-dom: *
- ext-libxml: *
- ext-simplexml: *
- composer/ca-bundle: ^1.5
- php81_bc/strftime: ^0.7.5
- symfony/polyfill-intl-icu: ^1.29
- symfony/polyfill-mbstring: ^1.29
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^9.6
- pieceofcake2/app: ^2.5
- pieceofcake2/phpcs-cakephp2: ^1.1
- pieceofcake2/phpstan-cakephp2: ^1.0
- rector/rector: ^2.1
Suggests
- ext-intl: Required to use IntlDateFormatter instead of strftime, if not Symfony polyfill will be used.
- ext-mbstring: For better performance with multibyte string operations, install the native mbstring extension instead of using the polyfill
- ext-mcrypt: You need to install ext-openssl or ext-mcrypt to use AES-256 encryption
- ext-openssl: You need to install ext-openssl or ext-mcrypt to use AES-256 encryption
Provides
None
Conflicts
None
Replaces
- cakephp/cakephp: ^2.0
- 2.x-dev
- v2.12.11
- v2.12.10
- v2.12.9
- v2.12.8
- v2.12.7
- v2.12.6
- v2.12.5
- v2.12.4
- v2.12.3
- v2.12.2
- v2.12.1
- v2.12.0
- v2.11.0
- v2.10.24.8
- v2.10.24.7
- v2.10.24.6
- v2.10.24.5
- v2.10.24.4
- v2.10.24.3
- v2.10.24.2
- v2.10.24.1
- dev-fix/zero-keys
- dev-fix/aclnode-node-guard
- dev-fix/coverage-bugs
- dev-fix/review-testsuite
- dev-fix/review-misc
- dev-docs/return-docblocks
- dev-feat/fixture-class-names
- dev-test/coverage-round2
- dev-fix/utility-bugs
- dev-fix/js-scaffold-bugs
- dev-fix/testsuite-bugs
- dev-fix/socket-session-bugs
- dev-fix/model-bugs
- dev-test/email-date-header
- dev-fix/console-bugs
- dev-test/console-coverage
- dev-fix/test-bootstrap-error-handler
- dev-variadic-arguments
- dev-fix/order-null-direction
- dev-test/timing-flakes
- dev-feat/namespaced-tests
- dev-feat/deprecate-app-uses
- dev-feature/phpstan-level5
This package is auto-updated.
Last update: 2026-10-22 06:30:51 UTC
README
This is a community-maintained fork of CakePHP 2.x that provides compatibility with PHP 8.0 and newer versions. The original CakePHP 2.x branch reached End of Life in June 2021. The fork keeps CakePHP 2 working on current PHP versions and fixes bugs and security issues; it does not add new features.
Important
This fork is based on CakePHP 2.10.24. Earlier versions are not supported.
Warning
Do not use CakePHP 2.x for new projects! This fork is only for maintaining existing legacy applications. For new projects, please use CakePHP 5.x which has modern PHP support, better performance, and active development.
Documentation
- Website: https://pieceofcake2.github.io/docs/
- Markdown: docs/en/index.md in pieceofcake2/docs (for AI tools and offline reading)
For AI coding tools, install the Markdown docs of the CakePHP 2 book as a dev dependency: composer require --dev pieceofcake2/docs (files in vendor/pieceofcake2/docs/docs/en/).
Start with Getting Started (Markdown), which summarizes what is different from CakePHP 2.10.
Requirements
- PHP 8.0 to 8.5
- MySQL 5.6+, PostgreSQL 9.4+, SQLite 3 or Microsoft SQL Server 2022+ (PDO)
- The
intlextension;mbstringis strongly recommended
See Requirements (Markdown) in the book for the details.
Installation
This fork is installed with Composer only. It declares replace for cakephp/cakephp, so plugins that
require cakephp/cakephp 2.x keep working.
# New application, from the application skeleton composer create-project pieceofcake2/app my_app # Existing application composer remove --no-update cakephp/cakephp composer require pieceofcake2/cakephp
An existing application also needs updated dispatcher files and composer.json settings. See
Installation
(Markdown) in the book.
Upgrading
See Migrating from CakePHP 2.10 (Markdown) in the book for the migration steps and breaking changes, and UPGRADE.md for the changes of each release.
To prepare for CakePHP 5, you can move to the CakePHP 5-style directory layout while you stay on CakePHP 2. See Migrating to the Modern Layout (Markdown) and the pieceofcake2/app skeleton.
Integration Testing
IntegrationTestTrait and EmailTrait are backported from CakePHP 5. See
Integration Testing
(Markdown) in the book.
Security
Do not report vulnerabilities in public issues; follow the security policy.
The vulnerabilities fixed in this fork, including the known vulnerabilities of the original CakePHP 2.10.24,
and other security changes such as SSL/TLS certificate validation with composer/ca-bundle are listed in
Security Fixes
(Markdown). See
Security
(Markdown) in the book for the
supported versions and how fixes are announced.
Contributing
See the contribution guidelines, including running the tests and reporting issues.
Origin
This package is a maintained fork of cakephp/cakephp
(cakephp/cakephp on Packagist, last upstream version 2.10.24), originally by the CakePHP community
(Cake Software Foundation, Inc.). It is maintained for CakePHP 2 on modern PHP by
pieceofcake2. It includes the PHP 8 compatibility work of
kamilwylegala/cakephp2-php8 up to commit
5b6a103. Changes from the original are listed in
CHANGELOG.md.
License
This project maintains the original MIT License from CakePHP. See LICENSE for details.
Acknowledgments
- Original CakePHP 2.x framework by cakephp/cakephp
- Initial PHP 8 compatibility work by kamilwylegala/cakephp2-php8
- All contributors who help maintain this fork