Methods summary
public static
|
#
isFailure( $thing )
Return true if $thing is an Auth_OpenID_FailureResponse object;
false if not.
Return true if $thing is an Auth_OpenID_FailureResponse object;
false if not.
|
public static
|
#
getQuery( $query_str = null )
Gets the query data from the server environment based on the
request method used. If GET was used, this looks at
$_SERVER['QUERY_STRING'] directly. If POST was used, this
fetches data from the special php://input file stream.
Gets the query data from the server environment based on the
request method used. If GET was used, this looks at
$_SERVER['QUERY_STRING'] directly. If POST was used, this
fetches data from the special php://input file stream.
Returns an associative array of the query arguments.
Skips invalid key/value pairs (i.e. keys with no '=value'
portion).
Returns an empty array if neither GET nor POST was used, or if
POST was used but php://input cannot be opened.
See background:
http://lists.openidenabled.com/pipermail/dev/2007-March/000395.html
|
public static
|
|
public static
|
#
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.
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.
|
public static
|
#
addPrefix( $values, $prefix )
Adds a string prefix to all values of an array. Returns a new
array containing the prefixed values.
Adds a string prefix to all values of an array. Returns a new
array containing the prefixed values.
|
public static
|
#
arrayGet( $arr, $key, $fallback = null )
Convenience function for getting array values. Given an array
$arr and a key $key, get the corresponding value from the array
or return $default if the key is absent.
Convenience function for getting array values. Given an array
$arr and a key $key, get the corresponding value from the array
or return $default if the key is absent.
|
public static
|
#
parse_str( $query )
Replacement for PHP's broken parse_str.
Replacement for PHP's broken parse_str.
|
public static
string
|
#
httpBuildQuery( array $data )
Implements the PHP 5 'http_build_query' functionality.
Implements the PHP 5 'http_build_query' functionality.
Parameters
- $data
Either an array key/value pairs or an array
of arrays, each of which holding two values: a key and a value,
sequentially.
Returns
string $result The result of url-encoding the key/value
pairs from $data into a URL query string
(e.g. "username=bob&id=56").
|
public static
string
|
#
appendArgs( string $url, array $args )
"Appends" query arguments onto a URL. The URL may or may not
already have arguments (following a question mark).
"Appends" query arguments onto a URL. The URL may or may not
already have arguments (following a question mark).
Parameters
- $url
A URL, which may or may not already have
arguments.
- $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.
Returns
string $url The original URL with the new parameters added.
|
public static
string
|
#
urlunparse( string $scheme, string $host, string $port = null, string $path = '/', string $query = '', string $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.
Implements python's urlunparse, which is not available in PHP.
Given the specified components of a URL, this function rebuilds
and returns the URL.
Parameters
- $scheme
- The scheme (e.g. 'http'). Defaults to 'http'.
- $host
- The host. Required.
- $port
- The port.
- $path
- The path.
- $query
- The query.
- $fragment
- The fragment.
Returns
string $url The URL resulting from assembling the
specified components.
|
public static
mixed
|
#
normalizeUrl( string $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.
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.
Parameters
- $url
- The URL to be normalized.
Returns
mixed $new_url The URL after normalization, or null if
$url was malformed.
|
public static
|
#
intval( $value )
Replacement (wrapper) for PHP's intval() because it's broken.
Replacement (wrapper) for PHP's intval() because it's broken.
|
public static
integer
|
#
bytes( string $str )
Count the number of bytes in a string independently of
multibyte support conditions.
Count the number of bytes in a string independently of
multibyte support conditions.
Parameters
- $str
- The string of bytes to count.
Returns
integer The number of bytes in $str.
|
public static
|
#
toBytes( $str )
Get the bytes in a string independently of multibyte support
conditions.
Get the bytes in a string independently of multibyte support
conditions.
|
public static
|
|
public static
|
|
public static
|
|
public static
|
#
log( string $format_string )
Wrap PHP's standard error_log functionality. Use this to
perform all logging. It will interpolate any additional
arguments into the format string before logging.
Wrap PHP's standard error_log functionality. Use this to
perform all logging. It will interpolate any additional
arguments into the format string before logging.
Parameters
- $format_string
- The sprintf format for the message
|
public static
|
|