civicrm.settings.php.template - Simplify examples of `$civicrm_setting`
authorTim Otten <totten@civicrm.org>
Thu, 27 Feb 2020 00:12:10 +0000 (16:12 -0800)
committerTim Otten <totten@civicrm.org>
Thu, 27 Feb 2020 00:12:10 +0000 (16:12 -0800)
commit496f6c63edd6be7004aec8fee541ad302b6aad8a
treea667ac3877dde6a78ca0ede2d424185728f75d87
parent8a4a1beca34bc7ca264e16c1f40a8eb047156b52
civicrm.settings.php.template - Simplify examples of `$civicrm_setting`

Overview
--------

This simplifies the examples in `civicrm.settings.php.template`.

Before
------

Every reference to `$civicrm_setting` uses an English-looking group-name like

``php
$civicrm_setting['URL Preferences']['imageUploadURL'] = 'http://example.com/example-image-upload-url';
```

After
-----

The varying group names are just `domain`.

```php
$civicrm_setting['domain']['imageUploadURL'] = 'http://example.com/example-image-upload-url';.
```

Comments
--------

Since CiviCRM v4.7, expessions like `$civicrm_setting['URL Preferences']` have been aliases
for `$civicrm_setting['domain']`.  (See `SettingsManager::parseMandatorySettings()`.)

These examples were initially kept in the verbose 4.6 format so that users of 4.6 and 4.7
could continue to exchange examples with each other.  But 4.6 and 4.7 are pretty old, so I
don't think that's an issue anymore. We're now firmly in the 5.x world.

What does still matter is intuition - if the examples set an expectation that you should put
things under buckets like `URL Preferences`, then it implies that you should be thinking about
those buckets.  (Does the `extensionsURL` belong under `URL Preferences` or `Extension
Preferences`?  Should a search-related setting defined by an extension go under `Search
Preferences` or `Extension Preferences`?  Can I make up new groups?  If I know the name used
by the Setting API, then how do I figure out the group-name used for the `$civicrm_setting`
override?  ...  The answer to all of these questions is that it doesn't matter because they're
really the same group.)
templates/CRM/common/civicrm.settings.php.template