I fully agree with the idea of not using constants, but just for info about
@matthew Generally speaking, you shouldn’t use getcwd(); you should just specify a path relative to the application root…
'cache' => [
'path' => 'data/cache/'
logger' => [ ... 'path' => 'data/log/' ]
For example using a Monolog RotatingFileHandler, I forgot a
getcwd() and was wondering why it was not rotated because it uses
glob to match old log files:
$logFile = getcwd() . $container->get(config)['logger']['path']; // for brevity
$logger = new Logger('mylogger');
new Handler\RotatingFileHandler($logFile, $days, Logger::INFO)
Not a big problem, but good to remember if a library requires a full path. I’m not particularly fond of placing placeholders in config, but that could be considered in this case.