Skip to content

Commit

Permalink
Delete to Services_JSON
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess committed Feb 15, 2019
1 parent 5dbb816 commit 2247a97
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 73 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
47 changes: 1 addition & 46 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Enter description here...
*
*/
class LC_Upgrade_Helper_Json extends Services_JSON
class LC_Upgrade_Helper_Json
{
/** */
public $arrData = array(
Expand All @@ -20,7 +20,6 @@ class LC_Upgrade_Helper_Json extends Services_JSON
*/
public function __construct()
{
parent::Services_JSON();
}

/**
Expand Down Expand Up @@ -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);
}

/**
Expand All @@ -93,6 +92,6 @@ public function display()
*/
public function decode($str)
{
return SC_Utils_Ex::jsonDecode($str);
return json_decode($str);
}
}
26 changes: 4 additions & 22 deletions data/class/util/SC_Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 形式にした文字列
Expand All @@ -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 の型
Expand All @@ -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);
}

/**
Expand Down

0 comments on commit 2247a97

Please sign in to comment.