- config/bootstrap.php
if (!env('APP_NAME') && file_exists(CONFIG . '.env')) { $dotenv = new \josegonzalez\Dotenv\Loader([CONFIG . '.env']); $dotenv->parse() ->putenv() ->toEnv() ->toServer(); }
- config/app_local.php
.gitignoreに入っているので削除すること
'Security' => [ 'salt' => env('SECURITY_SALT', 'SECURITY_SALT'), ], 'Datasources' => [ 'default' => [ 'host' => env('DB_HOST'), /* * CakePHP will use the default DB port based on the driver selected * MySQL on MAMP uses port 8889, MAMP users will want to uncomment * the following line and set the port accordingly */ //'port' => 'non_standard_port_number', 'username' => env('DB_USER'), 'password' => env('DB_PASSWORD'), 'database' => env('DB_NAME'), /* * If not using the default 'public' schema with the PostgreSQL driver * set it here. */ //'schema' => 'myapp', /* * You can use a DSN string to set the entire configuration */ 'url' => env('DATABASE_URL', null), ],
- config/.env
export APP_NAME="hoge" export DEBUG="true" export APP_ENCODING="UTF-8" export APP_DEFAULT_LOCALE="en_US" export APP_DEFAULT_TIMEZONE="UTC" export SECURITY_SALT="hogeeeeeeeeeeeeee" export DB_HOST="hoge" export DB_USER="hoge" export DB_PASSWORD="hoge" export DB_NAME="hoge"
Was this helpful?
0 / 0
1989年生まれのLancers SRE。 ホスティングから大規模なアドテクなどのインフラエンジニアとして携わり、AnsibleやTerraformでのインフラコード化を推進。副業では数社サーバー保守なども実施している。また、「脆弱性スキャナVuls」のOSS活動もしており、自称エバンジェリスト/技術広報/テクニカルサポート/コントリビュータでもある。現在はサービスの信頼性向上、可用性、レイテンシ、パフォーマンス、モニタリング、緊急対応、インフラコード化、リファクタリング、セキュリティ強化、新技術の検証、Docker開発環境の提供、AWSでのインフラ構築、グループ会社のインフラをECS/Fargateへ移行、CakePHP4での管理画面作成、メンター、分析基盤の運用を担当している。