PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.21
Timetics – Appointment Booking Calendar & Scheduling v1.0.21
1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 All 62 releases
timetics / base / json-reader.php

json-reader.php in Timetics – Appointment Booking Calendar & Scheduling 1.0.21, at base/json-reader.php

50 lines 823 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Read CSV file
4 *
5 * @package Timetics
6 */
7 namespace Timetics\Base;
8
9 /**
10 * JSON Reader Class
11 */
12 class JsonReader implements FileReaderInterface {
13 /**
14 * Store file
15 *
16 * @var string
17 */
18 private static $file;
19
20 /**
21 * Get data that will be read from json file
22 *
23 * @param file $file
24 *
25 * @return array
26 */
27 public static function get_data( $file ) {
28 self::$file = $file;
29
30 return self::read_file();
31 }
32
33 /**
34 * Get from file
35 *
36 * @return array
37 */
38 private static function read_file() {
39 $file = self::$file;
40 $data = [];
41 $content = file_get_contents( $file );
42
43 if ( $content ) {
44 $data = json_decode( $content, true );
45 }
46
47 return $data;
48 }
49 }
50