added local config to overwrite settings #153 (#156)

This commit is contained in:
Kevin Papst
2018-06-05 23:06:47 +02:00
committed by GitHub
parent 451cf4cd1d
commit 0445a255d0
3 changed files with 27 additions and 1 deletions

1
.gitignore vendored
View File

@@ -5,6 +5,7 @@
/bin/*
!bin/console
/config/packages/local.yaml
/var/data/kimai.sqlite
/var/coverage/

View File

@@ -61,6 +61,7 @@ class Kernel extends BaseKernel
if (is_dir($confDir.'/packages/'.$this->environment)) {
$loader->load($confDir.'/packages/'.$this->environment.'/**/*'.self::CONFIG_EXTS, 'glob');
}
$loader->load($confDir.'/packages/local'.self::CONFIG_EXTS, 'glob');
$loader->load($confDir.'/services'.self::CONFIG_EXTS, 'glob');
$loader->load($confDir.'/services_'.$this->environment.self::CONFIG_EXTS, 'glob');

View File

@@ -1,6 +1,8 @@
# Configurations
There are several configurations that can be configured with the yaml files in `config/packages/*.yaml
There are several configurations that can be configured with the yaml files in `config/packages/*.yaml``
Please read _Overwriting local configs_ to know where to store your own settings.
## Duration only
@@ -92,3 +94,25 @@ kimai:
days: ['saturday','sunday']
factor: 1.5
```
## Overwriting local configs
You can create the file `config/packages/local.yaml` and store your own settings inside. This file will NEVER be shipped with Kimai.
So having your custom settings in this file allows you to easily update Kimai. This is the same concept as used for the `.env` file.
An example `config/packages/local.yaml` file might look like this:
```yaml
kimai:
timesheet:
rounding:
default:
begin: 15
end: 15
twig:
globals:
kimai_context:
date_1: "Y-m-d"
```
After changing the file you have to clear the cache with `bin/console cache:clear` or `bin/console cache:clear --env=prod`.