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. |
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().
| 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 번째 라인에서 정의되었습니다.
| 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. |
OpenID.php 파일의 197 번째 라인에서 정의되었습니다.
다음에 의해서 참조됨 : Services_Yadis_XRIAppendArgs().
| 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. |
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 번째 라인에서 정의되었습니다.
| 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. |
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 }
1.6.1