How to override / change site settings

Permalink 5 users found helpful
Adding defines in `application/config/site.php` doesn't seem to do it anymore.

I see there is now `application/config/generated_overrides/concrete.php` but I'm guessing that any changes made there will be overwritten.

What is the proper way of doing this in 5.7?

Thanks!

 
Korvin replied on at Permalink Best Answer Reply
Korvin
in 5.7 configuration has changed almost completely. We have moved to a system based on Laravel's Repositories. Basically, each config "key" has four basic properties

1. Namespace  The namespace, blank for core overrides, package handle for package overrides.
2. Group      The group that the config item belongs to
3. Item       The index
4. Value      The value


so if I create a file named '/application/config/local.php' with the contents:
<?php
return array(
    'my' => array(
        'local' => array(
            'config' => array(
                'test' => 123
            ),
            'test' => "value"
        )));


I will have created the group "local" in an empty namespace, and the items "", "my", "my.local", "my.local.config", "my.local.test", and "my.local.config.test".

Going down the list of values in JSON format:
"":                     [ "my": [ "local": [ "config": [ "test": 123 ], "test": "value" ] ] ];
"my":                   [ "local": [ "config": [ "test": 123 ], "test": "value" ] ];
"my.local":             [ "config": [ "test": 123 ], "test": "value" ];
"my.local.config":      [ "test": 123 ];
"my.local.test":        "value"
"my.local.config.test": 123;


To access these values, all we have to do is use \Config::get("{$group}.{$item}"), so to get the value "value" from "my.local.test", we'd do:
$value = \Config::get('local.my.local.config.test');


Now sometimes, you need to override something in the core. Say we want to change our debug detail to always be "debug" and to always display errors. The keys for these values are "concrete.debug.display_errors" and "concrete.debug.detail".
seehttps://github.com/concrete5/concrete5-5.7.0/blob/develop/web/concre...

From what we've gone over above, we know that the "group" is "concrete" and the item is "debug.display_errors" and "debug.detail".

To override these values, all we have to do is create a "/application/config/concrete.php" file, and return the overriding array within it:
return array(
    'debug' => array(
        'display_errors' => true,
        'detail' => 'debug'
    )
);


For more information on Repositories and how we use them to store values check out my other post here:http://www.concrete5.org/community/forums/5-7-discussion/packagesav...

That's all, hope this helps!
rmayhue replied on at Permalink Reply
Go it.

Thank you for the detailed explanation. I'm sure this will help some others as well.

Since there's no 5.7 developer docs yet I'm having to poke through code to figure things out.

Again... thank you.
Responsive replied on at Permalink Reply
Responsive
Hi Korvin

Why does the following not remove the intelligent search in the top bar please ?

'external' => array(
        'news_overlay' => false,
        'intelligent_search_help' => false
    ),
Korvin replied on at Permalink Reply
Korvin
Because neither of these settings do that. If you look at the core config definitions, both of these settings has a comment above it that clearly states what the setting is for.
Responsive replied on at Permalink Reply
Responsive
so what does control the ccm-nav-intelligent-search in the toolbar if the below does not. I thought the below was like the old define('ENABLE_INTELLIGENT_SEARCH_HELP', false )

'external' => array(
/**
* Provide help within the intelligent search
*
* @var bool concrete.external.intelligent_search_help
*/
'intelligent_search_help' => true,
Responsive replied on at Permalink Reply
Responsive
anyone ?