Substitutions in strings specified in config files #122
Labels
No labels
bug
confirmed
critical
discussion
documentation
Doing
enhancement
experiment
suggestion
support
Testing
To Do
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: hazaar/framework#122
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I would like to be able to specify some path constants that get substituted in config file so to extend this I would like to be able to specify many constants in config files in a consistent manner.
Such as:
Basically I would like to be able to support any application constants such as RUNTIME_PATH, APPLICATION_BASE, APPLICATION_ENV, etc. Alternatively I would like to have a way to reference other config values as well.
created branch
122-substitutions-in-strings-specified-in-config-files
mentioned in merge request !38
mentioned in commit ae07bc783fd02d900127e4b19e3df8e3746b7da5
So here's how it works. ANY constant is immediately accessible. This of course includes all the Hazaar constants such as APPLICATION_PATH, APPLICATION_ENV and as above, RUNTIME_PATH.
I have also enhanced this to include some special PHP superglobals, such as $_POST, $_SERVER, etc. The allowed variables definition is:
This is all PHP superglobals listed in http://php.net/manual/en/language.variables.superglobals.php with the addition of
_APP
which is a reference to theHazaar\Application::$globals
variable.Config references can be defined as:
The above will output the
$_SERVER['REQUEST_URI']
value. It is also possible to have multiple and mix 'n match them. So this is valid:mentioned in commit
06a3e751d0
mentioned in commit
3ef86dffaf
closed via merge request !38
changed milestone to %4