Core functionality and default settings shared across classes.
2009.02.28
2006-2009 LifeNexus Digital, Inc., and contributors.
| Simplified BSD License | http://opensource.org/licenses/bsd-license.php |
| Tarzan | http://tarzan-aws.com |
The default class to use for Utilities (defaults to TarzanUtilities).
The default class to use for HTTP Responses (defaults to TarzanHTTPResponse).
public function __construct( $key = null, $secret_key = null, $account_id = null, $assoc_id = null )
The constructor
public
| key | string (Optional) Your Amazon API Key. If blank, it will look for the AWS_KEY constant. |
| secret_key | string (Optional) Your Amazon API Secret Key. If blank, it will look for the AWS_SECRET_KEY constant. |
| account_id | string (Optional) Your Amazon account ID without the hyphens. Required for EC2. If blank, it will look for the AWS_ACCOUNT_ID constant. |
| assoc_id | string (Optional) Your Amazon Associates ID. Required for AAWS. If blank, it will look for the AWS_ASSOC_ID constant. |
boolean FALSE if no valid values are set, otherwise true.
public function adjust_offset( $seconds )
Allows you to adjust the current time, for occasions when your server is out of sync with Amazon’s servers.
public
| seconds | integer (Required) The number of seconds to adjust the sent timestamp by. |
void
| Example Usage | http://tarzan-aws.com |
public function set_proxy( $proxy )
Set the proxy settings to use for connecting.
public
| proxy | string (Required) Accepts proxy credentials in the following format: proxy://user:pass@hostname:port |
void
| Example Usage | http://tarzan-aws.com |
function set_utilities_class( $class = 'TarzanUtilities' )
Set a custom class for this functionality. Perfect for extending/overriding existing classes with new functionality.
public
| class | string (Optional) The name of the new class to use for this functionality. Defaults to the default class. |
void
| Example Usage | http://tarzan-aws.com |
function set_request_class( $class = 'TarzanHTTPRequest' )
Set a custom class for this functionality. Perfect for extending/overriding existing classes with new functionality.
public
| class | string (Optional) The name of the new class to use for this functionality. Defaults to the default class. |
void
| Example Usage | http://tarzan-aws.com |
function set_response_class( $class = 'TarzanHTTPResponse' )
Set a custom class for this functionality. Perfect for extending/overriding existing classes with new functionality.
public
| class | string (Optional) The name of the new class to use for this functionality. Defaults to the default class. |
void
| Example Usage | http://tarzan-aws.com |
public function authenticate( $action, $opt = null, $domain = null, $message = null )
Default, shared method for authenticating a connection to AWS. Overridden on a class-by-class basis as necessary. This should not be used directly unless you’re writing custom methods for this class.
public
| action | string (Required) Indicates the action to perform. |
| opt | array (Optional) Associative array of parameters for authenticating. See the individual methods for allowed keys. |
| domain | string (Optional) The URL of the queue to perform the action on. |
| message | string (Optional) This parameter is only used by the send_message() method. |
TarzanHTTPResponse object
public function cache_response( $method, $location, $expires, $params = null )
Caches a TarzanHTTPResponse object using the preferred caching method.
public
| method | string (Required) The method of the current object that you want to execute and cache the response for. If the method is not in the $this scope, pass in an array where the correct scope is in the [0] position and the method name is in the [1] position. |
| location | string (Required) The location to store the cache object in. This may vary by cache method. See below. |
| expires | integer (Required) The number of seconds until a cache object is considered stale. |
| params | array (Optional) An indexed array of parameters to pass to the aforementioned method, where array[0] represents the first parameter, array[1] is the second, etc. |
| File | Local file system paths such as ./cache (relative) or /tmp/cache/tarzan (absolute). Location must be server-writable. |
| APC | Pass in ‘apc’ to use this lightweight cache. You must have the APC extension installed. http://php.net/apc |
| Memcached | Pass in an indexed array of associative arrays. Each associative array should have a ‘host’ and a ‘port’ value representing a Memcached server to connect to. |
| PDO | A URL-style string (e.g. pdo.mysql://user:pass@localhost/tarzan_cache) or a standard DSN-style string (e.g. pdo.sqlite:/sqlite/tarzan_cache.db). MUST be prefixed with ‘pdo.’. See CachePDO and http://php.net/pdo for more details. |
TarzanHTTPResponse object
| Example Usage | http://tarzan-aws.com |