X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=vendor%2Fzendframework%2Fzend-diactoros%2Fsrc%2Ffunctions%2Fmarshal_uri_from_sapi.php;fp=vendor%2Fzendframework%2Fzend-diactoros%2Fsrc%2Ffunctions%2Fmarshal_uri_from_sapi.php;h=decaafb835b55cb5abe83374f73919fee1e9d15f;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=0000000000000000000000000000000000000000;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/vendor/zendframework/zend-diactoros/src/functions/marshal_uri_from_sapi.php b/vendor/zendframework/zend-diactoros/src/functions/marshal_uri_from_sapi.php new file mode 100644 index 000000000..decaafb83 --- /dev/null +++ b/vendor/zendframework/zend-diactoros/src/functions/marshal_uri_from_sapi.php @@ -0,0 +1,212 @@ +withScheme($scheme); + + // Set the host + list($host, $port) = $marshalHostAndPort($headers, $server); + if (! empty($host)) { + $uri = $uri->withHost($host); + if (! empty($port)) { + $uri = $uri->withPort($port); + } + } + + // URI path + $path = $marshalRequestPath($server); + + // Strip query string + $path = explode('?', $path, 2)[0]; + + // URI query + $query = ''; + if (isset($server['QUERY_STRING'])) { + $query = ltrim($server['QUERY_STRING'], '?'); + } + + // URI fragment + $fragment = ''; + if (strpos($path, '#') !== false) { + list($path, $fragment) = explode('#', $path, 2); + } + + return $uri + ->withPath($path) + ->withFragment($fragment) + ->withQuery($query); +}