Utilities for connecting to, and working with, AWS.
2008.12.18
2006-2009 LifeNexus Digital, Inc., and contributors.
| Simplified BSD License | http://opensource.org/licenses/bsd-license.php |
| Tarzan | http://tarzan-aws.com |
public function ready( $var )
Check if a value (such as a GET or POST parameter or an array value) has a real, non-empty value.
public
| var | array (Required) The value to check. |
boolean Whether this has a real value.
| Example Usage | http://tarzan-aws.com |
public function hex_to_base64( $str )
Convert a HEX value to Base64.
public
| str | string (Required) Value to convert. |
string Base64-encoded string.
| Example Usage | http://tarzan-aws.com |
public function to_query_string( $array )
Convert an associative array into a query string.
public
| array | array (Required) Array to convert. |
string URL-friendly query string.
| Example Usage | http://tarzan-aws.com |
public function to_signable_string( $array )
Convert an associative array into a sign-able string.
public
| array | array (Required) Array to convert. |
string URL-friendly sign-able string.
| Example Usage | http://tarzan-aws.com |
public function query_to_array( $qs )
Convert a query string into an associative array. Multiple, identical keys will become an indexed array.
public
| qs | string (Required) Query string to convert. |
array Associative array of keys and values.
| Example Usage | http://tarzan-aws.com |
public function size_readable( $size, $unit = null, $retstring = null )
Return human readable file sizes. Original function by Aidan Lister aidan@php.net, modified by Ryan Parman.
public
| size | integer (Required) Filesize in bytes. |
| unit | string (Optional) The maximum unit to use. Defaults to the largest appropriate unit. |
| retstring | string (Optional) The format for the return string. Defaults to ‘%01.2f %s’ |
string The human-readable file size.
| Original Function | http://aidanlister.com |
| Example Usage | http://tarzan-aws.com |
public function time_hms( $seconds )
Convert a number of seconds into Hours:Minutes:Seconds.
public
| seconds | integer (Required) The number of seconds to convert. |
string The formatted time.
| Example Usage | http://tarzan-aws.com |
public function try_these( $attrs, $base = null, $default = null )
Returns the first value that is set. Based on Try.these() from Prototype http://prototypejs.org.
public
| attrs | array (Required) The attributes to test, as strings. Intended for testing properties of the $base object, but also works with variables if you place an @ symbol at the beginning of the command. |
| base | object (Optional) The base object to use, if any. |
| default | mixed (Optional) What to return if there are no matches. Defaults to null. |
mixed Either a matching property of a given object, boolean false, or any other data type you might choose.
| Example Usage | http://tarzan-aws.com |
public function json_encode( $obj )
Replicates json_encode() for versions of PHP 5 earlier than 5.2.
http://us2.php.net
public
| obj | mixed (Required) The PHP object to convert into a JSON string. |
string A JSON string.
| Example Usage | http://tarzan-aws.com |