value map for $VAR substitution in docs function vv_conf_vars(): array { $vars = []; $files = ['master.conf']; $host = vv_detect_host(); if ($host === 'host1') $files[] = 'host1.conf'; if ($host === 'host2') $files[] = 'host2.conf'; foreach ($files as $f) { $raw = vv_read_conf_raw($f); // Match: VAR_NAME="value" or VAR_NAME=value (no quotes) preg_match_all('/^\s*([A-Z0-9_]+)\s*=\s*["\']?([^"\'#\n]*?)["\']?\s*(?:#.*)?$/m', $raw, $m); foreach ($m[1] as $i => $key) { $vars[$key] = trim($m[2][$i]); } } return $vars; }