__construct ( $auth, $policy )

Constructs a new instance of this class.

Access

public

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.

See Also

Source

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

public function __construct($auth, $policy)
{
    $this->auth = $auth;

    if (is_array($policy)) // We received an associative array...
    {
        $this->json_policy = json_encode($policy);
    }
    else // We received a valid, parseable JSON string...
    {
        $this->json_policy = json_encode(json_decode($policy, true));
    }

    return $this;
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback