Idephix
Idephix copied to clipboard
global settings
There are few settings which could be tweaked via conf like:
- default timeout for commands: now you have to specify it in every
localinvocation - failonerror: the default behaviour is to stop when something goes wrong, maybe there are some use cases where the script should continue
makes sense? I'm for creating a single array with all the needed configuration
So our idxrc would be like
<?php
return \Idephix\Config::fromArray(
array(
\Idephix\Config::ENVS => $environments
\Idephix\Config::TIMEOUT => 60,
\Idephix\Config::FAILONERROR => true,
)
);
We should continue to add constants for "reserved" configuration keys, shouldn't we? And of course we will have defaults for those extra values.
sort of, as an alternative way we could put it in a global array like that
$config = [
'envs' => [
'prod' => [...],
'dev' => []
],
'command_timeout' => 500,
'fail_on_error' => false
]
return \Idephix\Config::fromArray($config)
the main benefit I see in this approach is hiding Config class internals plus enforcing config keys validation