case 'GET':
case 'POST':
self::$data = array_merge(self::$data,$_GET);
if (count($_POST)) {
if (count($_FILES))
self::$data = array_merge(self::$data,array_merge($_POST, $_FILES));
else
self::$data = array_merge(self::$data,$_POST);
} else
self::$data =
array_merge(self::$data,json_decode(file_get_contents("php://input"), true));
break;
/**
* Set params
*/
public static function setParams()
{
self::$method = $_SERVER['REQUEST_METHOD'];
switch (self::$method) {
case 'GET':
self::$data = array_merge(self::$data,$_GET);
break;
case 'POST':
if (count($_POST)) {
if (count($_FILES))
self::$data = array_merge(self::$data,array_merge($_POST, $_FILES));
else
self::$data = array_merge(self::$data,$_POST);
} else
self::$data =
array_merge(self::$data,json_decode(file_get_contents("php://input"), true));
break;
case 'PUT':
case 'PATCH':
case 'DELETE':
self::$data =
array_merge(self::$data,json_decode(file_get_contents("php://input"), true));
break;
}
}