parse_path ( $path )

Parses an S3 URL into the parts needed by the stream wrapper.

Access

public

Parameters

Parameter

Type

Required

Description

$path

string

Required

The path to parse.

Returns

Type

Description

array

An array of 3 items: protocol, bucket, and object name ready for list().

Source

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

public function parse_path($path)
{
    $url = parse_url($path);

    return array(
        $url['scheme'],                                       // Protocol
        $url['host'],                                         // Bucket
        (isset($url['path']) ? substr($url['path'], 1) : ''), // Object
    );
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback