Auth_Yadis_HTTPFetcher Klassenreferenz

Basisklasse für Auth_Yadis_ParanoidHTTPFetcher und Auth_Yadis_PlainHTTPFetcher.


Öffentliche Methoden

 canFetchURL ($url)
 allowedURL ($url)
 supportsSSL ()
 isHTTPS ($url)
 URLHasAllowedScheme ($url)
 _findRedirect ($headers)
 get ($url, $headers=null)

Datenfelder

 $timeout = 20


Ausführliche Beschreibung

Definiert in Zeile 43 der Datei HTTPFetcher.php.


Dokumentation der Elementfunktionen

_findRedirect ( headers  ) 

private

Definiert in Zeile 117 der Datei HTTPFetcher.php.

00119     {
00120         foreach ($headers as $line) {
00121             if (strpos(strtolower($line), "location: ") === 0) {
00122                 $parts = explode(" ", $line, 2);
00123                 return $parts[1];
00124             }
00125         }
00126         return null;

allowedURL ( url  ) 

Return whether a URL should be allowed. Override this method to conform to your local policy.

By default, will attempt to fetch any http or https URL.

Definiert in Zeile 77 der Datei HTTPFetcher.php.

00079     {
00080         return $this->URLHasAllowedScheme($url);

canFetchURL ( url  ) 

Return whether a URL can be fetched. Returns false if the URL scheme is not allowed or is not supported by this fetcher implementation; returns true otherwise.

Rückgabe:
bool

Definiert in Zeile 54 der Datei HTTPFetcher.php.

00056     {
00057         if ($this->isHTTPS($url) && !$this->supportsSSL()) {
00058             Auth_OpenID::log("HTTPS URL unsupported fetching %s",
00059                              $url);
00060             return false;
00061         }
00062 
00063         if (!$this->allowedURL($url)) {
00064             Auth_OpenID::log("URL fetching not allowed for '%s'",
00065                              $url);
00066             return false;
00067         }
00068 
00069         return true;

get ( url,
headers = null 
)

Fetches the specified URL using optional extra headers and returns the server's response.

Parameter:
string $url The URL to be fetched.
array $extra_headers An array of header strings (e.g. "Accept: text/html").
Rückgabe:
mixed $result An array of ($code, $url, $headers, $body) if the URL could be fetched; null if the URL does not pass the URLHasAllowedScheme check or if the server's response is malformed.

Erneute Implementation in Auth_Yadis_ParanoidHTTPFetcher und Auth_Yadis_PlainHTTPFetcher.

Definiert in Zeile 140 der Datei HTTPFetcher.php.

00142     {
00143         trigger_error("not implemented", E_USER_ERROR);

isHTTPS ( url  ) 

Is this an https URL?

private

Definiert in Zeile 99 der Datei HTTPFetcher.php.

00101     {
00102         return (bool)preg_match('/^https:\/\//i', $url);

supportsSSL (  ) 

Does this fetcher implementation (and runtime) support fetching HTTPS URLs? May inspect the runtime environment.

Rückgabe:
bool $support True if this fetcher supports HTTPS fetching; false if not.

Erneute Implementation in Auth_Yadis_ParanoidHTTPFetcher und Auth_Yadis_PlainHTTPFetcher.

Definiert in Zeile 89 der Datei HTTPFetcher.php.

00091     {
00092         trigger_error("not implemented", E_USER_ERROR);

URLHasAllowedScheme ( url  ) 

Is this an http or https URL?

private

Definiert in Zeile 109 der Datei HTTPFetcher.php.

00111     {
00112         return (bool)preg_match('/^https?:\/\//i', $url);


Dokumentation der Datenelemente

$timeout = 20

Definiert in Zeile 45 der Datei HTTPFetcher.php.


Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei:
Copyright © 2003 - 2009 MyOOS [Shopsystem]. All rights reserved.
MyOOS [Shopsystem] is Free Software released under the GNU/GPL License.

Webmaster: info@r23.de (Impressum)
doxygen