HOME > > > >

インストール

Composerを利用してインストールします

  1. php composer.phar create-project --prefer-dist cakephp/app:4.* my_app_name

パーミッションの設定するか聞かれるのでYを選択

パーミッション設定

  1. Set Folder Permissions ? (Default to Y) [Y,n]? Y
  2. Permissions set on /path_to_project/tmp/cache
  3. Permissions set on /path_to_project/tmp/cache/models
  4. Permissions set on /path_to_project/tmp/cache/persistent
  5. Permissions set on /path_to_project/tmp/cache/views
  6. Permissions set on /path_to_project/tmp/sessions
  7. Permissions set on /path_to_project/tmp/tests
  8. Permissions set on /path_to_project/tmp
  9. Permissions set on /path_to_project/logs
  10. Updated Security.salt value in config/app_local.php

4.0.4のインストール内容はこんな感じ。

composer.json

  1. "require": {
  2.     "php": ">=7.2",
  3.     "cakephp/cakephp": "^4.0",
  4.     "cakephp/migrations": "^3.0",
  5.     "cakephp/plugin-installer": "^1.2",
  6.     "mobiledetect/mobiledetectlib": "^2.8"
  7. }

4系では認証はAuthComponentは非推奨となっておりMiddleWareで提供されることになるのでauthenticationを追加する。

  1. php composer.phar require cakephp/authentication

設定

config/app.phpを設定する。app_local.phpが存在する場合、app.phpの設定をapp_local.phpの内容で上書きするのでapp_local.phpには 開発環境の設定を書いておく。