# Piece of Cake 2

<div class="poc-features">
  <div class="poc-feature">
    <p class="poc-feature-title">モダン PHP に対応</p>
    <p>PHP 8.0〜8.5 で動作します。Composer でインストールと依存関係を管理し、コードは CakePHP 5 と同じ<a href="https://pieceofcake2.github.io/docs/ja/contributing/cakephp-coding-conventions.html">コーディング規約</a>にそろえています。フレームワークのクラスは <code>Cake\</code> 名前空間にあり、アプリケーションとプラグインは、これまでの名前空間のないクラスのままでも、<a href="https://pieceofcake2.github.io/docs/ja/development/namespaced-classes.html">名前空間のあるクラス</a>と CakePHP 5 のディレクトリ構成を使うこともできます。</p>
  </div>
  <div class="poc-feature">
    <p class="poc-feature-title">脆弱性への対応</p>
    <p>本家のサポートが終わったあとも、CakePHP 2.x で見つかった<a href="https://pieceofcake2.github.io/docs/ja/security/fixes.html">脆弱性</a>を修正し続けています。</p>
  </div>
  <div class="poc-feature">
    <p class="poc-feature-title">テストで品質を確保</p>
    <p>対応するすべての PHP バージョンで、PHPUnit 9.6 のテストを CI で実行しています。PHPStan による静的解析も行っています。</p>
  </div>
  <div class="poc-feature">
    <p class="poc-feature-title">プラグインでモダンな開発に</p>
    <p><a href="https://pieceofcake2.github.io/vite/ja/">Vite</a> によるアセットの連携、<a href="https://pieceofcake2.github.io/twig-view/ja/">Twig のビュー</a>、<a href="https://pieceofcake2.github.io/captcha/ja/">CAPTCHA</a>、<a href="https://pieceofcake2.github.io/panther/ja/">Symfony Panther による End-to-End テスト</a>など、今の開発に合わせたプラグインを用意しています。</p>
  </div>
</div>

## はじめる

### 新しいアプリケーション

[アプリケーションスケルトン](https://github.com/pieceofcake2/app)から新しいアプリケーションを作成します。

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

続きは[インストール](https://pieceofcake2.github.io/docs/ja/installation.html)を参照してください。
CakePHP 2 は既存のアプリケーションを保守するためのものです。新しくプロジェクトを始める場合は
[CakePHP 5](https://book.cakephp.org/5/ja/) を検討してください。

### 既存のアプリケーション

`cakephp/cakephp` を `pieceofcake2/cakephp` に置き換えます。

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

`composer.json` の設定と破壊的変更については、
[CakePHP 2.10 からの移行](https://pieceofcake2.github.io/docs/ja/appendices/migrating-from-cakephp-2-10.html)
を参照してください。

## パッケージ

すべてのパッケージは Composer でインストールします。パッケージ名のリンクから、それぞれのドキュメントを開けます。

### コアリポジトリ

- [pieceofcake2/cakephp](https://pieceofcake2.github.io/docs/ja/) - CakePHP 2.x フレームワーク ([Markdown](https://github.com/pieceofcake2/docs/blob/2.x/docs/ja/index.md), [llms.txt](https://pieceofcake2.github.io/docs/ja/llms.txt))
- [pieceofcake2/app](https://pieceofcake2.github.io/app/ja/) - モダンなディレクトリ構成のアプリケーションスケルトン ([Markdown](https://github.com/pieceofcake2/app/blob/2.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/app/ja/llms.txt))
- [pieceofcake2/bake](https://pieceofcake2.github.io/bake/ja/) - コード生成ツール ([Markdown](https://github.com/pieceofcake2/bake/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/bake/ja/llms.txt))
- [pieceofcake2/upgrade](https://pieceofcake2.github.io/upgrade/ja/) - アップグレード用ユーティリティ（CakePHP 1.3 から 2.0） ([Markdown](https://github.com/pieceofcake2/upgrade/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/upgrade/ja/llms.txt))

### 開発ツール

- [pieceofcake2/phpstan-cakephp2](https://pieceofcake2.github.io/phpstan-cakephp2/ja/) - 静的解析用の PHPStan 拡張 ([Markdown](https://github.com/pieceofcake2/phpstan-cakephp2/blob/main/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/phpstan-cakephp2/ja/llms.txt))
- [pieceofcake2/phpcs-cakephp2](https://pieceofcake2.github.io/phpcs-cakephp2/ja/) - CakePHP 2 用の PHP_CodeSniffer 規約 ([Markdown](https://github.com/pieceofcake2/phpcs-cakephp2/blob/main/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/phpcs-cakephp2/ja/llms.txt))
- [pieceofcake2/panther](https://pieceofcake2.github.io/panther/ja/) - Symfony Panther による End-to-End テスト ([Markdown](https://github.com/pieceofcake2/panther/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/panther/ja/llms.txt))
- [pieceofcake2/storybook](https://pieceofcake2.github.io/storybook/ja/) - アプリケーションの Element のための Storybook ([Markdown](https://github.com/pieceofcake2/storybook/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/storybook/ja/llms.txt))
- [pieceofcake2/report](https://pieceofcake2.github.io/report/ja/) - ヘッドレス Chrome で印刷する A4 の PDF の報告書。Panther とセキュリティ診断で使用 ([Markdown](https://github.com/pieceofcake2/report/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/report/ja/llms.txt))

### セキュリティ

- [pieceofcake2/security-check](https://pieceofcake2.github.io/security-check/ja/) - セキュリティ診断 (SCA、SAST、DAST) を 1 つのコマンドで ([Markdown](https://github.com/pieceofcake2/security-check/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/security-check/ja/llms.txt))
- [pieceofcake2/security-sca](https://pieceofcake2.github.io/security-sca/ja/) - Composer のパッケージの既知の脆弱性を PDF の報告書に ([Markdown](https://github.com/pieceofcake2/security-sca/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/security-sca/ja/llms.txt))
- [pieceofcake2/security-sast](https://pieceofcake2.github.io/security-sast/ja/) - Semgrep か PHPStan によるコードと設定の静的解析を PDF の報告書に ([Markdown](https://github.com/pieceofcake2/security-sast/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/security-sast/ja/llms.txt))
- [pieceofcake2/security-dast](https://pieceofcake2.github.io/security-dast/ja/) - OWASP ZAP による動いているアプリケーションのスキャンを PDF の報告書に ([Markdown](https://github.com/pieceofcake2/security-dast/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/security-dast/ja/llms.txt))
- [pieceofcake2/security-headers](https://pieceofcake2.github.io/security-headers/ja/) - すべてのレスポンスにセキュリティヘッダーを付ける。ほかのサイトや Google のタグを名前で許可できる Content Security Policy ([Markdown](https://github.com/pieceofcake2/security-headers/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/security-headers/ja/llms.txt))

### プラグイン

#### デバッグ

- [pieceofcake2/debug_kit](https://pieceofcake2.github.io/debug_kit/ja/) - デバッグツールバー ([Markdown](https://github.com/pieceofcake2/debug_kit/blob/2.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/debug_kit/ja/llms.txt))

#### インフラ

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

#### ログとモニタリング

- [pieceofcake2/monolog](https://pieceofcake2.github.io/monolog/ja/) - Monolog との連携 ([Markdown](https://github.com/pieceofcake2/monolog/blob/2.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/monolog/ja/llms.txt))
- [pieceofcake2/sentry](https://pieceofcake2.github.io/sentry/ja/) - エラーの追跡とモニタリング ([Markdown](https://github.com/pieceofcake2/sentry/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/sentry/ja/llms.txt))

#### テンプレート

- [pieceofcake2/twig-view](https://pieceofcake2.github.io/twig-view/ja/) - Twig テンプレートエンジン ([Markdown](https://github.com/pieceofcake2/twig-view/blob/2.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/twig-view/ja/llms.txt))
- [pieceofcake2/csv-view](https://pieceofcake2.github.io/csv-view/ja/) - CSV 用のビュークラス ([Markdown](https://github.com/pieceofcake2/csv-view/blob/2.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/csv-view/ja/llms.txt))

#### ビューヘルパー

- [pieceofcake2/markdown](https://pieceofcake2.github.io/markdown/ja/) - Markdown ヘルパー ([Markdown](https://github.com/pieceofcake2/markdown/blob/2.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/markdown/ja/llms.txt))
- [pieceofcake2/menu_builder](https://pieceofcake2.github.io/menu_builder/ja/) - ナビゲーションメニューのヘルパー ([Markdown](https://github.com/pieceofcake2/menu_builder/blob/2.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/menu_builder/ja/llms.txt))
- [pieceofcake2/vite](https://pieceofcake2.github.io/vite/ja/) - 開発サーバーにも対応した Vite のアセットヘルパー ([Markdown](https://github.com/pieceofcake2/vite/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/vite/ja/llms.txt))
- [pieceofcake2/webpack-encore](https://pieceofcake2.github.io/webpack-encore/ja/) - Webpack Encore のアセットヘルパー ([Markdown](https://github.com/pieceofcake2/webpack-encore/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/webpack-encore/ja/llms.txt))

#### フォームとバリデーション

- [pieceofcake2/xform](https://pieceofcake2.github.io/xform/ja/) - 拡張フォームヘルパー ([Markdown](https://github.com/pieceofcake2/xform/blob/2.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/xform/ja/llms.txt))
- [pieceofcake2/cakeplus](https://pieceofcake2.github.io/cakeplus/ja/) - フォーム関連のユーティリティと機能拡張 ([Markdown](https://github.com/pieceofcake2/cakeplus/blob/2.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/cakeplus/ja/llms.txt))
- [pieceofcake2/captcha](https://pieceofcake2.github.io/captcha/ja/) - CAPTCHA ウィジェットの表示とサーバー側での検証。Cloudflare Turnstile、Google reCAPTCHA v2/v3、hCaptcha に対応 ([Markdown](https://github.com/pieceofcake2/captcha/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/captcha/ja/llms.txt))
- [pieceofcake2/purifiable](https://pieceofcake2.github.io/purifiable/ja/) - HTML Purifier によるモデルのフィールドの HTML サニタイズ ([Markdown](https://github.com/pieceofcake2/purifiable/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/purifiable/ja/llms.txt))

#### データベース

- [pieceofcake2/datasources](https://pieceofcake2.github.io/datasources/ja/) - 追加のデータソース（CSV / TSV ファイル、配列など） ([Markdown](https://github.com/pieceofcake2/datasources/blob/2.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/datasources/ja/llms.txt))

#### 認証と認可

- [pieceofcake2/authenticate](https://pieceofcake2.github.io/authenticate/ja/) - 認証クラス ([Markdown](https://github.com/pieceofcake2/authenticate/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/authenticate/ja/llms.txt))
- [pieceofcake2/acl_extras](https://pieceofcake2.github.io/acl_extras/ja/) - ACL テーブルを管理するコンソールツール ([Markdown](https://github.com/pieceofcake2/acl_extras/blob/2.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/acl_extras/ja/llms.txt))
- [pieceofcake2/acl_menu](https://pieceofcake2.github.io/acl_menu/ja/) - ACL で許可されたアクションのナビゲーションメニュー ([Markdown](https://github.com/pieceofcake2/acl_menu/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/acl_menu/ja/llms.txt))
- [pieceofcake2/totp](https://pieceofcake2.github.io/totp/ja/) - ワンタイムパスワード (TOTP) による 2 要素認証 ([Markdown](https://github.com/pieceofcake2/totp/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/totp/ja/llms.txt))

#### ファイル

- [pieceofcake2/upload](https://pieceofcake2.github.io/upload/ja/) - ファイルアップロードの処理 ([Markdown](https://github.com/pieceofcake2/upload/blob/2.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/upload/ja/llms.txt))
- [pieceofcake2/filebinder](https://pieceofcake2.github.io/filebinder/ja/) - モデルのレコードへのファイルの添付。ローカルのディレクトリ、データベース、Amazon S3 に保存 ([Markdown](https://github.com/pieceofcake2/filebinder/blob/2.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/filebinder/ja/llms.txt))
- [pieceofcake2/imagine](https://pieceofcake2.github.io/imagine/ja/) - 画像処理ライブラリのラッパー ([Markdown](https://github.com/pieceofcake2/imagine/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/imagine/ja/llms.txt))
- [pieceofcake2/image](https://pieceofcake2.github.io/image/ja/) - アップロードされた画像の中身による検証 (JPEG、PNG、GIF、WebP、SVG) ([Markdown](https://github.com/pieceofcake2/image/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/image/ja/llms.txt))
- [pieceofcake2/cakepdf](https://pieceofcake2.github.io/cakepdf/ja/) - PDF の生成 ([Markdown](https://github.com/pieceofcake2/cakepdf/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/cakepdf/ja/llms.txt))

#### SEO

- [pieceofcake2/seo](https://pieceofcake2.github.io/seo/ja/) - 検索エンジン最適化 ([Markdown](https://github.com/pieceofcake2/seo/blob/6.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/seo/ja/llms.txt))
- [pieceofcake2/sitemap](https://pieceofcake2.github.io/sitemap/ja/) - サイトマップの生成 ([Markdown](https://github.com/pieceofcake2/sitemap/blob/1.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/sitemap/ja/llms.txt))

#### 国際化

- [pieceofcake2/localized](https://pieceofcake2.github.io/localized/ja/) - ローカライズ用のユーティリティ ([Markdown](https://github.com/pieceofcake2/localized/blob/2.x/docs/ja/README.md), [llms.txt](https://pieceofcake2.github.io/localized/ja/llms.txt))

## セキュリティ

セキュリティの問題は、公開の issue やプルリクエストでは報告しないでください。
GitHub の非公開の脆弱性報告を使ってください。対象のリポジトリを開き、**Security** タブの
**Report a vulnerability** から報告できます。詳しくは
[セキュリティポリシー](https://github.com/pieceofcake2/.github/blob/master/SECURITY.md) を、
これまでに修正した脆弱性は[脆弱性への対応](https://pieceofcake2.github.io/docs/ja/security/fixes.html)
を参照してください。

アプリケーション自体の診断と対策には、セキュリティのパッケージがあります。
[pieceofcake2/security-check](https://pieceofcake2.github.io/security-check/ja/) は、Composer のパッケージの既知の
脆弱性 (SCA)、コードの静的解析 (SAST)、動いているアプリケーションのスキャン (DAST) を 1 つのコマンドで実行し、それぞれ
PDF の報告書にします。[pieceofcake2/security-headers](https://pieceofcake2.github.io/security-headers/ja/) は、
すべてのレスポンスにセキュリティヘッダーを付けます。[セキュリティ診断](https://pieceofcake2.github.io/docs/ja/security/checks.html)
を参照してください。

## コントリビューション

バグ報告（特に PHP 8.x の互換性の問題）やプルリクエストを歓迎しています。始める前に
[コントリビューションガイド](https://github.com/pieceofcake2/.github/blob/master/CONTRIBUTING.md)
を読んでください。
