Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
6 changed files
with
278 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,211 @@ | ||
<?php | ||
|
||
namespace SimpleSAML\Utils; | ||
|
||
/** | ||
* Provides a non-static wrapper for the HTTP utility class. | ||
* | ||
* @package SimpleSAML\Utils | ||
*/ | ||
class HttpAdapter | ||
{ | ||
/** | ||
* @see HTTP::getServerHTTPS() | ||
*/ | ||
public function getServerHTTPS() | ||
{ | ||
return HTTP::getServerHTTPS(); | ||
} | ||
|
||
/** | ||
* @see HTTP::getServerPort() | ||
*/ | ||
public function getServerPort() | ||
{ | ||
return HTTP::getServerPort(); | ||
} | ||
|
||
/** | ||
* @see HTTP::addURLParameters() | ||
*/ | ||
public function addURLParameters($url, $parameters) | ||
{ | ||
return HTTP::addURLParameters($url, $parameters); | ||
} | ||
|
||
/** | ||
* @see HTTP::checkSessionCookie() | ||
*/ | ||
public function checkSessionCookie($retryURL = null) | ||
{ | ||
HTTP::checkSessionCookie($retryURL); | ||
} | ||
|
||
/** | ||
* @see HTTP::checkURLAllowed() | ||
*/ | ||
public function checkURLAllowed($url, array $trustedSites = null) | ||
{ | ||
return HTTP::checkURLAllowed($url, $trustedSites); | ||
} | ||
|
||
/** | ||
* @see HTTP::fetch() | ||
*/ | ||
public function fetch($url, $context = array(), $getHeaders = false) | ||
{ | ||
return HTTP::fetch($url, $context, $getHeaders); | ||
} | ||
|
||
/** | ||
* @see HTTP::getAcceptLanguage() | ||
*/ | ||
public function getAcceptLanguage() | ||
{ | ||
return HTTP::getAcceptLanguage(); | ||
} | ||
|
||
/** | ||
* @see HTTP::guessBasePath() | ||
*/ | ||
public function guessBasePath() | ||
{ | ||
return HTTP::guessBasePath(); | ||
} | ||
|
||
/** | ||
* @see HTTP::getBaseURL() | ||
*/ | ||
public function getBaseURL() | ||
{ | ||
return HTTP::getBaseURL(); | ||
} | ||
|
||
/** | ||
* @see HTTP::getFirstPathElement() | ||
*/ | ||
public function getFirstPathElement($trailingslash = true) | ||
{ | ||
return HTTP::getFirstPathElement($trailingslash); | ||
} | ||
|
||
/** | ||
* @see HTTP::getPOSTRedirectURL() | ||
*/ | ||
public function getPOSTRedirectURL($destination, $data) | ||
{ | ||
return HTTP::getPOSTRedirectURL($destination, $data); | ||
} | ||
|
||
/** | ||
* @see HTTP::getSelfHost() | ||
*/ | ||
public function getSelfHost() | ||
{ | ||
return HTTP::getSelfHost(); | ||
} | ||
|
||
/** | ||
* @see HTTP::getSelfHostWithNonStandardPort() | ||
*/ | ||
public function getSelfHostWithNonStandardPort() | ||
{ | ||
return HTTP::getSelfHostWithNonStandardPort(); | ||
} | ||
|
||
/** | ||
* @see HTTP::getSelfHostWithPath() | ||
*/ | ||
public function getSelfHostWithPath() | ||
{ | ||
return HTTP::getSelfHostWithPath(); | ||
} | ||
|
||
/** | ||
* @see HTTP::getSelfURL() | ||
*/ | ||
public function getSelfURL() | ||
{ | ||
return HTTP::getSelfURL(); | ||
} | ||
|
||
/** | ||
* @see HTTP::getSelfURLHost() | ||
*/ | ||
public function getSelfURLHost() | ||
{ | ||
return HTTP::getSelfURLHost(); | ||
} | ||
|
||
/** | ||
* @see HTTP::getSelfURLNoQuery() | ||
*/ | ||
public function getSelfURLNoQuery() | ||
{ | ||
return HTTP::getSelfURLNoQuery(); | ||
} | ||
|
||
/** | ||
* @see HTTP::isHTTPS() | ||
*/ | ||
public function isHTTPS() | ||
{ | ||
return HTTP::isHTTPS(); | ||
} | ||
|
||
/** | ||
* @see HTTP::normalizeURL() | ||
*/ | ||
public function normalizeURL($url) | ||
{ | ||
return HTTP::normalizeURL($url); | ||
} | ||
|
||
/** | ||
* @see HTTP::parseQueryString() | ||
*/ | ||
public function parseQueryString($query_string) | ||
{ | ||
return HTTP::parseQueryString($query_string); | ||
} | ||
|
||
/** | ||
* @see HTTP::redirectTrustedURL() | ||
*/ | ||
public function redirectTrustedURL($url, $parameters = array()) | ||
{ | ||
HTTP::redirectTrustedURL($url, $parameters); | ||
} | ||
|
||
/** | ||
* @see HTTP::redirectUntrustedURL() | ||
*/ | ||
public function redirectUntrustedURL($url, $parameters = array()) | ||
{ | ||
HTTP::redirectUntrustedURL($url, $parameters); | ||
} | ||
|
||
/** | ||
* @see HTTP::resolveURL() | ||
*/ | ||
public function resolveURL($url, $base = null) | ||
{ | ||
return HTTP::resolveURL($url, $base); | ||
} | ||
|
||
/** | ||
* @see HTTP::setCookie() | ||
*/ | ||
public function setCookie($name, $value, $params = null, $throw = true) | ||
{ | ||
HTTP::setCookie($name, $value, $params, $throw); | ||
} | ||
|
||
/** | ||
* @see HTTP::submitPOSTData() | ||
*/ | ||
public function submitPOSTData($destination, $data) | ||
{ | ||
HTTP::submitPOSTData($destination, $data); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.