mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Use parse_ini_file instead of home-grown solution (#366)
* Use parse_ini_file instead of home-grown solution * Updated PocketMine-Language submodule
This commit is contained in:
parent
834dc343b0
commit
89216c3bd4
@ -82,28 +82,7 @@ class BaseLang{
|
||||
|
||||
protected static function loadLang($path, array &$d){
|
||||
if(file_exists($path)){
|
||||
if(strlen($content = file_get_contents($path)) > 0){
|
||||
foreach(explode("\n", $content) as $line){
|
||||
$line = trim($line);
|
||||
if($line === "" or $line{0} === "#"){
|
||||
continue;
|
||||
}
|
||||
|
||||
$t = explode("=", $line, 2);
|
||||
if(count($t) < 2){
|
||||
continue;
|
||||
}
|
||||
|
||||
$key = trim($t[0]);
|
||||
$value = trim($t[1]);
|
||||
|
||||
if($value === ""){
|
||||
continue;
|
||||
}
|
||||
|
||||
$d[$key] = $value;
|
||||
}
|
||||
}
|
||||
$d = parse_ini_file($path, false, INI_SCANNER_RAW);
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 24b5e323c440144561111d3843a5a59e8e21f973
|
||||
Subproject commit 3499fe4a6a1973cc965396f184eb01c52de79aa4
|
Loading…
x
Reference in New Issue
Block a user