add workaround for cli webserver, option implemented in client
This commit is contained in:
parent
9f9bab242d
commit
b5af83f9d2
|
@ -32,10 +32,21 @@ class SoapRequest extends CommonSoapRequest
|
||||||
*/
|
*/
|
||||||
public static function create($content, $version)
|
public static function create($content, $version)
|
||||||
{
|
{
|
||||||
$content = is_null($content) ? file_get_contents("php://input") : $content;
|
|
||||||
$location = self::getCurrentUrl();
|
$location = self::getCurrentUrl();
|
||||||
|
/*
|
||||||
|
* Work around missing header/php://input access in PHP cli webserver by
|
||||||
|
* setting headers additionally as GET parameters and SOAP request body
|
||||||
|
* explicitly as POST variable
|
||||||
|
*/
|
||||||
|
if (php_sapi_name() == "cli-server") {
|
||||||
|
$content = is_null($content) ? $_POST['request'] : $content;
|
||||||
|
$action = $_GET[SoapMessage::SOAP_ACTION_HEADER];
|
||||||
|
$contentType = $_GET[SoapMessage::CONTENT_TYPE_HEADER];
|
||||||
|
} else {
|
||||||
|
$content = is_null($content) ? file_get_contents("php://input") : $content;
|
||||||
$action = $_SERVER[SoapMessage::SOAP_ACTION_HEADER];
|
$action = $_SERVER[SoapMessage::SOAP_ACTION_HEADER];
|
||||||
$contentType = $_SERVER[SoapMessage::CONTENT_TYPE_HEADER];
|
$contentType = $_SERVER[SoapMessage::CONTENT_TYPE_HEADER];
|
||||||
|
}
|
||||||
|
|
||||||
$request = new SoapRequest();
|
$request = new SoapRequest();
|
||||||
// $content is if unmodified from SoapClient not a php string type!
|
// $content is if unmodified from SoapClient not a php string type!
|
||||||
|
|
Loading…
Reference in New Issue