mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-08-14 17:24:53 +02:00
Refactor PHP.
This commit is contained in:
@@ -18,12 +18,12 @@ class Json {
|
|||||||
return file_put_contents($path, $json) !== false;
|
return file_put_contents($path, $json) !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function decode($json) {
|
private static function decode($json) {
|
||||||
$json = Json::strip($json);
|
$json = Json::strip($json);
|
||||||
return json_decode($json, true);
|
return json_decode($json, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function strip($commented_json) {
|
private static function strip($commented_json) {
|
||||||
$insideString = false;
|
$insideString = false;
|
||||||
$insideComment = false;
|
$insideComment = false;
|
||||||
$json = '';
|
$json = '';
|
||||||
|
Reference in New Issue
Block a user