init ( $auth, $policy )

Alternate approach to constructing a new instance. Supports chaining.

Access

public static

Parameters

Parameter

Type

Required

Description

$auth

CFRuntime

Required

An instance of any authenticated AWS object that is an instance of CFRuntime (e.g. AmazonEC2, AmazonS3).

$policy

string
array

Required

The associative array representing the S3 policy to use, or a string of JSON content.

Returns

Type

Description

$this

A reference to the current instance.

Source

Method defined in utilities/policy.class.php | Toggle source view (10 lines) | View on GitHub

public static function init($auth, $policy)
{
    if (version_compare(PHP_VERSION, '5.3.0', '<'))
    {
        throw new Exception('PHP 5.3 or newer is required to instantiate a new class with CLASS::init().');
    }

    $self = get_called_class();
    return new $self($auth, $policy);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback