Метод |
Описание |
|
WSSE ( string | array $nonce = '', string $timestamp = '' ) : array |
Returns an array of tokens used for WSSE authentication
http://www.xml.com/pub/a/2003/12/17/dive.html
http://www.sixapart.com/developers/atom/protocol/atom_authentication.html |
|
addslashes ( $value ) |
Adds slashes to escape strings, including strings in arrays |
|
amp ( string $value ) : string |
Escape the ampersands in a URL for ouptut |
|
archive_pages ( integer $item_total, integer $items_per_page = null ) : integer |
Returns the number of pages in an archive using the number of items per page set in options |
|
array_map_field ( Countable $array, string $field, string $key = null ) : array |
Given an array of arrays, return an array that contains the value of a particular common field
Example:
$a = array(
array('foo'=>1, 'bar'=>2),
array('foo'=>3, 'bar'=>4),
);
$b = Utils::array_map_field($a, 'foo'); // $b = array(1, 3); |
|
array_or ( array $input ) : integer |
Does a bitwise OR of all the numbers in an array |
|
atomtime ( mixed $t ) : string |
Returns RFC-3339 time from a time string or integer timestamp |
|
check_request_method ( array $expected ) |
Checks whether the correct HTTP method was used for the request |
|
class_only ( string | object $classname ) : string |
Strip the namespace off of the fully-qualified class name |
|
crypt ( string $password, string $hash = null ) : string | boolean |
Crypt a given password, or verify a given password against a given hash. |
|
de_amp ( string $value ) : boolean | string |
Return & entities in a URL querystring to their previous & glory, for use in redirects |
|
debug ( ) |
Outputs a call stack with parameters, and a dump of the parameters passed. |
|
debug_reveal ( $show, $hide, $debugid, $close = false ) |
Helper function used by debug()
Not for external use. |
|
end_in_slash ( string $value ) : string |
Forces a string to end in a single slash |
|
env_is ( string $env, string $key = '_useenv' ) : boolean |
Are we in a specific environment? |
|
env_test ( string $key = '_useenv' ) : boolean |
Are we in a testing environment? |
|
firebacktrace ( array $backtrace ) : string |
Utils::firebacktrace() |
|
firedebug ( ) |
Outputs debug information like ::debug() but using Firebug's Console. |
|
get_ini_settings ( ) : Array |
Get a list of the PHP ini settings relevant to Habari |
|
get_ip ( string $default = '0.0.0.0' ) : string |
Get the remote IP address, but try and take into account users who are
behind proxies, whether they know it or not. |
|
get_params ( mixed $params ) : array |
Returns an associative array of parameters, whether the input value is
a querystring or an associative array. |
|
getdate ( integer $timestamp ) : array |
Return an array of date information
Just like getdate() but also returns 0-padded versions of day and month in mday0 and mon0 |
|
glob ( string $pattern, integer $flags ) : array |
Replacement for system glob that returns an empty array if there are no results |
|
glob_to_regex ( string $glob ) : string |
Returns a regex pattern equivalent to the given glob pattern |
|
html_attr ( array $attrs, integer $quote_flag = ENT_COMPAT, string $encoding = 'UTF-8', boolean $decode = true, boolean $double_encode = true ) : string |
Create a list of html element attributes from an associative array |
|
html_checkboxes ( string $name, array $options ) : string |
Creates one or more HTML checkboxes |
|
html_inputs ( array $options ) : string |
Creates one or more HTML inputs |
|
html_select ( string $name, array $options, string $current = null, array $properties = [] ) : string |
Create an HTML select tag with options and a current value |
|
htmlspecialchars ( string | array $string, integer $quote_flag = null, string $encoding = 'UTF-8', boolean $decode = true, boolean $double_encode = true ) : string |
Call htmlspecialchars() with the correct flags and encoding,
without double escaping strings. |
|
human_size ( integer $bytesize ) : string |
Produces a human-readable size string. |
|
implode_quoted ( string $separator, array $values ) : string |
Behaves like the implode() function, except it quotes values that contain spaces |
|
is_traversable ( mixed $data ) : boolean |
determines if the given that is travesable in foreach |
|
locale_date ( string $format, integer $timestamp ) : string |
Return a formatted date/time trying to use strftime() AND date() |
|
mail ( string $to, string $subject, string $message, array $headers = [], string $parameters = '' ) : boolean |
Send email |
|
map_array ( string $value, string $prefix = '{$', string $postfix = '}' ) : string |
Used with array_map to create an array of PHP stringvar-style search/replace strings using optional pre/postfixes
$mapped_values= array_map(array('\Habari\Utils', 'map_array'), $values);
|
|
md5 ( $password, $hash = null ) |
Crypt or verify a given password using MD5. |
|
mimetype ( string $filename ) : string |
Return the mimetype of a file |
|
nonce ( ) |
Returns a random 12-digit hex number |
|
php_check_file_syntax ( $file, &$error = null ) |
Check the PHP syntax of (and execute) the specified file. |
|
php_check_syntax ( string $code, null | string &$error = null ) : boolean |
Check the PHP syntax of the specified code. |
|
placeholder_string ( integer $count ) : string |
Returns a string of question mark parameter
placeholders. |
|
quote_spaced ( string $value ) : string |
Adds quotes around values that have spaces in them |
|
random_password ( integer $length = 10 ) : string |
Create a random password of a specific length |
|
redirect ( string $url = '', boolean $continue = false ) |
Redirects the request to a new URL |
|
regexdelim ( string $string, string $choices = null ) : string |
Convenience function to find a usable PCRE regular expression
delimiter for a particular string. (I.e., some character that
*isn't* found in the string.) |
|
replace_shortcodes ( string $content, Object $obj_context ) : string |
Replace shortcodes in content with shortcode output |
|
ror ( $v, $w ) |
Helper function for array_or |
|
scheme_ports ( string $scheme = null ) : integer |
Return the port used for a specific URL scheme |
|
setup_wsse ( ) : string |
Produce a set of inputs that can be used to validate WSSE |
|
sha1 ( $password, $hash = null ) |
Crypt or verify a given password using SHA. |
|
single_array ( mixed $element ) : array |
Convert a single non-array variable into an array with that one element |
|
slugify ( string $string, string $separator = '-' ) : string |
Return a sanitized slug, replacing non-alphanumeric characters to dashes |
|
ssha ( string $password, string $hash = null ) : string |
Crypt or verify a given password using SSHA. |
|
ssha512 ( string $password, string $hash = null ) : string |
Crypt or verify a given password using SSHA512. |
|
stripslashes ( $value ) |
Removes slashes from escaped strings, including strings in arrays |
|
trail ( mixed $value = false ) : string |
Returns a trailing slash or a string, depending on the value passed in |
|
truncate ( string $str, integer $len = 10, boolean $middle = true ) : string |
Trims longer phrases to shorter ones with elipsis in the middle |
|
verify_wsse ( array $data, boolean $anyverb = false ) : boolean |
Verify WSSE values passed in. |
|