Merge pull request #240 from gpedro/feat/config-lua-parser

feat: getConfigLua added into engine/general
This commit is contained in:
Stefan A. Brannfjell
2016-05-17 02:15:34 +02:00
2 changed files with 27 additions and 19 deletions

View File

@@ -40,6 +40,23 @@ function data_dump($print = false, $var = false, $title = false) {
echo '</pre><br>';
}
function getConfigLua() {
$filename = config('server_path') . '/config.lua';
if (!file_exists($filename)) {
return;
}
$contents = file_get_contents($filename);
$array = explode("\n", $contents);
$output = [];
foreach ($array as $arr) {
if (strpos($arr, '--') !== 0) {
$output[] = $arr;
}
}
$ini = implode("\n", $output);
return parse_ini_string($ini);
}
function accountAccess($accountId, $TFS) {
$accountId = (int)$accountId;
$access = 0;