*/
public $host;
+ public $debug = false;
+
protected function getConfigFilePath()
{
if (!isset($_SERVER['HOME'])) {
if ($hostVal == '') {
continue;
}
- $str .= $hostProp . '=' . $hostVal . "\n";
+ $str .= $hostProp
+ . '=' . static::quoteIniValue($hostVal) . "\n";
}
}
$cfgFilePath = $this->getConfigFilePath();
}
foreach ($this->hosts as $key => $host) {
if ($host->default) {
- return $host;
+ return $key;
}
}
}
return null;
}
+
+ public static function quoteIniValue($val)
+ {
+ if (strpos($val, '=') === false) {
+ return $val;
+ }
+ return '"' . $val . '"';
+ }
+
+ public function setDebug($debug)
+ {
+ $this->debug = $debug;
+ }
}
?>