lqV xSqV mqV xSqV =#qV 8ŤqV ` 0 hV ^!|p
dns_get_mx q @k~V ;x Pk~V 1 V 0qV qV k~V ;x mqV @ ֏qV lqV xSqV 0 fV x getmxrr ! k~V l~V k~V 9 V 0qV qV k~V ;x mqV @ ֏qV lqV xSqV ` @ ؚV o| net_get_interfaces {m~V ;x k~V A V ؆qV qV 0 (V 0 gV Y| ftok `k~V ;x k~V I V qV qV p ؘV $qV @ lqV @ 0 bV S hrtime `k~V ;x k~V Q V ܆qV qV P V lqV 8ŤqV 0k~V @k~V k~V Y V @qV qV p p xbV @ KwqV @ NRqV 8ŤqV 0k~V ;x k~V a V qV qV p h`V D $qV @ NRqV 8ŤqV 0 cV
y getmyuid `k~V ;x 0k~V i V `qV qV 0 heV 0 nV x getmygid `k~V ;x k~V q V qV qV 0 oV 0 oV y getmypid `k~V ;x k~V y V qV qV 0 HoV 0 lV :QNp
getmyinode `k~V ;x k~V V pqV qV 0 XlV 0 mV =Np
getlastmod `k~V ;x k~V V qV qV 0 hmV @k~V k~V k~V V څqV qV P p haV @ KwqV @ NRqV 8ŤqV `k~V ;x k~V V ݅qV qV p 8kV D $qV @ NRqV 8ŤqV 0 jV 9p openlog `k~V ;x k~V V HqV qV k~V ;x @qV @ */
public function getPrettyKey($url = true)
{
$out = str_replace(Configuration::KEYMARKER, "»", $this->key);
if ($url && !strstr($out, '»')) {//provide no urls for plugins, etc.
if ($out == 'start') {
// exception, because this config name is clashing with our actual start page
return '' . $out . '';
} else {
return '' . $out . '';
}
}
return $out;
}
/**
* Returns setting key as an array key separator
*
* This is used to create form output
*
* @return string key
*/
public function getArrayKey()
{
return str_replace(Configuration::KEYMARKER, "']['", $this->key);
}
/**
* What type of configuration is this
*
* Returns one of
*
* 'plugin' for plugin configuration
* 'template' for template configuration
* 'dokuwiki' for core configuration
*
* @return string
*/
public function getType()
{
if (str_starts_with($this->getKey(), 'plugin' . Configuration::KEYMARKER)) {
return 'plugin';
} elseif (str_starts_with($this->getKey(), 'tpl' . Configuration::KEYMARKER)) {
return 'template';
} else {
return 'dokuwiki';
}
}
/**
* Build html for label and input of setting
*
* @param \admin_plugin_config $plugin object of config plugin
* @param bool $echo true: show inputted value, when error occurred, otherwise the stored setting
* @return string[] with content array(string $label_html, string $input_html)
*/
public function html(\admin_plugin_config $plugin, $echo = false)
{
$disable = '';
if ($this->isProtected()) {
$value = $this->protected;
$disable = 'disabled="disabled"';
} elseif ($echo && $this->error) {
$value = $this->input;
} else {
$value = is_null($this->local) ? $this->default : $this->local;
}
$key = htmlspecialchars($this->key);
$value = formText($value);
$label = '';
$input = '';
return [$label, $input];
}
/**
* Should the current local value be saved?
*
* @see out() to run when this returns true
* @return bool
*/
public function shouldBeSaved()
{
if ($this->isProtected()) return false;
if ($this->local === null) return false;
if ($this->default == $this->local) return false;
return true;
}
/**
* Escaping
*
* @param string $string
* @return string
*/
protected function escape($string)
{
$tr = ["\\" => '\\\\', "'" => '\\\''];
return "'" . strtr(cleanText($string), $tr) . "'";
}
/**
* Generate string to save local setting value to file according to $fmt
*
* @see shouldBeSaved() to check if this should be called
* @param string $var name of variable
* @param string $fmt save format
* @return string
*/
public function out($var, $fmt = 'php')
{
if ($fmt != 'php') return '';
if (is_array($this->local)) {
$value = 'array(' . implode(', ', array_map([$this, 'escape'], $this->local)) . ')';
} else {
$value = $this->escape($this->local);
}
$out = '$' . $var . "['" . $this->getArrayKey() . "'] = $value;\n";
return $out;
}
/**
* Returns the localized prompt
*
* @param \admin_plugin_config $plugin object of config plugin
* @return string text
*/
public function prompt(\admin_plugin_config $plugin)
{
$prompt = $plugin->getLang($this->key);
if (!$prompt) $prompt = htmlspecialchars(str_replace(['____', '_'], ' ', $this->key));
return $prompt;
}
/**
* Is setting protected
*
* @return bool
*/
public function isProtected()
{
return !is_null($this->protected);
}
/**
* Is setting the default?
*
* @return bool
*/
public function isDefault()
{
return !$this->isProtected() && is_null($this->local);
}
/**
* Has an error?
*
* @return bool
*/
public function hasError()
{
return $this->error;
}
/**
* Returns caution
*
* @return false|string caution string, otherwise false for invalid caution
*/
public function caution()
{
if (empty($this->caution)) return false;
if (!in_array($this->caution, Setting::$validCautions)) {
throw new \RuntimeException(
'Invalid caution string (' . $this->caution . ') in metadata for setting "' . $this->key . '"'
);
}
return $this->caution;
}
}