From 08c8311fb5e8b60b602901321355429cfbb7a3dc Mon Sep 17 00:00:00 2001 From: kerphi Date: Sat, 10 Mar 2007 11:30:38 +0000 Subject: [PATCH] check that Services_JSON is not already defined by an external program git-svn-id: https://phpfreechat.svn.sourceforge.net/svnroot/phpfreechat/trunk@994 2772adf2-ac07-0410-9d30-e29d8120292e --- src/pfcjson.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pfcjson.class.php b/src/pfcjson.class.php index 7a0acb6f..14c1055c 100644 --- a/src/pfcjson.class.php +++ b/src/pfcjson.class.php @@ -28,7 +28,8 @@ function pfcJSON() { // if the php5-json module is not available, use a software json implementation if (!function_exists('json_encode')) { - require_once(dirname(__FILE__)."/../lib/json/JSON.php"); + if (!class_exists('Services_JSON')) + require_once(dirname(__FILE__)."/../lib/json/JSON.php"); $this->json = new Services_JSON(); } }