| 1 | <?php |
||
| 22 | class Json extends File |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * Read and decode the json file. |
||
| 26 | * |
||
| 27 | * @param bool $assoc |
||
| 28 | * @return \stdClass|array |
||
| 29 | */ |
||
| 30 | 9 | public function read($assoc = false) |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Read the file and decode to assoc array. |
||
| 37 | * |
||
| 38 | * @return array |
||
| 39 | */ |
||
| 40 | 9 | public function readAssoc() |
|
| 44 | |||
| 45 | /** |
||
| 46 | * Encode content to json and write to disk. |
||
| 47 | * |
||
| 48 | * @param mixed $content |
||
| 49 | * @param int $options |
||
| 50 | */ |
||
| 51 | 4 | public function write($content, $options = 448) |
|
| 56 | } |
||
| 57 |