ouzo
ouzo copied to clipboard
Config lazy loading causes trouble using Config in consoles
putenv('environment=prod');
define('ROOT_PATH', realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR);
require 'vendor/autoload.php';
Files::loadIfExists(Path::join(ROOT_PATH, 'config', 'routes.php'));
$app = new Application();
// ...
$app->add(new RefreshTagsCommand());
// ...
$app->run();
Config::registerConfig in RefreshTagsCommand won't register config.