Total Complexity | 12 |
Total Lines | 85 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | class Index extends AbstractionController |
||
9 | { |
||
10 | public function index() |
||
39 | } |
||
40 | |||
41 | public function read() |
||
54 | } |
||
55 | |||
56 | public function readObject() |
||
57 | { |
||
58 | $data = []; |
||
59 | |||
60 | $file = hex2bin($_GET["file"]); |
||
61 | $key = $_GET["key"]; |
||
62 | |||
63 | $json_object = (file_exists($file)) ? json_decode(file_get_contents($file)) : array(); |
||
64 | $array_object = $this->object_to_array($json_object); |
||
65 | |||
66 | $unserialized = unserialize($array_object[$key]["object"]); |
||
67 | |||
68 | $data["file"] = $file; |
||
69 | $data["key"] = $key; |
||
70 | $data["object"] = $unserialized; |
||
71 | |||
72 | return $data; |
||
73 | } |
||
74 | |||
75 | private function object_to_array($obj) |
||
93 | } |
||
94 | } |