Files
Table of Contents
Classes
- CachedFile
- Class to manage cached text-based files.
- CachedJson
- Class to manage cached JSON-based files.
Functions
- check_fields_json() : bool
- Check JSON fields
- load_json() : mixed
- Load a JSON file
- store_json() : void
- Store a JSON-like object to a JSON file
Functions
check_fields_json()
Check JSON fields
check_fields_json(mixed $json[, array<string|int, mixed> $check_fields = array() ]) : bool
Parameters
- $json : mixed
-
A JSON-like object.
- $check_fields : array<string|int, mixed> = array()
-
Optional. An array of fields which need to be in the JSON file. Default to an empty array
Tags
Return values
bool —TRUE if the check succeeds.
load_json()
Load a JSON file
load_json(string $path[, array<string|int, mixed> $check_fields = array() ]) : mixed
Parameters
- $path : string
-
The JSON file path.
- $check_fields : array<string|int, mixed> = array()
-
Optional. An array of fields which need to be in the JSON file. Default to an empty array.
Tags
Return values
mixed —Value encoded in json in appropriate PHP type.
store_json()
Store a JSON-like object to a JSON file
store_json(mixed $json, string $path[, array<string|int, mixed> $check_fields = array() ]) : void
Parameters
- $json : mixed
-
A JSON-like object.
- $path : string
-
The file path for the JSON file created.
- $check_fields : array<string|int, mixed> = array()
-
Optional. An array of fields which need to be in the JSON file. Default to an empty array