Subversion Repositories cryptochat

Rev

Rev 2 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. require_once 'JSON/JSON.php';
  4.  
  5. if (!function_exists('json_encode')) {
  6.         function json_encode($arg) {
  7.                 global $services_json;
  8.                 if (!isset($services_json)) {
  9.                         $services_json = new Services_JSON();
  10.                 }
  11.                 return $services_json->encode($arg);
  12.         }
  13. }
  14.  
  15. if (!function_exists('json_decode')) {
  16.         function json_decode($arg) {
  17.                 global $services_json;
  18.                 if (!isset($services_json)) {
  19.                         $services_json = new Services_JSON();
  20.                 }
  21.                 return $services_json->decode($arg);
  22.         }
  23. }
  24.