Improved/optimized CDR engine reports (and patient reminders) and added a
[openemr.git] / library / jsonwrapper / jsonwrapper_inner.php
blob6dcd78697a1e8335064baa07a1c6c49be89ec9c5
1 <?php
2 /**
3 * jsonwrapper
5 * jsonwrapper implements the json_encode function if it is missing,
6 * and leaves it alone if it is already present. So it is nicely
7 * future-compatible.
9 * This script was downloaded on 9/27/2012 from
10 * http://www.boutell.com/scripts/jsonwrapper.html and has
11 * been released into the public domain. The following quote was
12 * taken from the above page:
13 * "jsonwrapper itself is hereby released into the public domain. However,
14 * it is a simple wrapper around M. Migurski's PEAR JSON library, which has
15 * its own free license."
17 * @package Services_JSON
18 * @link http://www.open-emr.org
21 require_once 'JSON/JSON.php';
23 function json_encode($arg)
25 global $services_json;
26 if (!isset($services_json)) {
27 $services_json = new Services_JSON();
29 return $services_json->encode($arg);
32 function json_decode($arg)
34 global $services_json;
35 if (!isset($services_json)) {
36 $services_json = new Services_JSON();
38 return $services_json->decode($arg);