phd uses an environment variables based configuration, see also Dev/prod parity for more information about this topic.
The following list displays configuration locations from highest to lowest priority, files are located in the application root folder.
docker-compose.override.yml(needs container restart)docker-compose.yml(needs container restart)Dockerfile(needs rebuilding).env(can be change at runtime during developemt)
defaults for
.env, see.env-dist
ENV variable are immutable by default, so if a value is set in a Dockerfile, you can not
overwrite it in your .env file, but in docker-compose.yml.
Only values in .env can be changed while the containers are running. If you change environment variables in
docker-compose.yml you need to restart your containers.
You find the config files for an application in src/config, those can also be changed at runtime:
config/main.php- main application configurationconfig/local.php- application configuration settings for local development only
❗ An important difference between application and environment configuration is that ENV variables are immutable by default, but values in PHP arrays can be overwritten.
Initial configuration adjustments should be made for the following values
APP_NAMEAPP_TITLEAPP_LANGUAGES
.env-distcan be adjusted and committed to reflect basic application settings, but we strongly recommend not to add secrets like passwords or tokens to the repository.
During local development it is also recommended to enable debug settings in .env.
YII_ENV=dev
YII_DEBUG=1
‼️ Make sure you do not have these settings enabled in production deployments.
You can also enable additional migrations during local development.
APP_MIGRATION_LOOKUP=@app/migrations/data
It is recommended to keep structural and data migrations separated.
Lookup paths for migrations can be defined in application configuration, for details see dmstr/yii2-migrate-command.
'params' => [
'yii.migrations' => [
'@yii/rbac/migrations',
'@dektrium/user/migrations',
'@vendor/lajax/yii2-translate-manager/migrations',
'@bedezign/yii2/audit/migrations'
]
]
By default phd runs with the default bootstrap asset bundle from Yii.
To enable asset customization, edit src/assets/AppAsset.php and uncomment 'less/app.less',.
There are three files included by default:
app.lessmain LESS file for applicationbootstrap.lessincludes for bootstrap LESS filesvariables.lessbootstrap settings
Initial adjustment to the style settings of the application should be made in variables.less
When developing assets you can set
APP_ASSET_FORCE_PUBLISH=1in your local.envfile, this improves detection of changes for included files. Note: This feature is only available in theAppAssetbundle for the application.
For bundling assets for production usage, see tutorial about asset compression.