From 3a046cd9a53380c93ba27a61ca60bbbc3ea9c43c Mon Sep 17 00:00:00 2001 From: Emiliano 'AlberT' Gabrielli Date: Thu, 20 Oct 2016 19:08:04 +0200 Subject: [PATCH] Better custom config handling --- .gitignore | 3 ++- README.md | 22 +++++++++++++++++----- app/config/config.dist.php | 2 +- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 7df9e62..98205a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ vendor/ bin/ -var/logs/* .php_cs.cache +var/logs/* +app/config/config.php diff --git a/README.md b/README.md index 10642a2..59d2801 100644 --- a/README.md +++ b/README.md @@ -51,11 +51,23 @@ You can copy `app/config/config.dist.php`to `app/config/config.php` and edit as require_once __DIR__.'/config.dist.php'; -/* - -... your customizations here - -*/ +$config = array_merge( + $config, + array( + /* + * the following are your custom settings ... + */ + 'debug' => true, + 'auth' => null, + 'log' => array( + 'driver' => 'file', + 'threshold' => 5, /* 0: Disable Logging, 1: Error, 2: Warning, 3: Notice, 4: Info, 5: Debug */ + 'file' => array('directory' => 'var/logs') + ), + ) +); + +return $config; ``` diff --git a/app/config/config.dist.php b/app/config/config.dist.php index be99cb8..77511a5 100644 --- a/app/config/config.dist.php +++ b/app/config/config.dist.php @@ -22,7 +22,7 @@ $config = array( 'default_controller' => 'Welcome', 'default_action' => 'Index', - 'debug' => true, + 'debug' => false, 'default_layout' => 'layout', 'timezone' => 'Europe/Rome', 'auth' => array(