Add helper functions for json files

This commit is contained in:
eraseyourknees 2022-09-13 23:40:03 +02:00
parent 54b605c1d4
commit 8894bd9cc0
2 changed files with 14 additions and 1 deletions

View File

@ -16,7 +16,7 @@ limitations under the License.
*/
function uupApiVersion() {
return '1.37.0';
return '1.38.0-dev';
}
require_once dirname(__FILE__).'/auths.php';

View File

@ -166,3 +166,16 @@ function uupApiFixDownloadLink($link) {
$link
);
}
function uupApiReadJson($path) {
$data = @file_get_contents($path);
if(empty($data))
return false;
return json_decode($data, true);
}
function uupApiWriteJson($path, $data) {
return file_put_contents($path, json_encode($data)."\n");
}