What it is
CakePHP is an open-source web application framework for PHP, distributed under the MIT license and maintained as an official repository on GitHub. It is built around design patterns that are already familiar to most PHP developers, including Associative Data Mapping, Front Controller, and Model-View-Controller. The stated goal of the project is to give PHP developers at every level a structured foundation for building robust web applications quickly, without giving up flexibility in how those applications are organised. The project has existed for roughly sixteen years and has accumulated a substantial community, with thousands of stars and forks on GitHub and an ecosystem of documentation, training, and conference activity around it.
The concrete problem CakePHP solves is the repeated, undifferentiated work that appears at the start of nearly every PHP web project: routing, request handling, database access, validation, and the separation of application logic from presentation. Rather than leaving developers to assemble and maintain those layers themselves, CakePHP provides an integrated object-relational mapper, a request and response layer that follows PSR-7, and a validation component within a single framework. This gives teams a predictable structure from the first commit and a documented upgrade path as the framework evolves.
Key capabilities
- Model-View-Controller architecture that separates request handling, application logic, and presentation.
- Object-relational mapper for database access and persistence.
- PSR-7 compliant request and response handling.
- Built-in validation component for incoming data.
- Support for building REST APIs.
- Form building facilities for constructing and processing web forms.
- Associative Data Mapping and Front Controller design patterns as core architectural pieces.
Who uses it and how
- Teams building database-backed web applications who want routing, ORM, and validation available from a single dependency.
- Developers building REST APIs that need PSR-7 request and response handling.
- Projects that need form construction and form processing alongside server-side validation.
- Applications that require a structured, convention-driven layout so that multiple developers can work in the same codebase.
- Contributors participating through Hacktoberfest and the project's documented contribution process.
Getting started
Install into an existing project with `composer require cakephp/cakephp
project readme (upstream, from github) — read inline
CakePHP is a rapid development framework for PHP which
uses commonly known design patterns like Associative Data
Mapping, Front Controller, and MVC. Our primary goal is to provide a structured
framework that enables PHP users at all levels to rapidly develop robust web
applications, without any loss to flexibility.
Installing CakePHP via Composer
You can install CakePHP into your project using
Composer. If you're starting a new project, we
recommend using the app skeleton as
a starting point. For existing applications you can run the following:
composer require cakephp/cakephp
For details on the (minimum/maximum) PHP version see version map.
Running Tests
Assuming you have PHPUnit installed (composer install), you can run the tests for CakePHP by doing the following:
- Copy
phpunit.xml.dist to phpunit.xml.
- Add the relevant database credentials to your
phpunit.xml if you want to run tests against
a non-SQLite datasource.
- Run
vendor/bin/phpunit.
Learn More
- CakePHP - The home of the CakePHP project.
- Book - The CakePHP documentation; start learning here!
- API - A reference to CakePHP's classes and API documentation.
- Awesome CakePHP - A curated list of featured resources around the framework.
- The Bakery - Tips, tutorials and articles.
- Community Center - A source for everything community related.
- Training - Join a live session and get skilled with the framework.
- CakeFest - Don't miss our annual CakePHP conference.
- Cake Software Foundation - Promoting development related to CakePHP.
Get Support!
- Slack - Join us on Slack.
- Discord - Join us on Discord.
- #cakephp on irc.freenode.net - Come chat with us, we have cake.
- Forum - Official CakePHP forum.
- GitHub Issues - Got issues? Please tell us!
- Roadmaps - Want to contribute? Get involved!
Contributing
Security
If you’ve found a security issue in CakePHP, please use the procedure
described in SECURITY.md.