Verified Commit d068252d authored by Cyril Vazquez's avatar Cyril Vazquez
Browse files

Json decode body params

parent d8c93714
Pipeline #6568 failed with stages
......@@ -32,20 +32,16 @@ class json
/**
* Decode a json contents into an associative array of parameters
* @param string $json
* @param string $params
*
* @return mixed
*/
public static function decode($json)
public static function decode($params)
{
$data = \json_decode($json);
$params = \json_decode($params);
$params = array();
if ($data) {
foreach ($data as $name => $value) {
$params[$name] = $value;
}
if (is_object($params)) {
$params = get_object_vars($params);
}
return $params;
......
......@@ -154,8 +154,9 @@ trait archiveEntryTrait
}
} elseif (is_resource($receivedHandler)) {
$handler = fopen('php://temp', 'r+');
stream_filter_append($handler, 'convert.base64-decode');
$filter = stream_filter_append($handler, 'convert.base64-decode', STREAM_FILTER_WRITE);
stream_copy_to_stream($receivedHandler, $handler);
stream_filter_remove($filter);
rewind($handler);
}
......
......@@ -48,7 +48,7 @@ switch (true) {
case !\laabs::isServiceClient():
\core\Kernel\PresentationKernel::start();
\core\Kernel\PresentationKernel::run();
\laabs::log($_SERVER['REQUEST_METHOD'].' '.$_SERVER['SCRIPT_NAME'].' : '.round(memory_get_peak_usage()/1048576));
//\laabs::log($_SERVER['REQUEST_METHOD'].' '.$_SERVER['SCRIPT_NAME'].' : '.round(memory_get_peak_usage()/1048576));
\core\Kernel\PresentationKernel::end();
break;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment