Ticket #42 (closed enhancement: fixed)
Create a way to access all conf.yaml settings from anywhere without any defines
| Reported by: | ociule | Owned by: | ociule |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.5 |
| Component: | architecture | Version: | |
| Severity: | major | Keywords: | |
| Cc: |
Description (last modified by ociule) (diff)
UPDATE: just use global $conf, this works from anywhere and does exactly that.
Right now, it one wants to change a setting between environments, he can add it to conf.yaml and then add a define in conf.php, like this:
conf.yaml:
==========
env:
dev:
default_admin_address: dev_admin@example.com
conf.php:
==========
define('DEFAULT_ADMIN_ADDRESS', $conf['default_admin_address'])
This is cumbersome and repetitive.
A service would be nice so that we could do:
$turb->env->default_admin_address
from anywhere, and without the stupid define.
Furthermore, this would finally allow using arrays (or any composite type for that matter) defined in conf.yaml. Right now, this is really ugly to do, as PHP does not allow array in constants (you cannot put an array into a constant).
Change History
comment:6 Changed 3 years ago by ociule
(In [514]) Use the new Env service from the ExceptionNotifier?. No more ugly static atributes. See #42
