# Piece of Cake 2

<div class="poc-features">
  <div class="poc-feature">
    <p class="poc-feature-title">Modern PHP</p>
    <p>Runs on PHP 8.0–8.5. Installed and managed with Composer, with code that follows the CakePHP 5 <a href="https://pieceofcake2.github.io/docs/contributing/cakephp-coding-conventions.html">coding standard</a>. The framework classes are in the <code>Cake\</code> namespace: applications and plugins can keep their global classes as they are, or use <a href="https://pieceofcake2.github.io/docs/development/namespaced-classes.html">namespaced classes</a> and the CakePHP 5 directory layout.</p>
  </div>
  <div class="poc-feature">
    <p class="poc-feature-title">Security fixes</p>
    <p><a href="https://pieceofcake2.github.io/docs/security/fixes.html">Vulnerabilities</a> found in CakePHP 2.x keep being fixed after the upstream end of life.</p>
  </div>
  <div class="poc-feature">
    <p class="poc-feature-title">Tested</p>
    <p>PHPUnit 9.6 test suites run in CI on every supported PHP version, together with PHPStan static analysis.</p>
  </div>
  <div class="poc-feature">
    <p class="poc-feature-title">Modern tooling through plugins</p>
    <p><a href="https://pieceofcake2.github.io/vite/">Vite</a> asset integration, <a href="https://pieceofcake2.github.io/twig-view/">Twig views</a>, <a href="https://pieceofcake2.github.io/captcha/">CAPTCHA</a>, <a href="https://pieceofcake2.github.io/panther/">End-to-End tests with Symfony Panther</a> and more.</p>
  </div>
</div>

## Getting started

### New application

Create a new application from the
[application skeleton](https://github.com/pieceofcake2/app):

```bash
composer create-project pieceofcake2/app my_app
```

See [Installation](https://pieceofcake2.github.io/docs/installation.html) for
the next steps. CakePHP 2 is for maintaining existing applications; if you are
starting a new project, consider [CakePHP 5](https://book.cakephp.org/5/en/).

### Existing application

Replace `cakephp/cakephp` with `pieceofcake2/cakephp`:

```bash
composer remove --no-update cakephp/cakephp
composer require pieceofcake2/cakephp
```

Then follow
[Migrating from CakePHP 2.10](https://pieceofcake2.github.io/docs/appendices/migrating-from-cakephp-2-10.html)
for the `composer.json` settings and the breaking changes.

## Packages

Every package is installed with Composer. Each name links to its
documentation.

### Core repositories

- [pieceofcake2/cakephp](https://pieceofcake2.github.io/docs/) - The CakePHP 2.x framework ([Markdown](https://github.com/pieceofcake2/docs/blob/2.x/docs/en/index.md), [llms.txt](https://pieceofcake2.github.io/docs/llms.txt))
- [pieceofcake2/app](https://pieceofcake2.github.io/app/) - Application skeleton with the modern directory layout ([Markdown](https://github.com/pieceofcake2/app/blob/2.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/app/llms.txt))
- [pieceofcake2/bake](https://pieceofcake2.github.io/bake/) - Code generation tool ([Markdown](https://github.com/pieceofcake2/bake/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/bake/llms.txt))
- [pieceofcake2/upgrade](https://pieceofcake2.github.io/upgrade/) - Upgrade utility (CakePHP 1.3 to 2.0) ([Markdown](https://github.com/pieceofcake2/upgrade/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/upgrade/llms.txt))

### Development tools

- [pieceofcake2/phpstan-cakephp2](https://pieceofcake2.github.io/phpstan-cakephp2/) - PHPStan extension for static analysis ([Markdown](https://github.com/pieceofcake2/phpstan-cakephp2/blob/main/docs/README.md), [llms.txt](https://pieceofcake2.github.io/phpstan-cakephp2/llms.txt))
- [pieceofcake2/phpcs-cakephp2](https://pieceofcake2.github.io/phpcs-cakephp2/) - PHP_CodeSniffer standard for CakePHP 2 ([Markdown](https://github.com/pieceofcake2/phpcs-cakephp2/blob/main/docs/README.md), [llms.txt](https://pieceofcake2.github.io/phpcs-cakephp2/llms.txt))
- [pieceofcake2/panther](https://pieceofcake2.github.io/panther/) - End-to-End tests with Symfony Panther ([Markdown](https://github.com/pieceofcake2/panther/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/panther/llms.txt))
- [pieceofcake2/storybook](https://pieceofcake2.github.io/storybook/) - Storybook for the Elements of an application ([Markdown](https://github.com/pieceofcake2/storybook/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/storybook/llms.txt))
- [pieceofcake2/report](https://pieceofcake2.github.io/report/) - A4 PDF reports printed by a headless Chrome, for Panther and the security checks ([Markdown](https://github.com/pieceofcake2/report/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/report/llms.txt))

### Security

- [pieceofcake2/security-check](https://pieceofcake2.github.io/security-check/) - The security checks (SCA, SAST and DAST) in one command ([Markdown](https://github.com/pieceofcake2/security-check/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/security-check/llms.txt))
- [pieceofcake2/security-sca](https://pieceofcake2.github.io/security-sca/) - Known vulnerabilities of the Composer packages, as a PDF report ([Markdown](https://github.com/pieceofcake2/security-sca/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/security-sca/llms.txt))
- [pieceofcake2/security-sast](https://pieceofcake2.github.io/security-sast/) - Static analysis of the code and the configuration with Semgrep or PHPStan, as a PDF report ([Markdown](https://github.com/pieceofcake2/security-sast/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/security-sast/llms.txt))
- [pieceofcake2/security-dast](https://pieceofcake2.github.io/security-dast/) - Scan of the running application with OWASP ZAP, as a PDF report ([Markdown](https://github.com/pieceofcake2/security-dast/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/security-dast/llms.txt))
- [pieceofcake2/security-headers](https://pieceofcake2.github.io/security-headers/) - The security headers of every response, with a Content Security Policy that allows other sites and Google's tags by name ([Markdown](https://github.com/pieceofcake2/security-headers/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/security-headers/llms.txt))

### Plugins

#### Debugging

- [pieceofcake2/debug_kit](https://pieceofcake2.github.io/debug_kit/) - Debug toolbar ([Markdown](https://github.com/pieceofcake2/debug_kit/blob/2.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/debug_kit/llms.txt))

#### Infrastructure

- [pieceofcake2/aws](https://pieceofcake2.github.io/aws/) - AWS SDK integration ([Markdown](https://github.com/pieceofcake2/aws/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/aws/llms.txt))
- [pieceofcake2/async-aws](https://pieceofcake2.github.io/async-aws/) - AsyncAws integration ([Markdown](https://github.com/pieceofcake2/async-aws/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/async-aws/llms.txt))

#### Logging & Monitoring

- [pieceofcake2/monolog](https://pieceofcake2.github.io/monolog/) - Monolog integration ([Markdown](https://github.com/pieceofcake2/monolog/blob/2.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/monolog/llms.txt))
- [pieceofcake2/sentry](https://pieceofcake2.github.io/sentry/) - Error tracking and monitoring ([Markdown](https://github.com/pieceofcake2/sentry/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/sentry/llms.txt))

#### Templating

- [pieceofcake2/twig-view](https://pieceofcake2.github.io/twig-view/) - Twig template engine ([Markdown](https://github.com/pieceofcake2/twig-view/blob/2.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/twig-view/llms.txt))
- [pieceofcake2/csv-view](https://pieceofcake2.github.io/csv-view/) - CSV view class ([Markdown](https://github.com/pieceofcake2/csv-view/blob/2.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/csv-view/llms.txt))

#### View Helpers

- [pieceofcake2/markdown](https://pieceofcake2.github.io/markdown/) - Markdown helper ([Markdown](https://github.com/pieceofcake2/markdown/blob/2.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/markdown/llms.txt))
- [pieceofcake2/menu_builder](https://pieceofcake2.github.io/menu_builder/) - Navigation menu helper ([Markdown](https://github.com/pieceofcake2/menu_builder/blob/2.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/menu_builder/llms.txt))
- [pieceofcake2/vite](https://pieceofcake2.github.io/vite/) - Vite asset helper with dev server support ([Markdown](https://github.com/pieceofcake2/vite/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/vite/llms.txt))
- [pieceofcake2/webpack-encore](https://pieceofcake2.github.io/webpack-encore/) - Webpack Encore asset helper ([Markdown](https://github.com/pieceofcake2/webpack-encore/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/webpack-encore/llms.txt))

#### Forms & Validation

- [pieceofcake2/xform](https://pieceofcake2.github.io/xform/) - Extended form helper ([Markdown](https://github.com/pieceofcake2/xform/blob/2.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/xform/llms.txt))
- [pieceofcake2/cakeplus](https://pieceofcake2.github.io/cakeplus/) - Form utilities and enhancements ([Markdown](https://github.com/pieceofcake2/cakeplus/blob/2.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/cakeplus/llms.txt))
- [pieceofcake2/captcha](https://pieceofcake2.github.io/captcha/) - CAPTCHA widget and server-side verification with Cloudflare Turnstile, Google reCAPTCHA v2/v3 or hCaptcha ([Markdown](https://github.com/pieceofcake2/captcha/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/captcha/llms.txt))
- [pieceofcake2/purifiable](https://pieceofcake2.github.io/purifiable/) - HTML sanitization of model fields with HTML Purifier ([Markdown](https://github.com/pieceofcake2/purifiable/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/purifiable/llms.txt))

#### Database

- [pieceofcake2/datasources](https://pieceofcake2.github.io/datasources/) - Additional datasources (CSV / TSV files, arrays and more) ([Markdown](https://github.com/pieceofcake2/datasources/blob/2.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/datasources/llms.txt))

#### Authentication and Authorization

- [pieceofcake2/authenticate](https://pieceofcake2.github.io/authenticate/) - Authentication classes ([Markdown](https://github.com/pieceofcake2/authenticate/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/authenticate/llms.txt))
- [pieceofcake2/acl_extras](https://pieceofcake2.github.io/acl_extras/) - Console tools for managing ACL tables ([Markdown](https://github.com/pieceofcake2/acl_extras/blob/2.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/acl_extras/llms.txt))
- [pieceofcake2/acl_menu](https://pieceofcake2.github.io/acl_menu/) - Navigation menus of the actions allowed by ACL ([Markdown](https://github.com/pieceofcake2/acl_menu/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/acl_menu/llms.txt))
- [pieceofcake2/totp](https://pieceofcake2.github.io/totp/) - Two-factor authentication with one-time passwords (TOTP) ([Markdown](https://github.com/pieceofcake2/totp/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/totp/llms.txt))

#### Files

- [pieceofcake2/upload](https://pieceofcake2.github.io/upload/) - File upload handling ([Markdown](https://github.com/pieceofcake2/upload/blob/2.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/upload/llms.txt))
- [pieceofcake2/filebinder](https://pieceofcake2.github.io/filebinder/) - File attachment for model records, stored in a local directory, in the database or on Amazon S3 ([Markdown](https://github.com/pieceofcake2/filebinder/blob/2.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/filebinder/llms.txt))
- [pieceofcake2/imagine](https://pieceofcake2.github.io/imagine/) - Image processing library wrapper ([Markdown](https://github.com/pieceofcake2/imagine/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/imagine/llms.txt))
- [pieceofcake2/image](https://pieceofcake2.github.io/image/) - Validation of uploaded images by their contents (JPEG, PNG, GIF, WebP and SVG) ([Markdown](https://github.com/pieceofcake2/image/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/image/llms.txt))
- [pieceofcake2/cakepdf](https://pieceofcake2.github.io/cakepdf/) - PDF generation ([Markdown](https://github.com/pieceofcake2/cakepdf/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/cakepdf/llms.txt))

#### SEO

- [pieceofcake2/seo](https://pieceofcake2.github.io/seo/) - Search engine optimization ([Markdown](https://github.com/pieceofcake2/seo/blob/6.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/seo/llms.txt))
- [pieceofcake2/sitemap](https://pieceofcake2.github.io/sitemap/) - Sitemap generation ([Markdown](https://github.com/pieceofcake2/sitemap/blob/1.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/sitemap/llms.txt))

#### I18n

- [pieceofcake2/localized](https://pieceofcake2.github.io/localized/) - Localization utilities ([Markdown](https://github.com/pieceofcake2/localized/blob/2.x/docs/README.md), [llms.txt](https://pieceofcake2.github.io/localized/llms.txt))

## Security

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](https://github.com/pieceofcake2/.github/blob/master/SECURITY.md)
for details, and [Security Fixes](https://pieceofcake2.github.io/docs/security/fixes.html)
for the vulnerabilities fixed so far.

For your own applications, the security packages check and harden them.
[pieceofcake2/security-check](https://pieceofcake2.github.io/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](https://pieceofcake2.github.io/security-headers/) adds the security headers to
every response. See [Security Checks](https://pieceofcake2.github.io/docs/security/checks.html).

## Contributing

Bug reports (especially PHP 8.x compatibility issues) and pull requests are
welcome. Read the
[contribution guide](https://github.com/pieceofcake2/.github/blob/master/CONTRIBUTING.md)
before you start.
