BUG 8973 "Replace all instances of json_encode() and json_decode()..." SOLVED
- Problems with functions json_encode and json_decode in PHP 5.2 - Replace json_encode and json_decode with G::json_encode and G::json_decode
This commit is contained in:
@@ -27,7 +27,7 @@ try {
|
|||||||
list($userNum, $user) = userGet($limit, $start);
|
list($userNum, $user) = userGet($limit, $start);
|
||||||
|
|
||||||
//echo "{success: " . true . ", resultTotal: " . count($user) . ", resultRoot: " . G::json_encode($user) . "}";
|
//echo "{success: " . true . ", resultTotal: " . count($user) . ", resultRoot: " . G::json_encode($user) . "}";
|
||||||
echo json_encode(array("success" => true, "resultTotal" => $userNum, "resultRoot" => $user));
|
echo G::json_encode(array("success" => true, "resultTotal" => $userNum, "resultRoot" => $user));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//echo "{success: " . true . ", resultTotal: " . count($aResult) . ", resultRoot: " . G::json_encode($aResult) . "}";
|
//echo "{success: " . true . ", resultTotal: " . count($aResult) . ", resultRoot: " . G::json_encode($aResult) . "}";
|
||||||
echo json_encode(array("success" => true, "resultTotal" => count($aResult), "resultRoot" => $aResult));
|
echo G::json_encode(array("success" => true, "resultTotal" => count($aResult), "resultRoot" => $aResult));
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
echo null;
|
echo null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ function cancelCheckout($alfrescoServerUrl, $docUid, $user="", $pwd="") {
|
|||||||
$alfresco_url = "$alfrescoServerUrl/s/cmis/pwc/s/workspace:SpacesStore/i/$docUid";
|
$alfresco_url = "$alfrescoServerUrl/s/cmis/pwc/s/workspace:SpacesStore/i/$docUid";
|
||||||
$domapi_exec = RestClient::delete($alfresco_url,$user,$pwd,"application/atom+xml;type=entry");
|
$domapi_exec = RestClient::delete($alfresco_url,$user,$pwd,"application/atom+xml;type=entry");
|
||||||
//$alfrescoMessage = $domapi_exec['header'];
|
//$alfrescoMessage = $domapi_exec['header'];
|
||||||
$domapi_res = json_decode($domapi_exec->getResponse());
|
$domapi_res = G::json_decode($domapi_exec->getResponse());
|
||||||
return $domapi_res;
|
return $domapi_res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ function deleteObject($alfrescoServerUrl, $objetcId, $user, $pwd) {
|
|||||||
$alfresco_url = "$alfrescoServerUrl/s/cmis/s/workspace:SpacesStore/i/$objetcId";
|
$alfresco_url = "$alfrescoServerUrl/s/cmis/s/workspace:SpacesStore/i/$objetcId";
|
||||||
$alfresco_exec = RestClient::delete($alfresco_url,$user,$pwd,"application/atom+xml");
|
$alfresco_exec = RestClient::delete($alfresco_url,$user,$pwd,"application/atom+xml");
|
||||||
|
|
||||||
$alfresco_res = json_decode($alfresco_exec->getResponse());
|
$alfresco_res = G::json_decode($alfresco_exec->getResponse());
|
||||||
echo($alfresco_res);
|
echo($alfresco_res);
|
||||||
return $alfresco_res;
|
return $alfresco_res;
|
||||||
}
|
}
|
||||||
@@ -195,7 +195,7 @@ function deleteObject($alfrescoServerUrl, $objetcId, $user, $pwd) {
|
|||||||
function downloadDoc($alfrescoServerUrl, $parentFolder, $folderName, $user, $pwd) {
|
function downloadDoc($alfrescoServerUrl, $parentFolder, $folderName, $user, $pwd) {
|
||||||
$alfresco_url = "$alfrescoServerUrl/s/cmis/s/workspace:SpacesStore/i/$objetcId";
|
$alfresco_url = "$alfrescoServerUrl/s/cmis/s/workspace:SpacesStore/i/$objetcId";
|
||||||
$alfresco_exec = RestClient::delete($alfresco,$user,$pwd,"application/atom+xml");
|
$alfresco_exec = RestClient::delete($alfresco,$user,$pwd,"application/atom+xml");
|
||||||
$alfresco_res = json_decode($alfresco_exec->getResponse());
|
$alfresco_res = G::json_decode($alfresco_exec->getResponse());
|
||||||
echo($alfresco_res);
|
echo($alfresco_res);
|
||||||
return $alfresco_res;
|
return $alfresco_res;
|
||||||
}
|
}
|
||||||
@@ -219,10 +219,10 @@ function getCheckedoutFiles($alfrescoServerUrl, $user, $pwd) {
|
|||||||
$getChildrenUrl = "$alfrescoServerUrl/s/cmis/checkedout";
|
$getChildrenUrl = "$alfrescoServerUrl/s/cmis/checkedout";
|
||||||
|
|
||||||
$domapi_exec = RestClient::get($getChildrenUrl,$user,$pwd,'application/atom+xml');
|
$domapi_exec = RestClient::get($getChildrenUrl,$user,$pwd,'application/atom+xml');
|
||||||
$sXmlArray = json_decode($domapi_exec->getResponse());
|
$sXmlArray = G::json_decode($domapi_exec->getResponse());
|
||||||
$sXmlArray = trim($sXmlArray);
|
$sXmlArray = trim($sXmlArray);
|
||||||
$xXmlArray = simplexml_load_string($sXmlArray);
|
$xXmlArray = simplexml_load_string($sXmlArray);
|
||||||
$aXmlArray = @json_decode(@json_encode($xXmlArray),1);
|
$aXmlArray = @G::json_decode(@G::json_encode($xXmlArray),1);
|
||||||
var_dump($aXmlArray);
|
var_dump($aXmlArray);
|
||||||
|
|
||||||
return $alfresco_res;
|
return $alfresco_res;
|
||||||
@@ -250,7 +250,7 @@ function getFolderChildren($alfrescoServerUrl, $folderId, $user, $pwd) {
|
|||||||
$sXmlArray = $alfresco_exec->getResponse();
|
$sXmlArray = $alfresco_exec->getResponse();
|
||||||
$sXmlArray = trim($sXmlArray);
|
$sXmlArray = trim($sXmlArray);
|
||||||
$xXmlArray = simplexml_load_string($sXmlArray);
|
$xXmlArray = simplexml_load_string($sXmlArray);
|
||||||
$aXmlArray = @json_decode(@json_encode($xXmlArray),1);
|
$aXmlArray = @G::json_decode(@G::json_encode($xXmlArray),1);
|
||||||
//var_dump($aXmlArray);
|
//var_dump($aXmlArray);
|
||||||
var_dump($aXmlArray);
|
var_dump($aXmlArray);
|
||||||
|
|
||||||
@@ -290,7 +290,7 @@ function uploadDoc($alfrescoServerUrl, $fileSource, $title, $description, $docTy
|
|||||||
$sXmlArray = $alfresco_exec->getResponse();
|
$sXmlArray = $alfresco_exec->getResponse();
|
||||||
$sXmlArray = trim($sXmlArray);
|
$sXmlArray = trim($sXmlArray);
|
||||||
$xXmlArray = simplexml_load_string($sXmlArray);
|
$xXmlArray = simplexml_load_string($sXmlArray);
|
||||||
$aXmlArray = @json_decode(@json_encode($xXmlArray),1);
|
$aXmlArray = @G::json_decode(@G::json_encode($xXmlArray),1);
|
||||||
var_dump($aXmlArray);
|
var_dump($aXmlArray);
|
||||||
return $aXmlArray;
|
return $aXmlArray;
|
||||||
}
|
}
|
||||||
@@ -311,7 +311,7 @@ function getDWSDocumentVersions($sharepointServer, $auth, $newFileName, $dwsname
|
|||||||
*/
|
*/
|
||||||
$xml = $result->GetVersionsResult->any;// in Result we get string in Xml format
|
$xml = $result->GetVersionsResult->any;// in Result we get string in Xml format
|
||||||
$xmlNew = simplexml_load_string($xml);// used to parse string to xml
|
$xmlNew = simplexml_load_string($xml);// used to parse string to xml
|
||||||
$xmlArray = @json_decode(@json_encode($xmlNew),1);// used to convert Objects to array
|
$xmlArray = @G::json_decode(@G::json_encode($xmlNew),1);// used to convert Objects to array
|
||||||
$resultCount = count($xmlArray['result']);
|
$resultCount = count($xmlArray['result']);
|
||||||
for($i=0;$i<$resultCount;$i++)
|
for($i=0;$i<$resultCount;$i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -109,7 +109,7 @@ class pmTrSharepointClass{
|
|||||||
$result = $this->dwsObj->callWsMethod($methodName, $paramArray);
|
$result = $this->dwsObj->callWsMethod($methodName, $paramArray);
|
||||||
$xml = $result->CreateDwsResult; // in Result we get string in Xml format
|
$xml = $result->CreateDwsResult; // in Result we get string in Xml format
|
||||||
$xmlNew = simplexml_load_string($xml); // used to parse string to xml
|
$xmlNew = simplexml_load_string($xml); // used to parse string to xml
|
||||||
$xmlArray = @json_decode(@json_encode($xmlNew), 1); // used to convert Objects to array
|
$xmlArray = @G::json_decode(@G::json_encode($xmlNew), 1); // used to convert Objects to array
|
||||||
$dwsUrl = $xmlArray['Url'];
|
$dwsUrl = $xmlArray['Url'];
|
||||||
return "Dws with following Url is created:$dwsUrl";
|
return "Dws with following Url is created:$dwsUrl";
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ class pmTrSharepointClass{
|
|||||||
var_dump($result);
|
var_dump($result);
|
||||||
$sResult = $result->GetDwsDataResult;
|
$sResult = $result->GetDwsDataResult;
|
||||||
/* $xmlNew = simplexml_load_string($sResult);// used to parse string to xml
|
/* $xmlNew = simplexml_load_string($sResult);// used to parse string to xml
|
||||||
$xmlArray = @json_decode(@json_encode($xmlNew),1);// used to convert Objects to array */
|
$xmlArray = @G::json_decode(@G::json_encode($xmlNew),1);// used to convert Objects to array */
|
||||||
$serializeResult = serialize($sResult); // serializing the Array for Returning.
|
$serializeResult = serialize($sResult); // serializing the Array for Returning.
|
||||||
var_dump($serializeResult);
|
var_dump($serializeResult);
|
||||||
return $serializeResult;
|
return $serializeResult;
|
||||||
@@ -301,7 +301,7 @@ class pmTrSharepointClass{
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$sResult = $result->DeleteVersionResult->any;
|
$sResult = $result->DeleteVersionResult->any;
|
||||||
$xmlNew = simplexml_load_string($sResult); // used to parse string to xml
|
$xmlNew = simplexml_load_string($sResult); // used to parse string to xml
|
||||||
$xmlArray = @json_decode(@json_encode($xmlNew), 1); // used to convert Objects to array
|
$xmlArray = @G::json_decode(@G::json_encode($xmlNew), 1); // used to convert Objects to array
|
||||||
$versionCount = count($xmlArray['result']);
|
$versionCount = count($xmlArray['result']);
|
||||||
|
|
||||||
if($versionCount>1)
|
if($versionCount>1)
|
||||||
@@ -338,7 +338,7 @@ class pmTrSharepointClass{
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
$xml = $result->DeleteAllVersionsResult->any; // in Result we get string in Xml format
|
$xml = $result->DeleteAllVersionsResult->any; // in Result we get string in Xml format
|
||||||
$xmlNew = simplexml_load_string($xml); // used to parse string to xml
|
$xmlNew = simplexml_load_string($xml); // used to parse string to xml
|
||||||
$xmlArray = @json_decode(@json_encode($xmlNew), 1); // used to convert Objects to array
|
$xmlArray = @G::json_decode(@G::json_encode($xmlNew), 1); // used to convert Objects to array
|
||||||
$latestVersion = $xmlArray['result']['@attributes']['version'];
|
$latestVersion = $xmlArray['result']['@attributes']['version'];
|
||||||
return "All Versions are Deleted, except the latest i.e $latestVersion";
|
return "All Versions are Deleted, except the latest i.e $latestVersion";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ function getZimbraFolder($ServerUrl, $username, $preAuthKey, $folderName) {
|
|||||||
|
|
||||||
$aXmlArray = array();
|
$aXmlArray = array();
|
||||||
$aXmlArray = $zimbra->getFolder($folderName);
|
$aXmlArray = $zimbra->getFolder($folderName);
|
||||||
$sXmlArray = @json_decode(@json_encode($aXmlArray), 1);
|
$sXmlArray = @G::json_decode(@G::json_encode($aXmlArray), 1);
|
||||||
|
|
||||||
$serializeResult = serialize($sXmlArray); // serializing the Array for Returning.
|
$serializeResult = serialize($sXmlArray); // serializing the Array for Returning.
|
||||||
return $serializeResult;
|
return $serializeResult;
|
||||||
@@ -84,7 +84,7 @@ function getZimbraContactList($ServerUrl, $username, $preAuthKey) {
|
|||||||
|
|
||||||
$sXmlArray = array();
|
$sXmlArray = array();
|
||||||
$sXmlArray = $zimbra->getContacts();
|
$sXmlArray = $zimbra->getContacts();
|
||||||
$aXmlArray = @json_decode(@json_encode($sXmlArray), 1);
|
$aXmlArray = @G::json_decode(@G::json_encode($sXmlArray), 1);
|
||||||
|
|
||||||
$serializeResult = serialize($aXmlArray); // serializing the Array for Returning.
|
$serializeResult = serialize($aXmlArray); // serializing the Array for Returning.
|
||||||
return $serializeResult;
|
return $serializeResult;
|
||||||
@@ -119,7 +119,7 @@ function getZimbraTaskList($ServerUrl, $username, $preAuthKey) {
|
|||||||
|
|
||||||
$sXmlArray = array();
|
$sXmlArray = array();
|
||||||
$sXmlArray = $zimbra->getTasks();
|
$sXmlArray = $zimbra->getTasks();
|
||||||
$aXmlArray = @json_decode(@json_encode($sXmlArray), 1);
|
$aXmlArray = @G::json_decode(@G::json_encode($sXmlArray), 1);
|
||||||
|
|
||||||
$serializeResult = serialize($aXmlArray); // serializing the Array for Returning.
|
$serializeResult = serialize($aXmlArray); // serializing the Array for Returning.
|
||||||
return $serializeResult;
|
return $serializeResult;
|
||||||
@@ -154,7 +154,7 @@ function getZimbraAppointmentList($ServerUrl, $username, $preAuthKey) {
|
|||||||
|
|
||||||
$sXmlArray = array();
|
$sXmlArray = array();
|
||||||
$sXmlArray = $zimbra->getAppointments();
|
$sXmlArray = $zimbra->getAppointments();
|
||||||
$aXmlArray = @json_decode(@json_encode($sXmlArray), 1);
|
$aXmlArray = @G::json_decode(@G::json_encode($sXmlArray), 1);
|
||||||
|
|
||||||
$serializeResult = serialize($aXmlArray); // serializing the Array for Returning.
|
$serializeResult = serialize($aXmlArray); // serializing the Array for Returning.
|
||||||
return $serializeResult;
|
return $serializeResult;
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class adminProxy extends HttpProxyController
|
|||||||
function uxUserUpdate($httpData)
|
function uxUserUpdate($httpData)
|
||||||
{
|
{
|
||||||
require_once 'classes/model/Users.php';
|
require_once 'classes/model/Users.php';
|
||||||
$data = json_decode($httpData->users);
|
$data = G::json_decode($httpData->users);
|
||||||
$list = array();
|
$list = array();
|
||||||
|
|
||||||
if (!is_array($data)) {
|
if (!is_array($data)) {
|
||||||
@@ -145,7 +145,7 @@ class adminProxy extends HttpProxyController
|
|||||||
function uxGroupUpdate($httpData)
|
function uxGroupUpdate($httpData)
|
||||||
{
|
{
|
||||||
require_once 'classes/model/Groupwf.php';
|
require_once 'classes/model/Groupwf.php';
|
||||||
$data = (array) json_decode($httpData->groups);
|
$data = (array) G::json_decode($httpData->groups);
|
||||||
|
|
||||||
$group = GroupwfPeer::retrieveByPK($data['GRP_UID']);
|
$group = GroupwfPeer::retrieveByPK($data['GRP_UID']);
|
||||||
$group->setGrpUx($data['GRP_UX']);
|
$group->setGrpUx($data['GRP_UX']);
|
||||||
@@ -715,7 +715,7 @@ class adminProxy extends HttpProxyController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$o = array('images' => $images);
|
$o = array('images' => $images);
|
||||||
echo json_encode($o);
|
echo G::json_encode($o);
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ function getExtJSParams() {
|
|||||||
|
|
||||||
function sendJsonResultGeneric($response, $callback) {
|
function sendJsonResultGeneric($response, $callback) {
|
||||||
header("Content-Type: application/json");
|
header("Content-Type: application/json");
|
||||||
$finalResponse = json_encode($response);
|
$finalResponse = G::json_encode($response);
|
||||||
if ($callback != '') {
|
if ($callback != '') {
|
||||||
print $callback . "($finalResponse);";
|
print $callback . "($finalResponse);";
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user