Composerを利用してインストールします
php composer.phar create-project --prefer-dist cakephp/app:4.* my_app_name
パーミッションの設定するか聞かれるのでYを選択
パーミッション設定
Set Folder Permissions ? (Default to Y) [Y,n]? Y
Permissions set on /path_to_project/tmp/cache
Permissions set on /path_to_project/tmp/cache/models
Permissions set on /path_to_project/tmp/cache/persistent
Permissions set on /path_to_project/tmp/cache/views
Permissions set on /path_to_project/tmp/sessions
Permissions set on /path_to_project/tmp/tests
Permissions set on /path_to_project/tmp
Permissions set on /path_to_project/logs
Updated Security.salt value in config/app_local.php
4.0.4のインストール内容はこんな感じ。
composer.json
"require": {
"php": ">=7.2",
"cakephp/cakephp": "^4.0",
"cakephp/migrations": "^3.0",
"cakephp/plugin-installer": "^1.2",
"mobiledetect/mobiledetectlib": "^2.8"
}
4系では認証はAuthComponentは非推奨となっておりMiddleWareで提供されることになるのでauthenticationを追加する。
php composer.phar require cakephp/authentication
設定
config/app.phpを設定する。app_local.phpが存在する場合、app.phpの設定をapp_local.phpの内容で上書きするのでapp_local.phpには
開発環境の設定を書いておく。