From 2247a9760d385c722646b4460ee890f090705150 Mon Sep 17 00:00:00 2001 From: Kentaro Ohkouchi Date: Fri, 15 Feb 2019 17:52:05 +0900 Subject: [PATCH] Delete to Services_JSON --- composer.json | 1 - composer.lock | 47 +------------------ .../upgrade/helper/LC_Upgrade_Helper_Json.php | 7 ++- data/class/util/SC_Utils.php | 26 ++-------- 4 files changed, 8 insertions(+), 73 deletions(-) diff --git a/composer.json b/composer.json index b86037ebe3..ef054aa308 100644 --- a/composer.json +++ b/composer.json @@ -29,7 +29,6 @@ "bondas83/mdb2_driver_mysqli": "^1.5", "mobiledetect/mobiledetectlib": "^2.8", "nanasess/mdb2_driver_pgsql": "^1.5", - "nanasess/services_json": "*", "pear/archive_tar": "^1.4.3", "pear/mail": "*", "pear/pear-core-minimal": "^1.10", diff --git a/composer.lock b/composer.lock index f3f7b14d1c..eb628801e3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ad610dbe7ebfd303381181f01c6dc5ef", + "content-hash": "a880c19c82773600ed49e9fa8a175e07", "packages": [ { "name": "bondas83/mdb2_driver_mysqli", @@ -160,51 +160,6 @@ "description": "This is the PostgreSQL MDB2 driver.", "time": "2019-02-05T06:25:36+00:00" }, - { - "name": "nanasess/services_json", - "version": "1.0.3", - "source": { - "type": "git", - "url": "https://github.com/nanasess/Services_JSON.git", - "reference": "8bc15c1fe5eb1d696be700d9b8ce51492bac534f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nanasess/Services_JSON/zipball/8bc15c1fe5eb1d696be700d9b8ce51492bac534f", - "reference": "8bc15c1fe5eb1d696be700d9b8ce51492bac534f", - "shasum": "" - }, - "require": { - "pear/pear_exception": "*" - }, - "require-dev": { - "phpunit/phpunit": "*" - }, - "type": "library", - "autoload": { - "classmap": [ - "./" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD" - ], - "authors": [ - { - "name": "Michal Migurski", - "email": "migurski@php.net", - "role": "Lead" - }, - { - "name": "Alan Knowles", - "email": "alan@akbkhome.com", - "role": "Lead" - } - ], - "description": "More info available on: http://pear.php.net/package/Services_JSON", - "time": "2019-02-05T02:36:13+00:00" - }, { "name": "pear/archive_tar", "version": "1.4.3", diff --git a/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php b/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php index 576cb41ada..8eb64a914b 100644 --- a/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php +++ b/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php @@ -3,7 +3,7 @@ * Enter description here... * */ -class LC_Upgrade_Helper_Json extends Services_JSON +class LC_Upgrade_Helper_Json { /** */ public $arrData = array( @@ -20,7 +20,6 @@ class LC_Upgrade_Helper_Json extends Services_JSON */ public function __construct() { - parent::Services_JSON(); } /** @@ -77,7 +76,7 @@ public function setSuccess($data = array(), $msg = '') public function display() { header('Content-Type: text/javascript; charset=UTF-8'); - echo $this->encode($this->arrData); + echo json_encode($this->arrData); } /** @@ -93,6 +92,6 @@ public function display() */ public function decode($str) { - return SC_Utils_Ex::jsonDecode($str); + return json_decode($str); } } diff --git a/data/class/util/SC_Utils.php b/data/class/util/SC_Utils.php index 6004d1c818..c2f191883b 100755 --- a/data/class/util/SC_Utils.php +++ b/data/class/util/SC_Utils.php @@ -1764,9 +1764,7 @@ public static function sfGetSearchPageMax($search_page_max) /** * 値を JSON 形式にして返す. * - * この関数は, json_encode() 又は Services_JSON::encode() のラッパーです. - * json_encode() 関数が使用可能な場合は json_encode() 関数を使用する. - * 使用できない場合は, Services_JSON::encode() 関数を使用する. + * この関数は, json_encode() のラッパーです. * * @param mixed $value JSON 形式にエンコードする値 * @return string JSON 形式にした文字列 @@ -1775,22 +1773,13 @@ public static function sfGetSearchPageMax($search_page_max) */ public static function jsonEncode($value) { - if (function_exists('json_encode')) { - return json_encode($value); - } else { - GC_Utils_Ex::gfPrintLog(' *use Services_JSON::encode(). faster than using the json_encode!'); - $objJson = new Services_JSON(); - - return $objJson->encode($value); - } + return json_encode($value); } /** * JSON 文字列をデコードする. * - * この関数は, json_decode() 又は Services_JSON::decode() のラッパーです. - * json_decode() 関数が使用可能な場合は json_decode() 関数を使用する. - * 使用できない場合は, Services_JSON::decode() 関数を使用する. + * この関数は, json_decode() のラッパーです. * * @param string $json JSON 形式にエンコードされた文字列 * @return mixed デコードされた PHP の型 @@ -1799,14 +1788,7 @@ public static function jsonEncode($value) */ public static function jsonDecode($json) { - if (function_exists('json_decode')) { - return json_decode($json); - } else { - GC_Utils_Ex::gfPrintLog(' *use Services_JSON::decode(). faster than using the json_decode!'); - $objJson = new Services_JSON(); - - return $objJson->decode($json); - } + return json_decode($json); } /**