Rev 2 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2 | Rev 8 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | <?php |
1 | <?php |
2 | 2 | ||
3 | require_once 'JSON/JSON.php'; |
3 | require_once 'JSON/JSON.php'; |
4 | 4 | ||
- | 5 | if (!function_exists('json_encode')) { |
|
5 | function json_encode($arg) |
6 | function json_encode($arg) { |
6 | { |
- | |
7 | global $services_json; |
7 | global $services_json; |
8 | if (!isset($services_json)) { |
8 | if (!isset($services_json)) { |
9 | $services_json = new Services_JSON(); |
9 | $services_json = new Services_JSON(); |
10 | } |
10 | } |
11 | return $services_json->encode($arg); |
11 | return $services_json->encode($arg); |
12 | } |
12 | } |
- | 13 | } |
|
13 | 14 | ||
- | 15 | if (!function_exists('json_decode')) { |
|
14 | function json_decode($arg) |
16 | function json_decode($arg) { |
15 | { |
- | |
16 | global $services_json; |
17 | global $services_json; |
17 | if (!isset($services_json)) { |
18 | if (!isset($services_json)) { |
18 | $services_json = new Services_JSON(); |
19 | $services_json = new Services_JSON(); |
19 | } |
20 | } |
20 | return $services_json->decode($arg); |
21 | return $services_json->decode($arg); |
21 | } |
22 | } |
22 | 23 | } |
|
23 | ?> |
- |