section = $section; $this->key = $key; $this->value = $value; } public function __toString() { $domain = Config::getLocalConfigPath() == Config::getDefaultLocalConfigPath() ? '' : Config::getHostname(); $domainArg = !empty($domain) ? "--matomo-domain=\"$domain\" " : ''; return sprintf('./console %sconfig:set --section="%s" --key="%s" --value="%s"', $domainArg, $this->section, $this->key, $this->value); } public function exec() { $config = Config::getInstance(); $config->{$this->section}[$this->key] = $this->value; $config->forceSave(); } }