Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Dev Fixed issue #07758: Remote API fails
  • Loading branch information
SamMousa committed Apr 11, 2013
1 parent eace7f0 commit a0e95ba
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions application/libraries/BigData.php
Expand Up @@ -96,6 +96,10 @@ protected static function json_echo_data($json)
{
self::json_echo_string($json);
}
elseif (is_null($json))
{
echo json_encode(null);
}
}

protected static function json_echo_array($json)
Expand All @@ -118,11 +122,17 @@ protected static function json_echo_number($json)
protected static function json_echo_object($json)
{
echo '{';
end($json);
$lastKey = key($json);
reset($json);
foreach ($json as $key => $entry)
{
echo json_encode($key) . ':';
self::json_echo_data($entry);
echo ', '; // The extra comma is allowed: { 1: 'test', 2: 'test',} is valid.
if ($lastKey !== $key)
{
echo ', '; // The extra comma is allowed: { 1: 'test', 2: 'test',} is valid.
}
}
echo '}';
}
Expand Down Expand Up @@ -223,8 +233,7 @@ protected static function xmlrpc_echo_object($data)
protected static function xmlrpc_echo_stream($data)
{
echo '<base64>';
echo $data->fileName;
//stream_filter_append($data, 'convert.base64-encode', STREAM_FILTER_READ, array('line-length' => 50, 'line-break-chars' => "\n"));
stream_filter_append($data, 'convert.base64-encode', STREAM_FILTER_READ);

echo '</base64>';
}
Expand Down Expand Up @@ -268,7 +277,7 @@ public function render($type = null)
protected function echo_base64()
{
$fileHandle = fopen($this->fileName, 'r');
stream_filter_append($fileHandle, 'convert.base64-encode', STREAM_FILTER_READ, array('line-length' => 50, 'line-break-chars' => "\n"));
stream_filter_append($fileHandle, 'convert.base64-encode', STREAM_FILTER_READ);
fpassthru($fileHandle);
fclose($fileHandle);
}
Expand Down

0 comments on commit a0e95ba

Please sign in to comment.