Auth_OpenID 클래스 참조

모든 멤버 목록

Public 멤버 함수

 getOpenIDNamespaces ()
 fixArgs ($args)
 ensureDir ($dir_name)
 arrayGet ($arr, $key, $fallback=null)
 httpBuildQuery ($data)
 appendArgs ($url, $args)
 quoteMinimal ($s)
 urlunparse ($scheme, $host, $port=null, $path= '/', $query= '', $fragment= '')
 normalizeUrl ($url)

상세한 설명

OpenID.php 파일의 106 번째 라인에서 정의되었습니다.


멤버 함수 문서화

Auth_OpenID::appendArgs ( url,
args 
)

"Appends" query arguments onto a URL. The URL may or may not already have arguments (following a question mark).

매개변수:
string $url A URL, which may or may not already have arguments.
array $args Either an array key/value pairs or an array of arrays, each of which holding two values: a key and a value, sequentially. If $args is an ordinary key/value array, the parameters will be added to the URL in sorted alphabetical order; if $args is an array of arrays, their order will be preserved.
반환값:
string $url The original URL with the new parameters added.

OpenID.php 파일의 224 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Auth_OpenID_ServerResponse::encodeToURL(), Auth_OpenID_CheckIDRequest::encodeToURL(), Auth_OpenID_ServerError::encodeToURL(), Auth_OpenID_CheckIDRequest::getCancelURL(), Auth_OpenID_AuthRequest::redirectURL().

00228     {
00229         if (count($args) == 0) {
00230             return $url;
00231         }
00232 
00233         // Non-empty array; if it is an array of arrays, use
00234         // multisort; otherwise use sort.
00235         if (array_key_exists(0, $args) &&
00236             is_array($args[0])) {
00237             // Do nothing here.
00238         } else {
00239             $keys = array_keys($args);
00240             sort($keys);
00241             $new_args = array();
00242             foreach ($keys as $key) {
00243                 $new_args[] = array($key, $args[$key]);
00244             }
00245             $args = $new_args;
00246         }
00247 
00248         $sep = '?';
00249         if (strpos($url, '?') !== false) {
00250             $sep = '&';
00251         }

Auth_OpenID::arrayGet ( arr,
key,
fallback = null 
)

Convenience function for getting array values.

private

OpenID.php 파일의 171 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Auth_OpenID_GenericConsumer::_createCheckAuthRequest(), Auth_OpenID_GenericConsumer::_doIdRes(), Auth_OpenID_GenericConsumer::_parseAssociation(), Auth_OpenID_GenericConsumer::_processCheckAuthResponse(), Auth_OpenID_GenericConsumer::complete(), Auth_OpenID_Decoder::decode(), Auth_OpenID_ServerError::encodeToURL(), Auth_OpenID_Parse::findFirstHref(), Auth_OpenID_CheckIDRequest::fromQuery(), Auth_OpenID_DiffieHellmanServerSession::fromQuery(), Auth_OpenID_CheckAuthRequest::fromQuery(), Auth_OpenID_SuccessResponse::fromQuery(), Auth_OpenID_SuccessResponse::getReturnTo(), Auth_OpenID_ServerError::whichEncoding().

00175     {
00176         if (is_array($arr)) {
00177             if (array_key_exists($key, $arr)) {
00178                 return $arr[$key];
00179             } else {
00180                 return $fallback;
00181             }
00182         } else {
00183             trigger_error("Auth_OpenID::arrayGet expected " .
00184                           "array as first parameter", E_USER_WARNING);

Auth_OpenID::ensureDir ( dir_name  ) 

Create dir_name as a directory if it does not exist. If it exists, make sure that it is, in fact, a directory. Returns true if the operation succeeded; false if not.

private

OpenID.php 파일의 153 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Auth_OpenID_FileStore::_setup(), Auth_OpenID_FileStore::Auth_OpenID_FileStore().

00157     {
00158         if (is_dir($dir_name) || @mkdir($dir_name)) {
00159             return true;
00160         } else {
00161             if (Auth_OpenID::ensureDir(dirname($dir_name))) {
00162                 return is_dir($dir_name) || @mkdir($dir_name);
00163             } else {
00164                 return false;

Auth_OpenID::fixArgs ( args  ) 

Rename query arguments back to 'openid.' from 'openid_'

private

매개변수:
array $args An associative array of URL query arguments

OpenID.php 파일의 124 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Auth_OpenID_Consumer::complete().

00128     {
00129         foreach (array_keys($args) as $key) {
00130             $fixed = $key;
00131             if (preg_match('/^openid/', $key)) {
00132                 foreach (Auth_OpenID::getOpenIDNamespaces() as $ns) {
00133                     if (preg_match('/'.$ns.'_/', $key)) {
00134                         $fixed = preg_replace('/'.$ns.'_/', $ns.'.', $fixed);
00135                     }
00136                 }
00137 
00138                 if ($fixed != $key) {
00139                     $val = $args[$key];
00140                     unset($args[$key]);
00141                     $args[$fixed] = $val;
00142                 }
00143             }
00144         }

Auth_OpenID::getOpenIDNamespaces (  ) 

These namespaces are automatically fixed in query arguments by Auth_OpenID::fixArgs.

OpenID.php 파일의 112 번째 라인에서 정의되었습니다.

00116     {

Auth_OpenID::httpBuildQuery ( data  ) 

Implements the PHP 5 'http_build_query' functionality.

private

매개변수:
array $data Either an array key/value pairs or an array of arrays, each of which holding two values: a key and a value, sequentially.
반환값:
string $result The result of url-encoding the key/value pairs from $data into a URL query string (e.g. "username=bob&id=56").

OpenID.php 파일의 197 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Services_Yadis_XRIAppendArgs().

00201     {
00202         $pairs = array();
00203         foreach ($data as $key => $value) {
00204             if (is_array($value)) {
00205                 $pairs[] = urlencode($value[0])."=".urlencode($value[1]);
00206             } else {
00207                 $pairs[] = urlencode($key)."=".urlencode($value);
00208             }

Auth_OpenID::normalizeUrl ( url  ) 

Given a URL, this "normalizes" it by adding a trailing slash and / or a leading http:// scheme where necessary. Returns null if the original URL is malformed and cannot be normalized.

private

매개변수:
string $url The URL to be normalized.
반환값:
mixed $new_url The URL after normalization, or null if $url was malformed.

OpenID.php 파일의 345 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : Auth_OpenID_Consumer::begin().

00349     {
00350         if ($url === null) {
00351             return null;
00352         }
00353 
00354         assert(is_string($url));
00355 
00356         $old_url = $url;
00357         $url = trim($url);
00358 
00359         if (strpos($url, "://") === false) {
00360             $url = "http://" . $url;
00361         }
00362 
00363         $parsed = @parse_url($url);
00364 
00365         if ($parsed === false) {
00366             return null;
00367         }
00368 
00369         $defaults = array(
00370                           'scheme' => '',
00371                           'host' => '',
00372                           'path' => '',
00373                           'query' => '',
00374                           'fragment' => '',
00375                           'port' => ''
00376                           );
00377 
00378         $parsed = array_merge($defaults, $parsed);
00379 
00380         if (($parsed['scheme'] == '') ||
00381             ($parsed['host'] == '')) {
00382             if ($parsed['path'] == '' &&
00383                 $parsed['query'] == '' &&
00384                 $parsed['fragment'] == '') {
00385                 return null;
00386             }
00387 
00388             $url = 'http://' + $url;
00389             $parsed = parse_url($url);
00390 
00391             $parsed = array_merge($defaults, $parsed);
00392         }
00393 
00394         $tail = array_map(array('Auth_OpenID', 'quoteMinimal'),
00395                           array($parsed['path'],
00396                                 $parsed['query'],
00397                                 $parsed['fragment']));
00398         if ($tail[0] == '') {
00399             $tail[0] = '/';
00400         }
00401 
00402         $url = Auth_OpenID::urlunparse($parsed['scheme'], $parsed['host'],
00403                                        $parsed['port'], $tail[0], $tail[1],
00404                                        $tail[2]);
00405 
00406         assert(is_string($url));

Auth_OpenID::quoteMinimal ( s  ) 

Turn a string into an ASCII string.

Replace non-ascii characters with a -encoded, UTF-8 encoding. This function will fail if the input is a string and there are non-7-bit-safe characters. It is assumed that the caller will have already translated the input into a Unicode character sequence, according to the encoding of the HTTP POST or GET.

Do not escape anything that is already 7-bit safe, so we do the minimal transform on the identity URL

private

OpenID.php 파일의 268 번째 라인에서 정의되었습니다.

00272     {
00273         $res = array();
00274         for ($i = 0; $i < strlen($s); $i++) {
00275             $c = $s[$i];
00276             if ($c >= "\x80") {
00277                 for ($j = 0; $j < count(utf8_encode($c)); $j++) {
00278                     array_push($res, sprintf("%02X", ord($c[$j])));
00279                 }
00280             } else {
00281                 array_push($res, $c);
00282             }
00283         }

Auth_OpenID::urlunparse ( scheme,
host,
port = null,
path = '/',
query = '',
fragment = '' 
)

Implements python's urlunparse, which is not available in PHP. Given the specified components of a URL, this function rebuilds and returns the URL.

private

매개변수:
string $scheme The scheme (e.g. 'http'). Defaults to 'http'.
string $host The host. Required.
string $port The port.
string $path The path.
string $query The query.
string $fragment The fragment.
반환값:
string $url The URL resulting from assembling the specified components.

OpenID.php 파일의 300 번째 라인에서 정의되었습니다.

00305     {
00306 
00307         if (!$scheme) {
00308             $scheme = 'http';
00309         }
00310 
00311         if (!$host) {
00312             return false;
00313         }
00314 
00315         if (!$path) {
00316             $path = '/';
00317         }
00318 
00319         $result = $scheme . "://" . $host;
00320 
00321         if ($port) {
00322             $result .= ":" . $port;
00323         }
00324 
00325         $result .= $path;
00326 
00327         if ($query) {
00328             $result .= "?" . $query;
00329         }
00330 
00331         if ($fragment) {
00332             $result .= "#" . $fragment;
00333         }


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.:

생성시간 : Wed Oct 28 22:59:43 2009, 프로젝트명 : XpressEngine, 생성자 :   doxygen 1.6.1