client ( $protocol )

Fetches the client for the protocol being used.

Access

public

Parameters

Parameter

Type

Required

Description

$protocol

string

Optional

The protocol associated with this stream wrapper.

Returns

Type

Description

AmazonS3

The S3 client associated with this stream wrapper.

Source

Method defined in extensions/s3streamwrapper.class.php | Toggle source view (16 lines) | View on GitHub

public function client($protocol = null)
{
    if ($protocol == null)
    {
        if ($parsed = parse_url($this->path))
        {
            $protocol = $parsed['scheme'];
        }
        else
        {
            trigger_error(__CLASS__ . ' could not determine the protocol of the stream wrapper in use.');
        }
    }

    return self::$_clients[$protocol];
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback