summaryrefslogtreecommitdiff
path: root/lib/JSON/inc_json.php
diff options
context:
space:
mode:
authorNicolas BERNSTEIN <alexis211@gmail.com>2011-11-20 13:39:47 +0100
committerNicolas BERNSTEIN <alexis211@gmail.com>2011-11-20 13:39:47 +0100
commitd45c7f14891d951f8a6987cc6492073b97e05b5b (patch)
treed6467b1202c27f67fd8e894d25fd4aea0085b559 /lib/JSON/inc_json.php
parent4d7e065c2d2ec407b6a7ebfc7569628bac9149d1 (diff)
downloadBits-d45c7f14891d951f8a6987cc6492073b97e05b5b.tar.gz
Bits-d45c7f14891d951f8a6987cc6492073b97e05b5b.zip
Added the bit list study system
Diffstat (limited to 'lib/JSON/inc_json.php')
-rw-r--r--lib/JSON/inc_json.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/JSON/inc_json.php b/lib/JSON/inc_json.php
new file mode 100644
index 0000000..b36c2a4
--- /dev/null
+++ b/lib/JSON/inc_json.php
@@ -0,0 +1,22 @@
+<?php
+
+if (!function_exists('json_decode')) {
+ function json_decode($content, $assoc=false) {
+ require_once 'lib/JSON/JSON.php';
+ if ($assoc) {
+ $json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
+ }
+ else {
+ $json = new Services_JSON;
+ }
+ return $json->decode($content);
+ }
+}
+
+if (!function_exists('json_encode')) {
+ function json_encode($content) {
+ require_once 'lib/JSON/JSON.php';
+ $json = new Services_JSON;
+ return $json->encode($content);
+ }
+}