add numbrows to commands and files for BNoiZe's template magic; added possibility to use sql-data inside xml-config; updates xml-configs a bit when socket is used (not 100% done)

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2015-02-11 14:30:30 +01:00
parent a45712198b
commit b0279025d0
6 changed files with 47 additions and 0 deletions

View File

@@ -61,6 +61,11 @@ class ConfigDaemon {
*/
private $xpath;
/**
* cache of sql-data if used
*/
private $_sqldata_cache = null;
/**
* Human - readable title of this service
* @var string
@@ -349,6 +354,16 @@ class ConfigDaemon {
} else {
return '';
}
} elseif (preg_match('/^sql\.(.*)$/', $matches[1], $match)) {
if (is_null($this->_sqldata_cache)) {
// read in sql-data (if exists)
if (file_exists(FROXLOR_INSTALL_DIR."/lib/userdata.inc.php")) {
require FROXLOR_INSTALL_DIR."/lib/userdata.inc.php";
unset($sql_root);
$this->_sqldata_cache = $sql;
}
}
return isset($this->_sqldata_cache[$match[1]]) ? $this->_sqldata_cache[$match[1]] : '';
}
}, $content);
return $content;