a:2:{s:4:"file";a:0:{}s:5:"class";a:9:{s:4:"name";s:8:"AmazonS3";s:4:"file";s:21:"services/s3.class.php";s:3:"url";s:22:"../amazons3/index.html";s:11:"description";s:1323:"

Amazon S3 is a web service that enables you to store data in the cloud. You can then download the data or use the data with other AWS services, such as Amazon Elastic Cloud Computer (EC2).

Amazon Simple Storage Service (Amazon S3) is storage for the Internet. You can use Amazon S3 to store and retrieve any amount of data at any time, from anywhere on the web. You can accomplish these tasks using the AWS Management Console, which is a simple and intuitive web interface.

To get the most out of Amazon S3, you need to understand a few simple concepts. Amazon S3 stores data as objects in buckets. An object is comprised of a file and optionally any metadata that describes that file.

To store an object in Amazon S3, you upload the file you want to store to a bucket. When you upload a file, you can set permissions on the object as well as any metadata.

Buckets are the containers for objects. You can have one or more buckets. For each bucket, you can control access to the bucket (who can create, delete, and list objects in the bucket), view access logs for the bucket and its objects, and choose the geographical region where Amazon S3 will store the bucket and its contents.

Visit http://aws.amazon.com/s3/ for more information.

";s:8:"metadata";a:4:{s:7:"version";s:10:"2012.10.02";s:7:"license";s:53:"See the included NOTICE.md file for more information.";s:9:"copyright";s:53:"See the included NOTICE.md file for more information.";s:4:"link";a:2:{i:0;s:55:"http://aws.amazon.com/s3/ Amazon Simple Storage Service";i:1;s:83:"http://aws.amazon.com/documentation/s3/ Amazon Simple Storage Service documentation";}}s:11:"inheritance";a:1:{s:5:"class";a:3:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";s:3:"url";s:23:"../cfruntime/index.html";}}s:7:"methods";a:2:{s:11:"@attributes";a:1:{s:5:"count";s:3:"109";}s:6:"method";a:105:{i:0;a:6:{s:4:"name";s:11:"__construct";s:8:"modifier";s:6:"public";s:11:"description";s:129:"

Constructs a new instance of AmazonS3.

";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:7:"options";s:4:"type";s:5:"array";s:11:"description";s:1567:"

An associative array of parameters that can have the following keys:

";}}s:11:"returnvalue";a:1:{s:11:"@attributes";a:1:{s:4:"type";s:4:"void";}}s:6:"source";s:2558:"public function __construct(array $options = array()) { $this->vhost = null; $this->api_version = '2006-03-01'; $this->hostname = self::DEFAULT_URL; $this->base_acp_xml = '<?xml version="1.0" encoding="UTF-8"?><AccessControlPolicy xmlns="http://s3.amazonaws.com/doc/latest/"/>'; $this->base_location_constraint = '<?xml version="1.0" encoding="UTF-8"?><CreateBucketConfiguration xmlns="http://s3.amazonaws.com/doc/' . $this->api_version . '/"><LocationConstraint/></CreateBucketConfiguration>'; $this->base_logging_xml = '<?xml version="1.0" encoding="utf-8"?><BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/' . $this->api_version . '"/>'; $this->base_notification_xml = '<?xml version="1.0" encoding="utf-8"?><NotificationConfiguration/>'; $this->base_versioning_xml = '<?xml version="1.0" encoding="utf-8"?><VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/' . $this->api_version . '/"/>'; $this->complete_mpu_xml = '<?xml version="1.0" encoding="utf-8"?><CompleteMultipartUpload/>'; $this->website_config_xml = '<?xml version="1.0" encoding="utf-8"?><WebsiteConfiguration xmlns="http://s3.amazonaws.com/doc/' . $this->api_version . '/"><IndexDocument><Suffix>index.html</Suffix></IndexDocument><ErrorDocument><Key>error.html</Key></ErrorDocument></WebsiteConfiguration>'; $this->multi_object_delete_xml = '<?xml version="1.0" encoding="utf-8"?><Delete/>'; $this->object_expiration_xml = '<?xml version="1.0" encoding="utf-8"?><LifecycleConfiguration/>'; $this->bucket_tagging_xml = '<?xml version="1.0" encoding="utf-8"?><Tagging><TagSet/></Tagging>'; $this->cors_config_xml = '<?xml version="1.0" encoding="utf-8"?><CORSConfiguration />'; $this->restore_request_xml = '<?xml version="1.0" encoding="utf-8"?><RestoreRequest xmlns="http://s3.amazonaws.com/doc/' . $this->api_version . '"/>'; parent::__construct($options); }";}i:1;a:8:{s:4:"name";s:22:"abort_multipart_upload";s:8:"modifier";s:6:"public";s:11:"description";s:81:"

Aborts an in-progress multipart upload. This operation cannot be reversed.

";s:10:"parameters";a:1:{s:9:"parameter";a:4:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

The file name for the object.

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:9:"upload_id";s:4:"type";s:6:"string";s:11:"description";s:284:"

The upload ID identifying the multipart upload whose parts are being listed. The upload ID is retrieved from a call to initiate_multipart_upload().

";}i:3;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:325:"public function abort_multipart_upload($bucket, $filename, $upload_id, $opt = null) { if (!$opt) $opt = array(); // Add this to our request $opt['verb'] = 'DELETE'; $opt['resource'] = $filename; $opt['uploadId'] = $upload_id; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:96:"

Abort a multipart upload. This will delete all completed parts for this multipart upload.

";s:4:"code";s:345:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Abort an in-progress multipart upload $response = $s3->abort_multipart_upload($bucket, 'tv_episode.mp4', 'f_JM_zwhU37pj1tS.F2BXVWUJtGcNso1WEikZImjrBCYUbUQwNnOUwX.Z00O1QmKQXAjqQBD4BVZRGmEXAMPLE--'); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:8:{i:0;s:175:"abort_multipart_uploads_by_date()";i:1;s:157:"complete_multipart_upload()";i:2;s:133:"create_mpu_object()";i:3;s:142:"get_multipart_counts()";i:4;s:157:"initiate_multipart_upload()";i:5;s:148:"list_multipart_uploads()";i:6;s:112:"list_parts()";i:7;s:115:"upload_part()";}}}i:2;a:8:{s:4:"name";s:31:"abort_multipart_uploads_by_date";s:8:"modifier";s:6:"public";s:11:"description";s:107:"

Aborts all multipart uploads initiated before the specified date. This operation cannot be reversed.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:4:"when";s:4:"type";s:14:"string|integer";s:11:"description";s:147:"

The time and date to use for comparison. Accepts any value that strtotime() understands.

";}}}s:11:"returnvalue";s:274:"

A CFArray containing a series of 0 or more CFResponse objects, containing a parsed HTTP response.

";s:6:"source";s:1627:"public function abort_multipart_uploads_by_date($bucket, $when = null) { if ($this->use_batch_flow) { // @codeCoverageIgnoreStart throw new S3_Exception(__FUNCTION__ . '() cannot be batch requested'); // @codeCoverageIgnoreEnd } $when = $when ? $when : time(); $handles = array(); $data = $this->list_multipart_uploads($bucket)->body; $when = is_int($when) ? $when : strtotime($when); if (!($data instanceof CFSimpleXML)) { return false; } $list = $data->query('descendant-or-self::Upload/Initiated'); if (count($list) > 0) { foreach ($list as $node) { if (strtotime((string) $node) < $when) { $q = new CFBatchRequest(); $parent = $node->parent(); $upload_id = $parent ->query('descendant-or-self::UploadId') ->first() ->to_string(); $filename = $parent ->query('descendant-or-self::Key') ->first() ->to_string(); $handles[] = $this->abort_multipart_upload($bucket, $filename, $upload_id, array( 'returnCurlHandle' => true )); } } $http = new CFRequest(); $responses = $http->send_multi_request($handles); if (is_array($responses) && count($responses) > 0) { return new CFArray($responses); } } return new CFArray(); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:75:"

Abort all multipart uploads that were initiated before a given date.

";s:4:"code";s:752:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Delete everything before right now. $response = $s3->abort_multipart_uploads_by_date($bucket); // Delete everything before 20 minutes ago $response = $s3->abort_multipart_uploads_by_date($bucket, '20 minutes ago'); // Delete everything before yesterday $response = $s3->abort_multipart_uploads_by_date($bucket, 'yesterday'); // Delete everything before a specific date. $response = $s3->abort_multipart_uploads_by_date($bucket, '1 November 2010'); // Delete everything before a specific date. $response = $s3->abort_multipart_uploads_by_date('my-bucket-doesnotexist', '1 November 2010'); // Success? var_dump($response->areOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:8:{i:0;s:148:"abort_multipart_upload()";i:1;s:157:"complete_multipart_upload()";i:2;s:133:"create_mpu_object()";i:3;s:142:"get_multipart_counts()";i:4;s:157:"initiate_multipart_upload()";i:5;s:148:"list_multipart_uploads()";i:6;s:112:"list_parts()";i:7;s:115:"upload_part()";}}}i:3;a:8:{s:4:"name";s:23:"allow_hostname_override";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:168:"

Disables any subsequent use of the set_hostname() method.

";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:8:"override";s:4:"type";s:7:"boolean";s:11:"description";s:394:"

Whether or not subsequent calls to set_hostname() should be obeyed. A false value disables the further effectiveness of set_hostname(). Defaults to true.

";}}s:11:"returnvalue";s:43:"

A reference to the current instance.

";s:6:"source";s:124:"public function allow_hostname_override($override = true) { $this->override_hostname = $override; return $this; }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:46:"

Configure hostname and resource prefix.

";s:4:"code";s:316:"// Instantiate the class $ec2 = new AmazonEC2(); // Point to the new endpoint $ec2->set_hostname('localhost', '3000'); $ec2->set_resource_prefix('/services/mock'); $ec2->allow_hostname_override(false); // Describe images $response = $ec2->describe_images(); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}}i:4;a:7:{s:4:"name";s:12:"authenticate";s:8:"modifier";s:6:"public";s:11:"description";s:118:"

Authenticates a connection to Amazon S3. Do not use directly unless implementing custom methods for this class.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:9:"operation";s:4:"type";s:6:"string";s:11:"description";s:54:"

The name of the bucket to operate on (S3 Only).

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:7:"payload";s:4:"type";s:5:"array";s:11:"description";s:99:"

An associative array of parameters for authenticating. See inline comments for allowed keys.

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:17130:"public function authenticate($operation, $payload) { /* * Overriding or extending this class? You can pass the following "magic" keys into $opt. * * ## verb, resource, sub_resource and query_string ## * <verb> /<resource>?<sub_resource>&<query_string> * GET /filename.txt?versions&prefix=abc&max-items=1 * * ## versionId, uploadId, partNumber, response-* ## * These don't follow the same rules as above, in that the they needs to be signed, while * other query_string values do not. * * ## curlopts ## * These values get passed directly to the cURL methods in RequestCore. * * ## fileUpload, fileDownload, seekTo ## * These are slightly modified and then passed to the cURL methods in RequestCore. * * ## headers ## * $opt['headers'] is an array, whose keys are HTTP headers to be sent. * * ## body ## * This is the request body that is sent to the server via PUT/POST. * * ## preauth ## * This is a hook that tells authenticate() to generate a pre-authenticated URL. * * ## returnCurlHandle ## * Tells authenticate() to return the cURL handle for the request instead of executing it. */ // Rename variables (to overcome inheritence issues) $bucket = $operation; $opt = $payload; // Validate the S3 bucket name if (!$this->validate_bucketname_support($bucket)) { // @codeCoverageIgnoreStart throw new S3_Exception('S3 does not support "' . $bucket . '" as a valid bucket name. Review "Bucket Restrictions and Limitations" in the S3 Developer Guide for more information.'); // @codeCoverageIgnoreEnd } // Die if $opt isn't set. if (!$opt) return false; $method_arguments = func_get_args(); // Use the caching flow to determine if we need to do a round-trip to the server. if ($this->use_cache_flow) { // Generate an identifier specific to this particular set of arguments. $cache_id = $this->key . '_' . get_class($this) . '_' . $bucket . '_' . sha1(serialize($method_arguments)); // Instantiate the appropriate caching object. $this->cache_object = new $this->cache_class($cache_id, $this->cache_location, $this->cache_expires, $this->cache_compress); if ($this->delete_cache) { $this->use_cache_flow = false; $this->delete_cache = false; return $this->cache_object->delete(); } // Invoke the cache callback function to determine whether to pull data from the cache or make a fresh request. $data = $this->cache_object->response_manager(array($this, 'cache_callback'), $method_arguments); if ($this->parse_the_response) { // Parse the XML body $data = $this->parse_callback($data); } // End! return $data; } // If we haven't already set a resource prefix and the bucket name isn't DNS-valid... if ((!$this->resource_prefix && !$this->validate_bucketname_create($bucket)) || $this->path_style) { // Fall back to the older path-style URI $this->set_resource_prefix('/' . $bucket); $this->temporary_prefix = true; } // If the bucket name has periods and we are using SSL, we need to switch to path style URLs $bucket_name_may_cause_ssl_wildcard_failures = false; if ($this->use_ssl && strpos($bucket, '.') !== false) { $bucket_name_may_cause_ssl_wildcard_failures = true; } // Determine hostname $scheme = $this->use_ssl ? 'https://' : 'http://'; if ($bucket_name_may_cause_ssl_wildcard_failures || $this->resource_prefix || $this->path_style) { // Use bucket-in-path method $hostname = $this->hostname . $this->resource_prefix . (($bucket === '' || $this->resource_prefix === '/' . $bucket) ? '' : ('/' . $bucket)); } else { $hostname = $this->vhost ? $this->vhost : (($bucket === '') ? $this->hostname : ($bucket . '.') . $this->hostname); } // Get the UTC timestamp in RFC 2616 format $date = gmdate(CFUtilities::DATE_FORMAT_RFC2616, time()); // Storage for request parameters. $resource = ''; $sub_resource = ''; $querystringparams = array(); $signable_querystringparams = array(); $string_to_sign = ''; $headers = array( 'Content-MD5' => '', 'Content-Type' => 'application/x-www-form-urlencoded', 'Date' => $date ); /*%******************************************************************************************%*/ // Do we have an authentication token? if ($this->auth_token) { $headers['X-Amz-Security-Token'] = $this->auth_token; } // Handle specific resources if (isset($opt['resource'])) { $resource .= $opt['resource']; } // Merge query string values if (isset($opt['query_string'])) { $querystringparams = array_merge($querystringparams, $opt['query_string']); } $query_string = $this->util->to_query_string($querystringparams); // Merge the signable query string values. Must be alphabetical. $signable_list = array( 'partNumber', 'response-cache-control', 'response-content-disposition', 'response-content-encoding', 'response-content-language', 'response-content-type', 'response-expires', 'uploadId', 'versionId' ); foreach ($signable_list as $item) { if (isset($opt[$item])) { $signable_querystringparams[$item] = $opt[$item]; } } $signable_query_string = $this->util->to_query_string($signable_querystringparams); // Merge the HTTP headers if (isset($opt['headers'])) { $headers = array_merge($headers, $opt['headers']); } // Compile the URI to request $conjunction = '?'; $signable_resource = '/' . str_replace('%2F', '/', rawurlencode($resource)); $non_signable_resource = ''; if (isset($opt['sub_resource'])) { $signable_resource .= $conjunction . rawurlencode($opt['sub_resource']); $conjunction = '&'; } if ($signable_query_string !== '') { $signable_query_string = $conjunction . $signable_query_string; $conjunction = '&'; } if ($query_string !== '') { $non_signable_resource .= $conjunction . $query_string; $conjunction = '&'; } if (substr($hostname, -1) === substr($signable_resource, 0, 1)) { $signable_resource = ltrim($signable_resource, '/'); } $this->request_url = $scheme . $hostname . $signable_resource . $signable_query_string . $non_signable_resource; if (isset($opt['location'])) { $this->request_url = $opt['location']; } // Gather information to pass along to other classes. $helpers = array( 'utilities' => $this->utilities_class, 'request' => $this->request_class, 'response' => $this->response_class, ); // Instantiate the request class $request = new $this->request_class($this->request_url, $this->proxy, $helpers, $this->credentials); // Update RequestCore settings $request->request_class = $this->request_class; $request->response_class = $this->response_class; $request->ssl_verification = $this->ssl_verification; // Pass along registered stream callbacks if ($this->registered_streaming_read_callback) { $request->register_streaming_read_callback($this->registered_streaming_read_callback); } if ($this->registered_streaming_write_callback) { $request->register_streaming_write_callback($this->registered_streaming_write_callback); } // Streaming uploads if (isset($opt['fileUpload'])) { if (is_resource($opt['fileUpload'])) { // Determine the length to read from the stream $length = null; // From current position until EOF by default, size determined by set_read_stream() if (isset($headers['Content-Length'])) { $length = $headers['Content-Length']; } elseif (isset($opt['seekTo'])) { // Read from seekTo until EOF by default $stats = fstat($opt['fileUpload']); if ($stats && $stats['size'] >= 0) { $length = $stats['size'] - (integer) $opt['seekTo']; } } $request->set_read_stream($opt['fileUpload'], $length); if ($headers['Content-Type'] === 'application/x-www-form-urlencoded') { $headers['Content-Type'] = 'application/octet-stream'; } } else { $request->set_read_file($opt['fileUpload']); // Determine the length to read from the file $length = $request->read_stream_size; // The file size by default if (isset($headers['Content-Length'])) { $length = $headers['Content-Length']; } elseif (isset($opt['seekTo']) && isset($length)) { // Read from seekTo until EOF by default $length -= (integer) $opt['seekTo']; } $request->set_read_stream_size($length); // Attempt to guess the correct mime-type if ($headers['Content-Type'] === 'application/x-www-form-urlencoded') { $extension = explode('.', $opt['fileUpload']); $extension = array_pop($extension); $mime_type = CFMimeTypes::get_mimetype($extension); $headers['Content-Type'] = $mime_type; } } $headers['Content-Length'] = $request->read_stream_size; $headers['Content-MD5'] = ''; } // Handle streaming file offsets if (isset($opt['seekTo'])) { // Pass the seek position to RequestCore $request->set_seek_position((integer) $opt['seekTo']); } // Streaming downloads if (isset($opt['fileDownload'])) { if (is_resource($opt['fileDownload'])) { $request->set_write_stream($opt['fileDownload']); } else { $request->set_write_file($opt['fileDownload']); } } $curlopts = array(); // Set custom CURLOPT settings if (isset($opt['curlopts'])) { $curlopts = $opt['curlopts']; } // Debug mode if ($this->debug_mode) { $curlopts[CURLOPT_VERBOSE] = true; } // Set the curl options. if (count($curlopts)) { $request->set_curlopts($curlopts); } // Do we have a verb? if (isset($opt['verb'])) { $request->set_method($opt['verb']); $string_to_sign .= $opt['verb'] . "\n"; } // Add headers and content when we have a body if (isset($opt['body'])) { $request->set_body($opt['body']); $headers['Content-Length'] = strlen($opt['body']); if ($headers['Content-Type'] === 'application/x-www-form-urlencoded') { $headers['Content-Type'] = 'application/octet-stream'; } if (!isset($opt['NoContentMD5']) || $opt['NoContentMD5'] !== true) { $headers['Content-MD5'] = $this->util->hex_to_base64(md5($opt['body'])); } } // Handle query-string authentication if (isset($opt['preauth']) && (integer) $opt['preauth'] > 0) { unset($headers['Date']); $headers['Content-Type'] = ''; $headers['Expires'] = is_int($opt['preauth']) ? $opt['preauth'] : strtotime($opt['preauth']); } // Sort headers uksort($headers, 'strnatcasecmp'); // Add headers to request and compute the string to sign foreach ($headers as $header_key => $header_value) { // Strip linebreaks from header values as they're illegal and can allow for security issues $header_value = str_replace(array("\r", "\n"), '', $header_value); // Add the header if it has a value if ($header_value !== '') { $request->add_header($header_key, $header_value); } // Generate the string to sign if ( strtolower($header_key) === 'content-md5' || strtolower($header_key) === 'content-type' || strtolower($header_key) === 'date' || (strtolower($header_key) === 'expires' && isset($opt['preauth']) && (integer) $opt['preauth'] > 0) ) { $string_to_sign .= $header_value . "\n"; } elseif (substr(strtolower($header_key), 0, 6) === 'x-amz-') { $string_to_sign .= strtolower($header_key) . ':' . $header_value . "\n"; } } // Add the signable resource location $string_to_sign .= ($this->resource_prefix ? $this->resource_prefix : ''); $string_to_sign .= (($bucket === '' || $this->resource_prefix === '/' . $bucket) ? '' : ('/' . $bucket)) . $signable_resource . urldecode($signable_query_string); // Hash the AWS secret key and generate a signature for the request. $signature = base64_encode(hash_hmac('sha1', $string_to_sign, $this->secret_key, true)); $request->add_header('Authorization', 'AWS ' . $this->key . ':' . $signature); // If we're generating a URL, return the URL to the calling method. if (isset($opt['preauth']) && (integer) $opt['preauth'] > 0) { $query_params = array( 'AWSAccessKeyId' => $this->key, 'Expires' => $headers['Expires'], 'Signature' => $signature, ); // If using short-term credentials, add the token to the query string if ($this->auth_token) { $query_params['x-amz-security-token'] = $this->auth_token; } return $this->request_url . $conjunction . http_build_query($query_params, '', '&'); } elseif (isset($opt['preauth'])) { return $this->request_url; } /*%******************************************************************************************%*/ // If our changes were temporary, reset them. if ($this->temporary_prefix) { $this->temporary_prefix = false; $this->resource_prefix = null; } // Manage the (newer) batch request API or the (older) returnCurlHandle setting. if ($this->use_batch_flow) { $handle = $request->prep_request(); $this->batch_object->add($handle); $this->use_batch_flow = false; return $handle; } elseif (isset($opt['returnCurlHandle']) && $opt['returnCurlHandle'] === true) { return $request->prep_request(); } // Send! $request->send_request(); // Prepare the response $headers = $request->get_response_header(); $headers['x-aws-request-url'] = $this->request_url; $headers['x-aws-redirects'] = $this->redirects; $headers['x-aws-stringtosign'] = $string_to_sign; $headers['x-aws-requestheaders'] = $request->request_headers; // Did we have a request body? if (isset($opt['body'])) { $headers['x-aws-requestbody'] = $opt['body']; } $data = new $this->response_class($headers, $this->parse_callback($request->get_response_body()), $request->get_response_code()); // Did Amazon tell us to redirect? Typically happens for multiple rapid requests EU datacenters. // @see: http://docs.amazonwebservices.com/AmazonS3/latest/dev/Redirects.html // @codeCoverageIgnoreStart if ((integer) $request->get_response_code() === 307) // Temporary redirect to new endpoint. { $this->redirects++; $opt['location'] = $headers['location']; $data = $this->authenticate($bucket, $opt); } // Was it Amazon's fault the request failed? Retry the request until we reach $max_retries. elseif ((integer) $request->get_response_code() === 500 || (integer) $request->get_response_code() === 503) { if ($this->redirects <= $this->max_retries) { // Exponential backoff $delay = (integer) (pow(4, $this->redirects) * 100000); usleep($delay); $this->redirects++; $data = $this->authenticate($bucket, $opt); } } // @codeCoverageIgnoreEnd // Return! $this->redirects = 0; return $data; }";s:7:"seealso";a:1:{s:4:"link";s:110:"REST authentication";}}i:5;a:8:{s:4:"name";s:5:"batch";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:86:"

Specifies that the intended request should be queued for a later batch request.

";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:5:"queue";s:4:"type";s:14:"CFBatchRequest";s:11:"description";s:327:"

The CFBatchRequest instance to use for managing batch requests. If not available, it generates a new instance of CFBatchRequest.

";}}s:11:"returnvalue";s:43:"

A reference to the current instance.

";s:6:"source";s:477:"public function batch(CFBatchRequest &$queue = null) { if ($queue) { $this->batch_object = $queue; } elseif ($this->internal_batch_object) { $this->batch_object = &$this->internal_batch_object; } else { $this->internal_batch_object = new $this->batch_class(); $this->batch_object = &$this->internal_batch_object; } $this->use_batch_flow = true; return $this; }";s:8:"examples";a:1:{s:7:"example";a:2:{i:0;a:4:{s:5:"title";s:76:"

Batch several requests together, and then cache the responses to APC.

";s:11:"description";s:87:"

Note: This method is inherited by all service-specific classes.

";s:4:"code";s:520:"// Instantiate $sdb = new AmazonSDB(); $sdb->set_cache_config('apc'); // Prepare for parallel requests $sdb->batch()->list_domains(); $sdb->batch()->list_domains(); // First time pulls live data $response = $sdb->batch()->cache('1 minute')->send(false); var_dump($response[0]->isOK()); var_dump($response[1]->isOK()); // Second time pulls from cache $response = $sdb->batch()->cache('1 minute')->send(false); var_dump($response[0]->isOK()); var_dump($response[1]->isOK());";s:6:"result";s:43:"bool(true) bool(true) bool(true) bool(true)";}i:1;a:4:{s:5:"title";s:88:"

Batch several requests together, and then cache the responses to the file system.

";s:11:"description";s:87:"

Note: This method is inherited by all service-specific classes.

";s:4:"code";s:524:"// Instantiate $sdb = new AmazonSDB(); $sdb->set_cache_config('./cache'); // Prepare for parallel requests $sdb->batch()->list_domains(); $sdb->batch()->list_domains(); // First time pulls live data $response = $sdb->batch()->cache('1 minute')->send(false); var_dump($response[0]->isOK()); var_dump($response[1]->isOK()); // Second time pulls from cache $response = $sdb->batch()->cache('1 minute')->send(false); var_dump($response[0]->isOK()); var_dump($response[1]->isOK());";s:6:"result";s:43:"bool(true) bool(true) bool(true) bool(true)";}}}}i:6;a:8:{s:4:"name";s:5:"cache";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:321:"

Specifies that the resulting CFResponse object should be cached according to the settings from set_cache_config().

";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:7:"expires";s:4:"type";s:14:"string|integer";s:11:"description";s:232:"

The time the cache is to expire. Accepts a number of seconds as an integer, or an amount of time, as a string, that is understood by strtotime() (e.g. “1 hour”).

";}}s:11:"returnvalue";s:43:"

A reference to the current instance.

";s:6:"source";s:501:"public function cache($expires) { // Die if they haven't used set_cache_config(). if (!$this->cache_class) { throw new CFRuntime_Exception('Must call set_cache_config() before using cache()'); } if (is_string($expires)) { $expires = strtotime($expires); $this->cache_expires = $expires - time(); } elseif (is_int($expires)) { $this->cache_expires = $expires; } $this->use_cache_flow = true; return $this; }";s:8:"examples";a:1:{s:7:"example";a:5:{i:0;a:4:{s:5:"title";s:65:"

Fire a single request, and then cache the response to APC.

";s:11:"description";s:87:"

Note: This method is inherited by all service-specific classes.

";s:4:"code";s:302:"// Instantiate $sdb = new AmazonSDB(); $sdb->set_cache_config('apc'); // First time pulls live data $response = $sdb->cache(10)->list_domains(); var_dump($response->isOK()); // Second time pulls from cache $response = $sdb->cache(10)->list_domains(); var_dump($response->isOK());";s:6:"result";s:21:"bool(true) bool(true)";}i:1;a:4:{s:5:"title";s:77:"

Fire a single request, and then cache the response to the file system.

";s:11:"description";s:87:"

Note: This method is inherited by all service-specific classes.

";s:4:"code";s:306:"// Instantiate $sdb = new AmazonSDB(); $sdb->set_cache_config('./cache'); // First time pulls live data $response = $sdb->cache(10)->list_domains(); var_dump($response->isOK()); // Second time pulls from cache $response = $sdb->cache(10)->list_domains(); var_dump($response->isOK());";s:6:"result";s:21:"bool(true) bool(true)";}i:2;a:4:{s:5:"title";s:70:"

Fire a single request, and then cache the response to Memcache.

";s:11:"description";s:87:"

Note: This method is inherited by all service-specific classes.

";s:4:"code";s:338:"// Instantiate $sdb = new AmazonSDB(); $sdb->set_cache_config(array( array('host' => '127.0.0.1') )); // First time pulls live data $response = $sdb->cache(10)->list_domains(); var_dump($response->isOK()); // Second time pulls from cache $response = $sdb->cache(10)->list_domains(); var_dump($response->isOK());";s:6:"result";s:21:"bool(true) bool(true)";}i:3;a:4:{s:5:"title";s:76:"

Batch several requests together, and then cache the responses to APC.

";s:11:"description";s:87:"

Note: This method is inherited by all service-specific classes.

";s:4:"code";s:520:"// Instantiate $sdb = new AmazonSDB(); $sdb->set_cache_config('apc'); // Prepare for parallel requests $sdb->batch()->list_domains(); $sdb->batch()->list_domains(); // First time pulls live data $response = $sdb->batch()->cache('1 minute')->send(false); var_dump($response[0]->isOK()); var_dump($response[1]->isOK()); // Second time pulls from cache $response = $sdb->batch()->cache('1 minute')->send(false); var_dump($response[0]->isOK()); var_dump($response[1]->isOK());";s:6:"result";s:43:"bool(true) bool(true) bool(true) bool(true)";}i:4;a:4:{s:5:"title";s:88:"

Batch several requests together, and then cache the responses to the file system.

";s:11:"description";s:87:"

Note: This method is inherited by all service-specific classes.

";s:4:"code";s:524:"// Instantiate $sdb = new AmazonSDB(); $sdb->set_cache_config('./cache'); // Prepare for parallel requests $sdb->batch()->list_domains(); $sdb->batch()->list_domains(); // First time pulls live data $response = $sdb->batch()->cache('1 minute')->send(false); var_dump($response[0]->isOK()); var_dump($response[1]->isOK()); // Second time pulls from cache $response = $sdb->batch()->cache('1 minute')->send(false); var_dump($response[0]->isOK()); var_dump($response[1]->isOK());";s:6:"result";s:43:"bool(true) bool(true) bool(true) bool(true)";}}}}i:7;a:7:{s:4:"name";s:34:"cache_instance_profile_credentials";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:139:"

Fetches and caches EC2 instance profile credentials. This is meant to be used by the constructor, and is not to be manually invoked.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:5:"cache";s:4:"type";s:9:"CacheCore";s:11:"description";s:84:"

The a reference to the cache object that is being used to handle the caching.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:7:"options";s:4:"type";s:5:"array";s:11:"description";s:57:"

The options that were passed into the constructor.

";}}}s:11:"returnvalue";s:38:"

The data to be cached, or NULL.

";s:6:"source";s:2563:"public function cache_instance_profile_credentials($cache, $options) { $instance_profile_url = 'http://169.254.169.254/latest/meta-data/iam/security-credentials/'; $connect_timeout = isset($options['instance_profile_timeout']) ? $options['instance_profile_timeout'] : 2; try { // Make a call to the EC2 Metadata Service to find the available instance profile $request = new RequestCore($instance_profile_url); $request->set_curlopts(array(CURLOPT_CONNECTTIMEOUT => $connect_timeout)); $response = $request->send_request(true); if ($response->isOK()) { // Get the instance profile name $profile = (string) $response->body; // Make a call to the EC2 Metadata Service to get the instance profile credentials $request = new RequestCore($instance_profile_url . $profile); $request->set_curlopts(array(CURLOPT_CONNECTTIMEOUT => $connect_timeout)); $response = $request->send_request(true); if ($response->isOK()) { // Get the credentials $credentials = json_decode($response->body, true); if ($credentials['Code'] === 'Success') { // Determine the expiration time $expiration_time = strtotime((string) $credentials['Expiration']); $expiration_duration = round(($expiration_time - time()) * 0.85); $cache->expire_in($expiration_duration); // Return the credential information return array( 'key' => $credentials['AccessKeyId'], 'secret' => $credentials['SecretAccessKey'], 'token' => $credentials['Token'], 'expires' => $credentials['Expiration'], ); } } } } catch (cURL_Exception $e) { // The EC2 Metadata Service does not exist or had timed out. // An exception will be thrown on the next line. } // @codeCoverageIgnoreStart throw new CFCredentials_Exception('No credentials were provided. The SDK attempted to retrieve Instance ' . 'Profile credentials from the EC2 Instance Metadata Service, but failed to do so. Instance profile ' . 'credentials are only accessible on EC2 instances configured with a specific IAM role.'); // @codeCoverageIgnoreEnd }";}i:8;a:7:{s:4:"name";s:21:"cache_sts_credentials";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:122:"

Fetches and caches STS credentials. This is meant to be used by the constructor, and is not to be manually invoked.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:5:"cache";s:4:"type";s:9:"CacheCore";s:11:"description";s:84:"

The a reference to the cache object that is being used to handle the caching.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:7:"options";s:4:"type";s:5:"array";s:11:"description";s:57:"

The options that were passed into the constructor.

";}}}s:11:"returnvalue";s:38:"

The data to be cached, or NULL.

";s:6:"source";s:1226:"public function cache_sts_credentials($cache, $options) { $token = new AmazonSTS($options); $response = $token->get_session_token(); if ($response->isOK()) { // Update the expiration $expiration_time = strtotime((string) $response->body->GetSessionTokenResult->Credentials->Expiration); $expiration_duration = round(($expiration_time - time()) * 0.85); $cache->expire_in($expiration_duration); // Return the important data $credentials = $response->body->GetSessionTokenResult->Credentials; return array( 'key' => (string) $credentials->AccessKeyId, 'secret' => (string) $credentials->SecretAccessKey, 'token' => (string) $credentials->SessionToken, 'expires' => (string) $credentials->Expiration, ); } // @codeCoverageIgnoreStart throw new STS_Exception('Temporary credentials from the AWS Security ' . 'Token Service could not be retrieved using the provided long ' . 'term credentials. It\'s possible that the provided long term ' . 'credentials were invalid.'); // @codeCoverageIgnoreEnd }";}i:9;a:8:{s:4:"name";s:19:"change_content_type";s:8:"modifier";s:6:"public";s:11:"description";s:65:"

Changes the content type for an existing Amazon S3 object.

";s:10:"parameters";a:1:{s:9:"parameter";a:4:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

The file name for the object.

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:11:"contentType";s:4:"type";s:6:"string";s:11:"description";s:47:"

The content-type to apply to the object.

";}i:3;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:889:"public function change_content_type($bucket, $filename, $contentType, $opt = null) { if (!$opt) $opt = array(); // Retrieve the original metadata $metadata = $this->get_object_metadata($bucket, $filename); if ($metadata && isset($metadata['ACL'])) { $opt['acl'] = $metadata['ACL']; } if ($metadata && isset($metadata['StorageClass'])) { $opt['headers']['x-amz-storage-class'] = $metadata['StorageClass']; } // Merge optional parameters $opt = array_merge_recursive(array( 'headers' => array( 'Content-Type' => $contentType ), 'metadataDirective' => 'REPLACE' ), $opt); return $this->copy_object( array('bucket' => $bucket, 'filename' => $filename), array('bucket' => $bucket, 'filename' => $filename), $opt ); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:44:"

Change the content type of an object.

";s:4:"code";s:317:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $cct = $s3->change_content_type($bucket, 'test1.txt', 'text/plain'); sleep(5); $metadata = $s3->get_object_metadata($bucket, 'test1.txt'); // Success? var_dump($cct->isOK()); var_dump($metadata['ContentType']);";s:6:"result";s:34:"bool(true) string(10) "text/plain"";}}s:7:"related";a:1:{s:6:"method";a:2:{i:0;s:157:"change_storage_redundancy()";i:1;s:139:"get_object_metadata()";}}}i:10;a:8:{s:4:"name";s:25:"change_storage_redundancy";s:8:"modifier";s:6:"public";s:11:"description";s:61:"

Changes the storage redundancy for an existing object.

";s:10:"parameters";a:1:{s:9:"parameter";a:4:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

The file name for the object.

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:7:"storage";s:4:"type";s:6:"string";s:11:"description";s:148:"

The storage setting to apply to the object. [Allowed values: AmazonS3::STORAGE_STANDARD, AmazonS3::STORAGE_REDUCED]

";}i:3;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:825:"public function change_storage_redundancy($bucket, $filename, $storage, $opt = null) { if (!$opt) $opt = array(); // Retrieve the original metadata $metadata = $this->get_object_metadata($bucket, $filename); if ($metadata && isset($metadata['ACL'])) { $opt['acl'] = $metadata['ACL']; } if ($metadata && isset($metadata['StorageClass'])) { $opt['headers']['x-amz-storage-class'] = $metadata['StorageClass']; } // Merge optional parameters $opt = array_merge(array( 'storage' => $storage, 'metadataDirective' => 'COPY', ), $opt); return $this->copy_object( array('bucket' => $bucket, 'filename' => $filename), array('bucket' => $bucket, 'filename' => $filename), $opt ); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:47:"

Change the preferred storage redundancy.

";s:4:"code";s:337:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $csr = $s3->change_storage_redundancy($bucket, 'test1.txt', AmazonS3::STORAGE_REDUCED); sleep(5); $metadata = $s3->get_object_metadata($bucket, 'test1.txt'); // Success? var_dump($csr->isOK()); var_dump($metadata['StorageClass']);";s:6:"result";s:42:"bool(true) string(18) "REDUCED_REDUNDANCY"";}}s:7:"related";a:1:{s:6:"method";a:2:{i:0;s:139:"change_content_type()";i:1;s:139:"get_object_metadata()";}}}i:11;a:8:{s:4:"name";s:25:"complete_multipart_upload";s:8:"modifier";s:6:"public";s:11:"description";s:210:"

Completes an in-progress multipart upload. A multipart upload is completed by describing the part numbers and corresponding ETag values in order, and submitting that data to Amazon S3 as an XML document.

";s:10:"parameters";a:1:{s:9:"parameter";a:5:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

The file name for the object.

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:9:"upload_id";s:4:"type";s:6:"string";s:11:"description";s:284:"

The upload ID identifying the multipart upload whose parts are being listed. The upload ID is retrieved from a call to initiate_multipart_upload().

";}i:3;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:5:"parts";s:4:"type";s:40:"string|array|SimpleXMLElement|CFResponse";s:11:"description";s:570:"

The completion XML document. This document can be provided in multiple ways; as a string of XML, as a SimpleXMLElement object representing the XML document, as an indexed array of associative arrays where the keys are PartNumber and ETag, or as a CFResponse object returned by list_parts().

";}i:4;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:1729:"public function complete_multipart_upload($bucket, $filename, $upload_id, $parts, $opt = null) { if (!$opt) $opt = array(); // Add this to our request $opt['verb'] = 'POST'; $opt['resource'] = $filename; $opt['uploadId'] = $upload_id; $opt['headers'] = array( 'Content-Type' => 'application/xml' ); // Disable Content-MD5 calculation for this operation $opt['NoContentMD5'] = true; if (is_string($parts)) { // Assume it's the intended XML. $opt['body'] = $parts; } elseif ($parts instanceof SimpleXMLElement) { // Assume it's a SimpleXMLElement object representing the XML. $opt['body'] = $parts->asXML(); } elseif (is_array($parts) || $parts instanceof CFResponse) { $xml = simplexml_load_string($this->complete_mpu_xml); if (is_array($parts)) { // Generate the appropriate XML. foreach ($parts as $node) { $part = $xml->addChild('Part'); $part->addChild('PartNumber', $node['PartNumber']); $part->addChild('ETag', $node['ETag']); } } elseif ($parts instanceof CFResponse) { // Assume it's a response from list_parts(). foreach ($parts->body->Part as $node) { $part = $xml->addChild('Part'); $part->addChild('PartNumber', (string) $node->PartNumber); $part->addChild('ETag', (string) $node->ETag); } } $opt['body'] = $xml->asXML(); } // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{i:0;a:4:{s:5:"title";s:70:"

Complete a multipart upload using a response from list_parts().

";s:11:"description";s:236:"
  1. Initiate a new multipart upload using initiate_multipart_upload().
  2. Upload the parts using upload_part().
  3. Complete the upload using complete_multipart_upload().
";s:4:"code";s:490:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $filename = 'movie.mp4'; $upload_id = 'f_JM_zwhU37pj1tS.F2BXVWUJtGcNso1WEikZImjrBCYUbUQwNnOUwX.Z00O1QmKQXAjqQBD4BVZRGmEXAMPLE--'; // Get a list of up to 1000 parts $parts = $s3->list_parts($bucket, $filename, $upload_id); // Initiate a new multipart upload $response = $s3->complete_multipart_upload($bucket, $filename, $upload_id, $parts); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:1;a:3:{s:5:"title";s:50:"

Complete a multipart upload using a string.

";s:4:"code";s:1058:"$xml = <<<HTML <?xml version="1.0" encoding="utf-8" <CompleteMultipartUpload> <Part> <PartNumber>1</PartNumber> <ETag>"25e317773f308e446cc84c503a6d1f85"</ETag> </Part> <Part> <PartNumber>2</PartNumber> <ETag>"25e317773f308e446cc84c503a6d1f85"</ETag> </Part> <Part> <PartNumber>3</PartNumber> <ETag>"bed3c0a4a1407f584989b4009e9ce33f"</ETag> </Part> </CompleteMultipartUpload> HTML; // Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $filename = 'movie.mp4'; $upload_id = 'f_JM_zwhU37pj1tS.F2BXVWUJtGcNso1WEikZImjrBCYUbUQwNnOUwX.Z00O1QmKQXAjqQBD4BVZRGmEXAMPLE--'; // Get a list of up to 1000 parts $parts = $s3->list_parts($bucket, $filename, $upload_id); // Initiate a new multipart upload $response = $s3->complete_multipart_upload($bucket, $filename, $upload_id, $xml); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:2;a:3:{s:5:"title";s:50:"

Complete a multipart upload using an array.

";s:4:"code";s:765:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $filename = 'movie.mp4'; $upload_id = 'f_JM_zwhU37pj1tS.F2BXVWUJtGcNso1WEikZImjrBCYUbUQwNnOUwX.Z00O1QmKQXAjqQBD4BVZRGmEXAMPLE--'; // Get a list of up to 1000 parts $parts = $s3->list_parts($bucket, $filename, $upload_id); // Initiate a new multipart upload $response = $s3->complete_multipart_upload($bucket, $filename, $upload_id, array( array('PartNumber' => 1, 'ETag' => '"25e317773f308e446cc84c503a6d1f85"'), array('PartNumber' => 2, 'ETag' => '"a6d1f85f58498973f308e446cc84c503"'), array('PartNumber' => 3, 'ETag' => '"bed3c0a4a1407f584989b4009e9ce33f"'), )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}}s:7:"related";a:1:{s:6:"method";a:8:{i:0;s:148:"abort_multipart_upload()";i:1;s:175:"abort_multipart_uploads_by_date()";i:2;s:133:"create_mpu_object()";i:3;s:142:"get_multipart_counts()";i:4;s:157:"initiate_multipart_upload()";i:5;s:148:"list_multipart_uploads()";i:6;s:112:"list_parts()";i:7;s:115:"upload_part()";}}}i:12;a:9:{s:4:"name";s:11:"copy_object";s:8:"modifier";s:6:"public";s:11:"description";s:199:"

Copies an Amazon S3 object to a new location, whether in the same Amazon S3 region, bucket, or otherwise.

NOTE: Object redirect locations are not carried over when an object is copied.

";s:10:"parameters";a:1:{s:9:"parameter";a:3:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"source";s:4:"type";s:5:"array";s:11:"description";s:333:"

The bucket and file name to copy from. The following keys must be set:

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:4:"dest";s:4:"type";s:5:"array";s:11:"description";s:317:"

The bucket and file name to copy to. The following keys must be set:

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:3736:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:3346:"public function copy_object($source, $dest, $opt = null) { if (!$opt) $opt = array(); $batch = array(); // Add this to our request $opt['verb'] = 'PUT'; $opt['resource'] = $dest['filename']; $opt['body'] = ''; // Handle copy source if (isset($source['bucket']) && isset($source['filename'])) { $opt['headers']['x-amz-copy-source'] = '/' . $source['bucket'] . '/' . rawurlencode($source['filename']) . (isset($opt['versionId']) ? ('?' . 'versionId=' . rawurlencode($opt['versionId'])) : ''); // Append the versionId to copy, if available unset($opt['versionId']); } // Handle metadata directive $opt['headers']['x-amz-metadata-directive'] = 'COPY'; if ($source['bucket'] === $dest['bucket'] && $source['filename'] === $dest['filename']) { $opt['headers']['x-amz-metadata-directive'] = 'REPLACE'; } if (isset($opt['metadataDirective'])) { $opt['headers']['x-amz-metadata-directive'] = $opt['metadataDirective']; unset($opt['metadataDirective']); } // Handle Access Control Lists. Can also pass canned ACLs as an HTTP header. if (isset($opt['acl']) && is_array($opt['acl'])) { $batch[] = $this->set_object_acl($dest['bucket'], $dest['filename'], $opt['acl'], array( 'returnCurlHandle' => true )); unset($opt['acl']); } elseif (isset($opt['acl'])) { $opt['headers']['x-amz-acl'] = $opt['acl']; unset($opt['acl']); } // Handle storage settings. Can also be passed as an HTTP header. if (isset($opt['storage'])) { $opt['headers']['x-amz-storage-class'] = $opt['storage']; unset($opt['storage']); } // Handle encryption settings. Can also be passed as an HTTP header. if (isset($opt['encryption'])) { $opt['headers']['x-amz-server-side-encryption'] = $opt['encryption']; unset($opt['encryption']); } // Handle conditional-copy parameters if (isset($opt['ifMatch'])) { $opt['headers']['x-amz-copy-source-if-match'] = $opt['ifMatch']; unset($opt['ifMatch']); } if (isset($opt['ifNoneMatch'])) { $opt['headers']['x-amz-copy-source-if-none-match'] = $opt['ifNoneMatch']; unset($opt['ifNoneMatch']); } if (isset($opt['ifUnmodifiedSince'])) { $opt['headers']['x-amz-copy-source-if-unmodified-since'] = $opt['ifUnmodifiedSince']; unset($opt['ifUnmodifiedSince']); } if (isset($opt['ifModifiedSince'])) { $opt['headers']['x-amz-copy-source-if-modified-since'] = $opt['ifModifiedSince']; unset($opt['ifModifiedSince']); } // Handle meta tags. Can also be passed as an HTTP header. if (isset($opt['meta'])) { foreach ($opt['meta'] as $meta_key => $meta_value) { // e.g., `My Meta Header` is converted to `x-amz-meta-my-meta-header`. $opt['headers']['x-amz-meta-' . strtolower(str_replace(' ', '-', $meta_key))] = $meta_value; } unset($opt['meta']); } // Authenticate to S3 $response = $this->authenticate($dest['bucket'], $opt); // Attempt to reset ACLs $http = new CFRequest(); $http->send_multi_request($batch); return $response; }";s:8:"examples";a:1:{s:7:"example";a:5:{i:0;a:3:{s:5:"title";s:63:"

Copy an object by specifying a source and a destination.

";s:4:"code";s:343:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->copy_object( array( // Source 'bucket' => $bucket, 'filename' => 'test1.txt' ), array( // Destination 'bucket' => $bucket, 'filename' => 'test2.txt' ) ); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:1;a:3:{s:5:"title";s:72:"

Copy an object, setting the new object to use reduced redundancy.

";s:4:"code";s:452:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->copy_object( array( // Source 'bucket' => $bucket, 'filename' => 'prefix/one/two/test1.txt' ), array( // Destination 'bucket' => $bucket, 'filename' => 'prefix/one/two/test2.txt' ), array( // Optional parameters 'storage' => AmazonS3::STORAGE_REDUCED ) ); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:2;a:3:{s:5:"title";s:58:"

Copy an object, setting other headers and settings.

";s:4:"code";s:499:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->copy_object( array( // Source 'bucket' => $bucket, 'filename' => 'test1.txt' ), array( // Destination 'bucket' => $bucket, 'filename' => 'test2.txt' ), array( // Optional parameters 'acl' => AmazonS3::ACL_PUBLIC, 'meta' => array( 'x-fake-header' => 'something awesome is happening' ) ) ); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:3;a:4:{s:5:"title";s:44:"

Copy a specific version of an object.

";s:11:"description";s:82:"

Note: Requires versioning to be enabled on a bucket first.

";s:4:"code";s:473:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->copy_object( array( // Source 'bucket' => $bucket, 'filename' => 'test1.txt' ), array( // Destination 'bucket' => $bucket, 'filename' => 'test-version.txt' ), array( // Optional parameters 'versionId' => '0NNAq8PwvXvg8EfAYG9sSmwKTZeixZgZNE6PbodG8td0DJ3gVOmjI2Gh/oFnb0Ie=' ) ); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:4;a:3:{s:5:"title";s:88:"

Conditionally copy an object — only if the original is newer than what we have.

";s:4:"code";s:762:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Store the `etag` and `last-modified` headers the first time we pull down an object. $head = $s3->get_object_headers($bucket, 'test1.txt'); $etag = $head->header['etag']; $last_modified = $head->header['last-modified']; /*---- Later... ----*/ // Copy, only if the original is newer than what we have $response = $s3->copy_object( array( // Source 'bucket' => $bucket, 'filename' => 'test1.txt' ), array( // Destination 'bucket' => $bucket, 'filename' => 'test2.txt' ), array( // Conditional Copy 'ifNoneMatch' => $etag, 'ifModifiedSince' => $last_modified ) ); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}}s:7:"related";a:1:{s:6:"method";a:11:{i:0;s:121:"create_object()";i:1;s:121:"delete_object()";i:2;s:112:"get_object()";i:3;s:124:"get_object_acl()";i:4;s:139:"get_object_filesize()";i:5;s:136:"get_object_headers()";i:6;s:127:"get_object_list()";i:7;s:130:"if_object_exists()";i:8;s:118:"list_objects()";i:9;s:124:"set_object_acl()";i:10;s:121:"update_object()";}}s:7:"seealso";a:1:{s:4:"link";s:117:"Copying Amazon S3 Objects";}}i:13;a:7:{s:4:"name";s:9:"copy_part";s:8:"modifier";s:6:"public";s:11:"description";s:1136:"

Since Amazon S3’s standard copy_object() operation only supports copying objects that are smaller than 5 GB, the ability to copy large objects (greater than 5 GB) requires the use of “Multipart Copy”.

Copying large objects requires the developer to initiate a new multipart “upload”, copy pieces of the large object (specifying a range of bytes up to 5 GB from the large source file), then complete the multipart “upload”.

NOTE: This is a synchronous operation, not an asynchronous operation, which means that Amazon S3 will not return a response for this operation until the copy has completed across the Amazon S3 server fleet. Copying objects within a single region will complete more quickly than copying objects across regions. The synchronous nature of this operation is different from other services where responses are typically returned immediately, even if the operation itself has not yet been completed on the server-side.

";s:10:"parameters";a:1:{s:9:"parameter";a:5:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"source";s:4:"type";s:5:"array";s:11:"description";s:333:"

The bucket and file name to copy from. The following keys must be set:

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:4:"dest";s:4:"type";s:5:"array";s:11:"description";s:317:"

The bucket and file name to copy to. The following keys must be set:

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:9:"upload_id";s:4:"type";s:6:"string";s:11:"description";s:284:"

The upload ID identifying the multipart upload whose parts are being listed. The upload ID is retrieved from a call to initiate_multipart_upload().

";}i:3;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:11:"part_number";s:4:"type";s:7:"integer";s:11:"description";s:366:"

A part number uniquely identifies a part and defines its position within the destination object. When you complete a multipart upload, a complete object is created by concatenating parts in ascending order based on part number. If you copy a new part using the same part number as a previously copied/uploaded part, the previously written part is overwritten.

";}i:4;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:2358:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:1663:"public function copy_part($source, $dest, $upload_id, $part_number, $opt = null) { if (!$opt) $opt = array(); // Add this to our request $opt['verb'] = 'PUT'; $opt['resource'] = $dest['filename']; $opt['uploadId'] = $upload_id; $opt['partNumber'] = $part_number; // Handle copy source if (isset($source['bucket']) && isset($source['filename'])) { $opt['headers']['x-amz-copy-source'] = '/' . $source['bucket'] . '/' . rawurlencode($source['filename']) . (isset($opt['versionId']) ? ('?' . 'versionId=' . rawurlencode($opt['versionId'])) : ''); // Append the versionId to copy, if available unset($opt['versionId']); } // Handle conditional-copy parameters if (isset($opt['ifMatch'])) { $opt['headers']['x-amz-copy-source-if-match'] = $opt['ifMatch']; unset($opt['ifMatch']); } if (isset($opt['ifNoneMatch'])) { $opt['headers']['x-amz-copy-source-if-none-match'] = $opt['ifNoneMatch']; unset($opt['ifNoneMatch']); } if (isset($opt['ifUnmodifiedSince'])) { $opt['headers']['x-amz-copy-source-if-unmodified-since'] = $opt['ifUnmodifiedSince']; unset($opt['ifUnmodifiedSince']); } if (isset($opt['ifModifiedSince'])) { $opt['headers']['x-amz-copy-source-if-modified-since'] = $opt['ifModifiedSince']; unset($opt['ifModifiedSince']); } // Partial content range if (isset($opt['range'])) { $opt['headers']['x-amz-copy-source-range'] = 'bytes=' . $opt['range']; } // Authenticate to S3 return $this->authenticate($dest['bucket'], $opt); }";s:8:"examples";a:1:{s:7:"example";a:4:{s:5:"title";s:227:"

Copying a large object (5+ GB) using the "multipart" flow. Objects smaller than 5 GB should use copy_object() instead.

";s:11:"description";s:385:"
  1. Initiate a new large object copy using initiate_multipart_upload().
  2. Using the copy_part() method, copy the large object in 5 GB “parts” by specifying the range option. The final part can be any size smaller than 5 GB.
  3. Complete the large object copy using complete_multipart_upload().
";s:4:"code";s:630:"// Define a gigabyte define('GB', 1024 * 1024 * 1024); // Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Copy a part. The source file MUST be larger than 5 GB. $response = $s3->copy_part( array( // Source 'bucket' => $bucket, 'filename' => 'movie.mp4' ), array( // Destination 'bucket' => $bucket, 'filename' => 'file2.junk' ), 'f_JM_zwhU37pj1tS.F2BXVWUJtGcNso1WEikZImjrBCYUbUQwNnOUwX.Z00O1QmKQXAjqQBD4BVZRGmEXAMPLE--', // Upload ID 1, // Part Number array( 'range' => '0-' . 5*GB ) ); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}}i:14;a:9:{s:4:"name";s:13:"create_bucket";s:8:"modifier";s:6:"public";s:11:"description";s:292:"

Creates an Amazon S3 bucket.

Every object stored in Amazon S3 is contained in a bucket. Buckets partition the namespace of objects stored in Amazon S3 at the top level. in a bucket, any name can be used for objects. However, bucket names must be unique across all of Amazon S3.

";s:10:"parameters";a:1:{s:9:"parameter";a:4:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:40:"

The name of the bucket to create.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"region";s:4:"type";s:6:"string";s:11:"description";s:266:"

The preferred geographical location for the bucket. [Allowed values: AmazonS3::REGION_US_E1, AmazonS3::REGION_US_W1, AmazonS3::REGION_EU_W1, AmazonS3::REGION_APAC_SE1, AmazonS3::REGION_APAC_NE1]

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"acl";s:4:"type";s:6:"string";s:11:"description";s:515:"

The ACL settings for the specified object. Accepts any of the following constants: [Allowed values: AmazonS3::ACL_PRIVATE, AmazonS3::ACL_PUBLIC, AmazonS3::ACL_OPEN, AmazonS3::ACL_AUTH_READ, AmazonS3::ACL_OWNER_READ, AmazonS3::ACL_OWNER_FULL_CONTROL]. Alternatively, an array of associative arrays. Each associative array contains an id and a permission key. The default value is ACL_PRIVATE.

";}i:3;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:460:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:2256:"public function create_bucket($bucket, $region, $acl = self::ACL_PRIVATE, $opt = null) { // If the bucket contains uppercase letters... if (preg_match('/[A-Z]/', $bucket)) { // Throw a warning trigger_error('Since DNS-valid bucket names cannot contain uppercase characters, "' . $bucket . '" has been automatically converted to "' . strtolower($bucket) . '"', E_USER_WARNING); // Force the bucketname to lowercase $bucket = strtolower($bucket); } // Validate the S3 bucket name for creation if (!$this->validate_bucketname_create($bucket)) { // @codeCoverageIgnoreStart throw new S3_Exception('"' . $bucket . '" is not DNS-valid (i.e., <bucketname>.s3.amazonaws.com), and cannot be used as an S3 bucket name. Review "Bucket Restrictions and Limitations" in the S3 Developer Guide for more information.'); // @codeCoverageIgnoreEnd } if (!$opt) $opt = array(); $opt['verb'] = 'PUT'; $opt['headers'] = array( 'Content-Type' => 'application/xml' ); // Handle Access Control Lists. Can also be passed as an HTTP header. if (isset($acl)) { if (is_array($acl)) { $opt['headers'] = array_merge($opt['headers'], $this->generate_access_policy_headers($acl)); } else { $opt['headers']['x-amz-acl'] = $acl; } } // Defaults $this->set_region($region); // Also sets path-style $xml = simplexml_load_string($this->base_location_constraint); switch ($region) { case self::REGION_US_E1: // Northern Virginia $opt['body'] = ''; break; case self::REGION_EU_W1: // Ireland $xml->LocationConstraint = 'EU'; $opt['body'] = $xml->asXML(); break; default: $xml->LocationConstraint = str_replace(array('s3-', '.amazonaws.com'), '', $region); $opt['body'] = $xml->asXML(); break; } $response = $this->authenticate($bucket, $opt); // Make sure we're set back to DNS-style URLs $this->enable_path_style(false); return $response; }";s:8:"examples";a:1:{s:7:"example";a:3:{i:0;a:3:{s:5:"title";s:55:"

Create a new bucket, setting the storage region.

";s:4:"code";s:215:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->create_bucket($bucket, AmazonS3::REGION_US_STANDARD); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:1;a:3:{s:5:"title";s:72:"

Create a new bucket, setting the storage region and ACL settings.

";s:4:"code";s:249:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket-us-east-acl' . strtolower($s3->key); $response = $s3->create_bucket($bucket, AmazonS3::REGION_US_STANDARD, AmazonS3::ACL_PUBLIC); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:2;a:3:{s:5:"title";s:88:"

Create a new bucket, setting the storage region and using Grants for permissions.

";s:4:"code";s:910:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->create_bucket($bucket, AmazonS3::REGION_US_STANDARD, array( array( 'id' => AmazonS3::USERS_AUTH, 'permission' => AmazonS3::GRANT_READ ), array( 'id' => AmazonS3::USERS_AUTH, 'permission' => AmazonS3::GRANT_WRITE ), array( 'id' => AmazonS3::USERS_ALL, 'permission' => AmazonS3::GRANT_WRITE ), array( 'id' => 'my-email-address@domain.com', 'permission' => AmazonS3::GRANT_FULL_CONTROL), array( 'id' => '41f37e4803dbae41aa52290608a037dcf2309199b81c6257fe5570098b9e55a9', 'permission' => AmazonS3::GRANT_WRITE ), )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}}s:7:"related";a:1:{s:6:"method";a:13:{i:0;s:160:"delete_all_object_versions()";i:1;s:136:"delete_all_objects()";i:2;s:121:"delete_bucket()";i:3;s:124:"get_bucket_acl()";i:4;s:139:"get_bucket_filesize()";i:5;s:136:"get_bucket_headers()";i:6;s:127:"get_bucket_list()";i:7;s:151:"get_bucket_object_count()";i:8;s:133:"get_bucket_region()";i:9;s:130:"if_bucket_exists()";i:10;s:151:"if_bucket_policy_exists()";i:11;s:118:"list_buckets()";i:12;s:124:"set_bucket_acl()";}}s:7:"seealso";a:1:{s:4:"link";s:115:"Working with Amazon S3 Buckets";}}i:15;a:9:{s:4:"name";s:26:"create_bucket_notification";s:8:"modifier";s:6:"public";s:11:"description";s:1381:"

Enables notifications of specified events for an Amazon S3 bucket. Currently, the s3:ReducedRedundancyLostObject event is the only event supported for notifications. The s3:ReducedRedundancyLostObject event is triggered when Amazon S3 detects that it has lost all copies of an Amazon S3 object and can no longer service requests for that object.

If the bucket owner and Amazon SNS topic owner are the same, the bucket owner has permission to publish notifications to the topic by default. Otherwise, the owner of the topic must create a policy to enable the bucket owner to publish to the topic.

By default, only the bucket owner can configure notifications on a bucket. However, bucket owners can use bucket policies to grant permission to other users to set this configuration with the s3:PutBucketNotification permission.

After a PUT operation is called to configure notifications on a bucket, Amazon S3 publishes a test notification to ensure that the topic exists and that the bucket owner has permission to publish to the specified topic. If the notification is successfully published to the SNS topic, the PUT operation updates the bucket configuration and returns the 200 OK responses with a x-amz-sns-test-message-id header containing the message ID of the test notification sent to topic.

";s:10:"parameters";a:1:{s:9:"parameter";a:4:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:65:"

The name of the bucket to create bucket notifications for.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:9:"topic_arn";s:4:"type";s:6:"string";s:11:"description";s:50:"

The SNS topic ARN to send notifications to.

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:5:"event";s:4:"type";s:6:"string";s:11:"description";s:36:"

The event type to listen for.

";}i:3;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:617:"public function create_bucket_notification($bucket, $topic_arn, $event, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'PUT'; $opt['sub_resource'] = 'notification'; $opt['headers'] = array( 'Content-Type' => 'application/xml' ); $xml = simplexml_load_string($this->base_notification_xml); $topic_config = $xml->addChild('TopicConfiguration'); $topic_config->addChild('Topic', $topic_arn); $topic_config->addChild('Event', $event); $opt['body'] = $xml->asXML(); // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:34:"

Create bucket notification.

";s:4:"code";s:368:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Create an SNS topic $sns = new AmazonSNS(); $topic = $sns->create_topic('my-topic')->body->TopicArn()->first(); $response = $s3->create_bucket_notification($bucket, $topic, 's3:ReducedRedundancyLostObject'); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:2:{i:0;s:160:"delete_bucket_notification()";i:1;s:154:"get_bucket_notifications()";}}s:7:"seealso";a:1:{s:4:"link";s:131:"Setting Up Notification of Bucket Events";}}i:16;a:7:{s:4:"name";s:18:"create_bucket_tags";s:8:"modifier";s:6:"public";s:11:"description";s:340:"

Apply a set of tags to the specified bucket. Bucket Tags simplify the task of associating Amazon S3 costs with specific buckets.

This operation requires permission to perform s3:PutBucketTagging actions. By default, the bucket owner is permitted to perform these actions, and can grant permission to other users.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:754:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:633:"public function create_bucket_tags($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'PUT'; $opt['sub_resource'] = 'tagging'; $xml = simplexml_load_string($this->bucket_tagging_xml); if (isset($opt['tags']) && is_array($opt['tags'])) { foreach ($opt['tags'] as $key => $value) { $xtag = $xml->TagSet->addChild('Tag'); $xtag->addChild('Key', $key); $xtag->addChild('Value', $value); } } $opt['body'] = $xml->asXML(); // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:2:{s:5:"title";s:42:"

Create, get and delete bucket tags.

";s:4:"code";s:1342:"$s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); #--------------------------------------------------------------------# # Create a new bucket $response = $s3->create_bucket($bucket, AmazonS3::REGION_US_STANDARD); if ($response->isOK()) { // Give the bucket a moment to create while (!$s3->if_bucket_exists($bucket)) { sleep(1); } } #--------------------------------------------------------------------# # Create new bucket tags $response = $s3->create_bucket_tags($bucket, array( 'tags' => array( 'project' => 'foo', 'user' => 'bar', ) )); if ($response->isOK()) { // Give the configuration a moment to settle in while (!$s3->get_bucket_tags($bucket)->isOK()) { sleep(1); } } #--------------------------------------------------------------------# # Retrieve the bucket tags $response = $s3->get_bucket_tags($bucket); print_r($response->body); echo PHP_EOL; #--------------------------------------------------------------------# # Delete the bucket tags $response = $s3->delete_bucket_tags($bucket); if ($response->isOK()) { // Delete the bucket $response = $s3->delete_bucket($bucket, true); if ($response->isOK()) { echo 'Bucket was deleted!' . PHP_EOL; } else { echo 'Bucket deletion failed. #sadtromboneissad' . PHP_EOL; } }";}}}i:17;a:7:{s:4:"name";s:18:"create_cors_config";s:8:"modifier";s:6:"public";s:11:"description";s:39:"

Create a new CORS configuration.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:1722:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:2600:"public function create_cors_config($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'PUT'; $opt['sub_resource'] = 'cors'; $opt['headers'] = array( 'Content-Type' => 'application/xml' ); $xml = simplexml_load_string($this->cors_config_xml, $this->parser_class); if (isset($opt['cors_rule']) && is_array($opt['cors_rule'])) { foreach ($opt['cors_rule'] as $rule_set) { // New rule node $xrule = $xml->addChild('CORSRule'); // ID node if (isset($rule_set['id'])) { $xrule->addChild('ID', $rule_set['id']); } // ExposeHeader node if (isset($rule_set['expose_header'])) { $xrule->addChild('ExposeHeader', $rule_set['expose_header']); } // MaxAgeSeconds node if (isset($rule_set['max_age'])) { $xrule->addChild('MaxAgeSeconds', $rule_set['max_age']); } // AllowedHeader node if (isset($rule_set['allowed_header'])) { if (!is_array($rule_set['allowed_header'])) { $rule_set['allowed_header'] = array($rule_set['allowed_header']); } foreach ($rule_set['allowed_header'] as $method) { $xrule->addChild('AllowedHeader', $method); } } // AllowedMethod node if (isset($rule_set['allowed_method'])) { if (!is_array($rule_set['allowed_method'])) { $rule_set['allowed_method'] = array($rule_set['allowed_method']); } foreach ($rule_set['allowed_method'] as $method) { $xrule->addChild('AllowedMethod', $method); } } // AllowedOrigin node if (isset($rule_set['allowed_origin'])) { if (!is_array($rule_set['allowed_origin'])) { $rule_set['allowed_origin'] = array($rule_set['allowed_origin']); } foreach ($rule_set['allowed_origin'] as $method) { $xrule->addChild('AllowedOrigin', $method); } } } } $opt['body'] = $xml->asXML(); // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{i:0;a:0:{}}}i:18;a:6:{s:4:"name";s:23:"create_lifecycle_config";s:8:"modifier";s:6:"public";s:11:"description";s:299:"

Enables the ability to specify a configuration that relates to the object’s lifecycle.

**NOTE:*In cases where the lifecycle configuration dictates that an object should be deleted, Amazon S3 guarantees that the object will be deleted when the expiration time is passed.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:2966:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:3531:"public function create_lifecycle_config($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'PUT'; $opt['sub_resource'] = 'lifecycle'; $opt['headers'] = array( 'Content-Type' => 'application/xml' ); $xml = simplexml_load_string($this->object_expiration_xml, $this->parser_class); if (isset($opt['rules']) && is_array($opt['rules']) && count($opt['rules'])) { foreach ($opt['rules'] as $rule) { $xrule = $xml->addChild('Rule'); // ID if (isset($rule['id'])) { if (strlen($rule['id']) > 255) { throw new S3_Exception('The "id" for a rule must not be more than 255 characters in the ' . __FUNCTION__ . ' method.'); } $xrule->addChild('ID', $rule['id']); } // Prefix if (isset($rule['prefix'])) { $xrule->addChild('Prefix', $rule['prefix']); } else { throw new S3_Exception('Each rule requires a "prefix" in the ' . __FUNCTION__ . ' method.'); } // Status $enabled = 'Enabled'; if (isset($rule['enabled'])) { if (is_bool($rule['enabled'])) // Boolean { $enabled = $rule['enabled'] ? 'Enabled' : 'Disabled'; } elseif (is_string($rule['enabled'])) // String { $enabled = (strtolower($rule['enabled']) === 'true') ? 'Enabled' : 'Disabled'; } $xrule->addChild('Status', $enabled); } else { $xrule->addChild('Status', 'Enabled'); } // Expiration if (isset($rule['expiration'])) { $xexpiration = $xrule->addChild('Expiration'); if (isset($rule['expiration']['date'])) { $xexpiration->addChild('Date', $rule['expiration']['date']); } elseif (isset($rule['expiration']['days'])) { $xexpiration->addChild('Days', $rule['expiration']['days']); } } // Transition if (isset($rule['transition'])) { $xtransition = $xrule->addChild('Transition'); if (isset($rule['transition']['date'])) { $xtransition->addChild('Date', $rule['transition']['date']); } elseif (isset($rule['transition']['days'])) { $xtransition->addChild('Days', $rule['transition']['days']); } if (isset($rule['transition']['storage'])) { $xtransition->addChild('StorageClass', $rule['transition']['storage']); } } if (!isset($rule['expiration']) && !isset($rule['transition'])) { throw new S3_Exception('Each rule requires a either a "transition" or "expiration" entry in the ' . __FUNCTION__ . ' method.'); } } } $opt['body'] = $xml->asXML(); // Authenticate to S3 return $this->authenticate($bucket, $opt); }";}i:19;a:9:{s:4:"name";s:17:"create_mpu_object";s:8:"modifier";s:6:"public";s:11:"description";s:1259:"

Creates an Amazon S3 object using the multipart upload APIs. It is analogous to create_object().

While each individual part of a multipart upload can hold up to 5 GB of data, this method limits the part size to a maximum of 500 MB. The combined size of all parts can not exceed 5 TB of data. When an object is stored in Amazon S3, the data is streamed to multiple storage servers in multiple data centers. This ensures the data remains available in the event of internal network or hardware failure.

Amazon S3 charges for storage as well as requests to the service. Smaller part sizes (and more requests) allow for faster failures and better upload reliability. Larger part sizes (and fewer requests) costs slightly less but has lower upload reliability.

In certain cases with large objects, it’s possible for this method to attempt to open more file system connections than allowed by the OS. In this case, either increase the number of connections allowed or increase the value of the partSize parameter to use a larger part size.

";s:10:"parameters";a:1:{s:9:"parameter";a:3:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

The file name for the object.

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:3237:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:4713:"public function create_mpu_object($bucket, $filename, $opt = null) { if ($this->use_batch_flow) { throw new S3_Exception(__FUNCTION__ . '() cannot be batch requested'); } if (!$opt) $opt = array(); // Handle content length. Can also be passed as an HTTP header. if (isset($opt['length'])) { $opt['headers']['Content-Length'] = $opt['length']; unset($opt['length']); } // URI to redirect to. Can also be passed as an HTTP header. if (isset($opt['redirectTo'])) { $opt['headers']['x-amz-website-redirect-location'] = $opt['redirectTo']; unset($opt['redirectTo']); } if (!isset($opt['fileUpload'])) { throw new S3_Exception('The `fileUpload` option is required in ' . __FUNCTION__ . '().'); } elseif (is_resource($opt['fileUpload'])) { $opt['limit'] = 1; // We can only read from this one resource. $upload_position = isset($opt['seekTo']) ? (integer) $opt['seekTo'] : ftell($opt['fileUpload']); $upload_filesize = isset($opt['headers']['Content-Length']) ? (integer) $opt['headers']['Content-Length'] : null; if (!isset($upload_filesize) && $upload_position !== false) { $stats = fstat($opt['fileUpload']); if ($stats && $stats['size'] >= 0) { $upload_filesize = $stats['size'] - $upload_position; } } } else { $upload_position = isset($opt['seekTo']) ? (integer) $opt['seekTo'] : 0; if (isset($opt['headers']['Content-Length'])) { $upload_filesize = (integer) $opt['headers']['Content-Length']; } else { $upload_filesize = filesize($opt['fileUpload']); if ($upload_filesize !== false) { $upload_filesize -= $upload_position; } } } if ($upload_position === false || !isset($upload_filesize) || $upload_filesize === false || $upload_filesize < 0) { throw new S3_Exception('The size of `fileUpload` cannot be determined in ' . __FUNCTION__ . '().'); } // Handle part size if (isset($opt['partSize'])) { // If less that 5 MB... if ((integer) $opt['partSize'] < 5242880) { $opt['partSize'] = 5242880; // 5 MB } // If more than 500 MB... elseif ((integer) $opt['partSize'] > 524288000) { $opt['partSize'] = 524288000; // 500 MB } } else { $opt['partSize'] = 52428800; // 50 MB } // If the upload size is smaller than the piece size, failover to create_object(). if ($upload_filesize < $opt['partSize'] && !isset($opt['uploadId'])) { return $this->create_object($bucket, $filename, $opt); } // Initiate multipart upload if (isset($opt['uploadId'])) { $upload_id = $opt['uploadId']; } else { // Compose options for initiate_multipart_upload(). $_opt = array(); foreach (array('contentType', 'acl', 'storage', 'headers', 'meta') as $param) { if (isset($opt[$param])) { $_opt[$param] = $opt[$param]; } } $upload = $this->initiate_multipart_upload($bucket, $filename, $_opt); if (!$upload->isOK()) { return $upload; } // Fetch the UploadId $upload_id = (string) $upload->body->UploadId; } // Get the list of pieces $pieces = $this->get_multipart_counts($upload_filesize, (integer) $opt['partSize']); // Queue batch requests $batch = new CFBatchRequest(isset($opt['limit']) ? (integer) $opt['limit'] : null); foreach ($pieces as $i => $piece) { $this->batch($batch)->upload_part($bucket, $filename, $upload_id, array( 'expect' => '100-continue', 'fileUpload' => $opt['fileUpload'], 'partNumber' => ($i + 1), 'seekTo' => $upload_position + (integer) $piece['seekTo'], 'length' => (integer) $piece['length'], )); } // Send batch requests $batch_responses = $this->batch($batch)->send(); if (!$batch_responses->areOK()) { return $batch_responses; } // Compose completion XML $parts = array(); foreach ($batch_responses as $i => $response) { $parts[] = array('PartNumber' => ($i + 1), 'ETag' => $response->header['etag']); } return $this->complete_multipart_upload($bucket, $filename, $upload_id, $parts); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:59:"

Create a new object using the multipart upload APIs.

";s:4:"code";s:660:"// Define a mebibyte define('MB', 1024 * 1024); // Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Create a new multipart object. Set several optional parameters as well. $response = $s3->create_mpu_object($bucket, 'tv_episode.webm', array( 'fileUpload' => 'tv_episode.webm', 'partSize' => 40*MB, 'contentType' => 'video/webm', 'acl' => AmazonS3::ACL_PRIVATE, 'storage' => AmazonS3::STORAGE_STANDARD, 'meta' => array( 'resolution' => '720p', 'rating' => 'US TV-14', 'runtime' => '42:42' ) )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:10:{i:0;s:137:"CFMimeTypes::get_mimetype()";i:1;s:148:"abort_multipart_upload()";i:2;s:175:"abort_multipart_uploads_by_date()";i:3;s:157:"complete_multipart_upload()";i:4;s:121:"create_object()";i:5;s:142:"get_multipart_counts()";i:6;s:157:"initiate_multipart_upload()";i:7;s:148:"list_multipart_uploads()";i:8;s:112:"list_parts()";i:9;s:115:"upload_part()";}}s:7:"seealso";a:1:{s:4:"link";s:116:"REST Access Control Policy";}}i:20;a:10:{s:4:"name";s:13:"create_object";s:8:"modifier";s:6:"public";s:11:"description";s:368:"

Creates an Amazon S3 object. After an Amazon S3 bucket is created, objects can be stored in it.

Each standard object can hold up to 5 GB of data. When an object is stored in Amazon S3, the data is streamed to multiple storage servers in multiple data centers. This ensures the data remains available in the event of internal network or hardware failure.

";s:10:"parameters";a:1:{s:9:"parameter";a:3:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

The file name for the object.

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:3449:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:2186:"public function create_object($bucket, $filename, $opt = null) { if (!$opt) $opt = array(); // Add this to our request $opt['verb'] = 'PUT'; $opt['resource'] = $filename; // Handle content length. Can also be passed as an HTTP header. if (isset($opt['length'])) { $opt['headers']['Content-Length'] = $opt['length']; unset($opt['length']); } // Handle content type. Can also be passed as an HTTP header. if (isset($opt['contentType'])) { $opt['headers']['Content-Type'] = $opt['contentType']; unset($opt['contentType']); } // Handle Access Control Lists. Can also be passed as an HTTP header. if (isset($opt['acl'])) { if (is_array($opt['acl'])) { $opt['headers'] = array_merge($opt['headers'], $this->generate_access_policy_headers($opt['acl'])); } else { $opt['headers']['x-amz-acl'] = $opt['acl']; } } // Handle storage settings. Can also be passed as an HTTP header. if (isset($opt['storage'])) { $opt['headers']['x-amz-storage-class'] = $opt['storage']; unset($opt['storage']); } // Handle encryption settings. Can also be passed as an HTTP header. if (isset($opt['encryption'])) { $opt['headers']['x-amz-server-side-encryption'] = $opt['encryption']; unset($opt['encryption']); } // URI to redirect to. Can also be passed as an HTTP header. if (isset($opt['redirectTo'])) { $opt['headers']['x-amz-website-redirect-location'] = $opt['redirectTo']; unset($opt['redirectTo']); } // Handle meta tags. Can also be passed as an HTTP header. if (isset($opt['meta'])) { foreach ($opt['meta'] as $meta_key => $meta_value) { // e.g., `My Meta Header` is converted to `x-amz-meta-my-meta-header`. $opt['headers']['x-amz-meta-' . strtolower(str_replace(' ', '-', $meta_key))] = $meta_value; } unset($opt['meta']); } $opt['headers']['Expect'] = '100-continue'; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:4:{i:0;a:3:{s:5:"title";s:56:"

Upload a string of content as a new object to S3.

";s:4:"code";s:246:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->create_object($bucket, 'test1.txt', array( 'body' => 'This is my body text.' )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:1;a:3:{s:5:"title";s:83:"

Create an object with spaces, slashes, and UTF-8 characters in the filename.

";s:4:"code";s:382:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->create_object($bucket, 'prefix with spaces/åéîøü/åéîøü/åéîøü with spaces.txt', array( 'body' => 'This is my body text.' )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:2;a:3:{s:5:"title";s:75:"

Upload a file instead of a string, and tweak some optional settings.

";s:4:"code";s:1537:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->create_object($bucket, 'üpløåd/î\'vé nøw béén üpløådéd.txt', array( 'fileUpload' => 'upload_me.txt', // 'acl' => AmazonS3::ACL_PUBLIC, 'contentType' => 'text/plain', 'storage' => AmazonS3::STORAGE_REDUCED, 'headers' => array( 'Cache-Control' => 'max-age', 'Content-Encoding' => 'gzip', 'Content-Language' => 'en-US', 'Expires' => 'Thu, 01 Dec 1994 16:00:00 GMT', ), 'grants' => array( array( 'id' => AmazonS3::USERS_AUTH, 'permission' => AmazonS3::GRANT_READ ), array( 'id' => AmazonS3::USERS_AUTH, 'permission' => AmazonS3::GRANT_WRITE ), array( 'id' => AmazonS3::USERS_ALL, 'permission' => AmazonS3::GRANT_WRITE ), array( 'id' => 'my-email-address@domain.com', 'permission' => AmazonS3::GRANT_FULL_CONTROL), array( 'id' => '41f37e4803dbae41aa52290608a037dcf2309199b81c6257fe5570098b9e55a9', 'permission' => AmazonS3::GRANT_WRITE ), ), 'meta' => array( 'word' => 'to your mother', // x-amz-meta-word 'ice-ice-baby' => 'too cold, too cold' // x-amz-meta-ice-ice-baby ), )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:3;a:3:{s:5:"title";s:85:"

Upload from an open file resource, leveraging seek position and upload length.

";s:4:"code";s:472:"// Define a mebibyte define('MB', 1048576); // Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Open a file resource $file_resource = fopen('large_video.mov', 'r'); // Upload a partial file $response = $s3->create_object($bucket, 'large_video.mov', array( 'fileUpload' => $file_resource, 'seekTo' => 80*MB, 'length' => 5*MB, 'acl' => AmazonS3::ACL_PUBLIC )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}}s:7:"related";a:1:{s:6:"method";a:13:{i:0;s:137:"CFMimeTypes::get_mimetype()";i:1;s:115:"copy_object()";i:2;s:133:"create_mpu_object()";i:3;s:121:"delete_object()";i:4;s:112:"get_object()";i:5;s:124:"get_object_acl()";i:6;s:139:"get_object_filesize()";i:7;s:136:"get_object_headers()";i:8;s:127:"get_object_list()";i:9;s:130:"if_object_exists()";i:10;s:118:"list_objects()";i:11;s:124:"set_object_acl()";i:12;s:121:"update_object()";}}s:7:"seealso";a:1:{s:4:"link";s:116:"REST Access Control Policy";}s:9:"changelog";a:1:{s:6:"change";a:2:{i:0;s:54:"

Added preliminary support for file I/O streams.

";i:1;s:55:"

Added more robust handling for file I/O streams.

";}}}i:21;a:8:{s:4:"name";s:31:"create_object_expiration_config";s:8:"modifier";s:6:"public";s:11:"description";s:18:"

@deprecated

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:2:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";}i:1;a:2:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";}}}s:11:"returnvalue";a:0:{}s:6:"source";s:134:"public function create_object_expiration_config($bucket, $opt = null) { return $this->create_lifecycle_config($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:2:{s:5:"title";s:65:"

Create, get and delete an object expiration configuration.

";s:4:"code";s:2097:"$s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); #--------------------------------------------------------------------# # Create a new bucket $response = $s3->create_bucket($bucket, AmazonS3::REGION_US_STANDARD); if ($response->isOK()) { // Give the bucket a moment to create while (!$s3->if_bucket_exists($bucket)) { sleep(1); } } #--------------------------------------------------------------------# # Create some files in the bucket for ($i = 0; $i < 10; $i++) { $even = ($i % 2) ? 'odd' : 'even'; $s3->batch()->create_object($bucket, ($even . '/åéîøü' . $i), array( 'body' => 'sample text', 'contentType' => 'text/plain; charset=utf-8' )); } $responses = $s3->batch()->send(); if ($responses->areOK()) { print_r($s3->get_object_list($bucket)); echo PHP_EOL; } #--------------------------------------------------------------------# # Create an object expiration configuration $response = $s3->create_object_expiration_config($bucket, array( 'rules' => array( array( 'id' => 'unique-rule-identifier', 'prefix' => 'even/', 'expiration' => array( 'days' => 3 ) ), array( 'prefix' => 'odd/', 'expiration' => array( 'days' => 1 ) ) ) )); if ($response->isOK()) { // Give the configuration a moment to settle in while (!$s3->get_object_expiration_config($bucket)->isOK()) { sleep(1); } } #--------------------------------------------------------------------# # Lookup the configuration $response = $s3->get_object_expiration_config($bucket); print_r($response->body); echo PHP_EOL; #--------------------------------------------------------------------# # Delete the configuration $response = $s3->delete_object_expiration_config($bucket); if ($response->isOK()) { // Delete the bucket $response = $s3->delete_bucket($bucket, true); if ($response->isOK()) { echo 'Bucket was deleted!' . PHP_EOL; } else { echo 'Bucket deletion failed. #sadtromboneissad' . PHP_EOL; } }";}}s:7:"related";a:0:{}}i:22;a:8:{s:4:"name";s:21:"create_website_config";s:8:"modifier";s:6:"public";s:11:"description";s:898:"

Enables and configures an Amazon S3 website using the corresponding bucket as the content source. The website will have one default domain name associated with it, which is the bucket name. If you attempt to configure an Amazon S3 website for a bucket whose name is not compatible with DNS, Amazon S3 returns an InvalidBucketName error. For more information on bucket names and DNS, refer to Bucket Restrictions and Limitations.

To visit the bucket as a website a new endpoint is created in the following pattern: http://<bucketName>.s3-website-<region>.amazonaws.com. This is a sample URL for a bucket called example-bucket in the us-east-1 region. (e.g., http://example-bucket.s3-website-us-east-1.amazonaws.com)

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:838:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:569:"public function create_website_config($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'PUT'; $opt['sub_resource'] = 'website'; $xml = simplexml_load_string($this->website_config_xml); if (isset($opt['indexDocument'])) { $xml->IndexDocument->Suffix = $opt['indexDocument']; } if (isset($opt['errorDocument'])) { $xml->ErrorDocument->Key = $opt['errorDocument']; } $opt['body'] = $xml->asXML(); // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:2:{i:0;a:3:{s:5:"title";s:42:"

Create a new website configuration.

";s:4:"code";s:290:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Create a website, using index.html as the root document and error.html as the error document. $response = $s3->create_website_config($bucket); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:1;a:3:{s:5:"title";s:42:"

Create a new website configuration.

";s:4:"code";s:367:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Create a website, using home.html as the root document and 404.html as the error document. $response = $s3->create_website_config($bucket, array( 'indexDocument' => 'home.html', 'errorDocument' => '404.html' )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}}s:7:"related";a:1:{s:6:"method";a:2:{i:0;s:145:"delete_website_config()";i:1;s:136:"get_website_config()";}}}i:23;a:9:{s:4:"name";s:26:"delete_all_object_versions";s:8:"modifier";s:6:"public";s:11:"description";s:88:"

Deletes all of the versions of all Amazon S3 objects inside the specified bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:4:"pcre";s:4:"type";s:6:"string";s:11:"description";s:216:"

A Perl-Compatible Regular Expression (PCRE) to filter the names against. The default value is PCRE_ALL.

";}}}s:11:"returnvalue";s:180:"

A value of true means that all object versions were successfully deleted. A value of false means that at least one object/version failed to delete.

";s:6:"source";s:3071:"public function delete_all_object_versions($bucket, $pcre = null) { // Instantiate $versions = $this->list_bucket_object_versions($bucket); // Gather all nodes together into a single array if ($versions->body->DeleteMarker() && $versions->body->Version()) { $markers = array_merge($versions->body->DeleteMarker()->getArrayCopy(), $versions->body->Version()->getArrayCopy()); } elseif ($versions->body->DeleteMarker()) { $markers = $versions->body->DeleteMarker()->getArrayCopy(); } elseif ($versions->body->Version()) { $markers = $versions->body->Version()->getArrayCopy(); } else { $markers = array(); } while ((string) $versions->body->IsTruncated === 'true') { $versions = $this->list_bucket_object_versions($bucket, array( 'key-marker' => (string) $versions->body->NextKeyMarker )); // Gather all nodes together into a single array if ($versions->body->DeleteMarker() && $versions->body->Version()) { $markers = array_merge($markers, $versions->body->DeleteMarker()->getArrayCopy(), $versions->body->Version()->getArrayCopy()); } elseif ($versions->body->DeleteMarker()) { $markers = array_merge($markers, $versions->body->DeleteMarker()->getArrayCopy()); } elseif ($versions->body->Version()) { $markers = array_merge($markers, $versions->body->Version()->getArrayCopy()); } } $objects = array(); // Loop through markers foreach ($markers as $marker) { if ($pcre) { if (preg_match($pcre, (string) $marker->Key)) { $xx = array('key' => (string) $marker->Key); if ((string) $marker->VersionId !== 'null') { $xx['version_id'] = (string) $marker->VersionId; } $objects[] = $xx; unset($xx); } } else { $xx = array('key' => (string) $marker->Key); if ((string) $marker->VersionId !== 'null') { $xx['version_id'] = (string) $marker->VersionId; } $objects[] = $xx; unset($xx); } } $batch = new CFBatchRequest(); $batch->use_credentials($this->credentials); foreach (array_chunk($objects, 1000) as $object_set) { $this->batch($batch)->delete_objects($bucket, array( 'objects' => $object_set )); } $responses = $this->batch($batch)->send(); $is_ok = true; foreach ($responses as $response) { if (!$response->isOK() || isset($response->body->Error)) { $is_ok = false; } } return $is_ok; }";s:8:"examples";a:1:{s:7:"example";a:2:{i:0;a:3:{s:5:"title";s:58:"

Delete ALL versions of ALL objects within a bucket.

";s:4:"code";s:197:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->delete_all_object_versions($bucket); // Success? var_dump($response !== false);";s:6:"result";s:10:"bool(true)";}i:1;a:3:{s:5:"title";s:93:"

Delete ALL versions of objects within a bucket that match the PCRE regular expression.

";s:4:"code";s:211:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->delete_all_object_versions($bucket, '/abc.txt/i'); // Success? var_dump($response !== false);";s:6:"result";s:10:"bool(true)";}}}s:7:"related";a:1:{s:6:"method";a:17:{i:0;s:121:"create_bucket()";i:1;s:136:"delete_all_objects()";i:2;s:121:"delete_bucket()";i:3;s:136:"disable_versioning()";i:4;s:133:"enable_versioning()";i:5;s:124:"get_bucket_acl()";i:6;s:139:"get_bucket_filesize()";i:7;s:136:"get_bucket_headers()";i:8;s:127:"get_bucket_list()";i:9;s:151:"get_bucket_object_count()";i:10;s:133:"get_bucket_region()";i:11;s:145:"get_versioning_status()";i:12;s:130:"if_bucket_exists()";i:13;s:151:"if_bucket_policy_exists()";i:14;s:163:"list_bucket_object_versions()";i:15;s:118:"list_buckets()";i:16;s:124:"set_bucket_acl()";}}s:7:"seealso";a:1:{s:4:"link";s:71:"Regular Expressions (Perl-Compatible)";}}i:24;a:9:{s:4:"name";s:18:"delete_all_objects";s:8:"modifier";s:6:"public";s:11:"description";s:65:"

Deletes all Amazon S3 objects inside the specified bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:4:"pcre";s:4:"type";s:6:"string";s:11:"description";s:216:"

A Perl-Compatible Regular Expression (PCRE) to filter the names against. The default value is PCRE_ALL.

";}}}s:11:"returnvalue";s:164:"

A value of true means that all objects were successfully deleted. A value of false means that at least one object failed to delete.

";s:6:"source";s:1080:"public function delete_all_objects($bucket, $pcre = self::PCRE_ALL) { // Collect all matches $list = $this->get_object_list($bucket, array('pcre' => $pcre)); // As long as we have at least one match... if (count($list) > 0) { $objects = array(); foreach ($list as $object) { $objects[] = array('key' => $object); } $batch = new CFBatchRequest(); $batch->use_credentials($this->credentials); foreach (array_chunk($objects, 1000) as $object_set) { $this->batch($batch)->delete_objects($bucket, array( 'objects' => $object_set )); } $responses = $this->batch($batch)->send(); $is_ok = true; foreach ($responses as $response) { if (!$response->isOK() || isset($response->body->Error)) { $is_ok = false; } } return $is_ok; } // If there are no matches, return true return true; }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:42:"

Delete ALL objects within a bucket.

";s:4:"code";s:179:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->delete_all_objects($bucket); // Success? var_dump($response);";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:13:{i:0;s:121:"create_bucket()";i:1;s:160:"delete_all_object_versions()";i:2;s:121:"delete_bucket()";i:3;s:124:"get_bucket_acl()";i:4;s:139:"get_bucket_filesize()";i:5;s:136:"get_bucket_headers()";i:6;s:127:"get_bucket_list()";i:7;s:151:"get_bucket_object_count()";i:8;s:133:"get_bucket_region()";i:9;s:130:"if_bucket_exists()";i:10;s:151:"if_bucket_policy_exists()";i:11;s:118:"list_buckets()";i:12;s:124:"set_bucket_acl()";}}s:7:"seealso";a:1:{s:4:"link";s:71:"Regular Expressions (Perl-Compatible)";}}i:25;a:8:{s:4:"name";s:13:"delete_bucket";s:8:"modifier";s:6:"public";s:11:"description";s:114:"

Deletes a bucket from an Amazon S3 account. A bucket must be empty before the bucket itself can be deleted.

";s:10:"parameters";a:1:{s:9:"parameter";a:3:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:5:"force";s:4:"type";s:7:"boolean";s:11:"description";s:107:"

Whether to force-delete the bucket and all of its contents. The default value is false.

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:203:"

A CFResponse object if the bucket was deleted successfully. Returns boolean false if otherwise.

";s:6:"source";s:539:"public function delete_bucket($bucket, $force = false, $opt = null) { // Set default value $success = true; if ($force) { // Delete all of the items from the bucket. $success = $this->delete_all_object_versions($bucket); } // As long as we were successful... if ($success) { if (!$opt) $opt = array(); $opt['verb'] = 'DELETE'; return $this->authenticate($bucket, $opt); } // @codeCoverageIgnoreStart return false; // @codeCoverageIgnoreEnd }";s:8:"examples";a:1:{i:0;a:0:{}}s:7:"related";a:1:{s:6:"method";a:13:{i:0;s:121:"create_bucket()";i:1;s:160:"delete_all_object_versions()";i:2;s:136:"delete_all_objects()";i:3;s:124:"get_bucket_acl()";i:4;s:139:"get_bucket_filesize()";i:5;s:136:"get_bucket_headers()";i:6;s:127:"get_bucket_list()";i:7;s:151:"get_bucket_object_count()";i:8;s:133:"get_bucket_region()";i:9;s:130:"if_bucket_exists()";i:10;s:151:"if_bucket_policy_exists()";i:11;s:118:"list_buckets()";i:12;s:124:"set_bucket_acl()";}}}i:26;a:9:{s:4:"name";s:26:"delete_bucket_notification";s:8:"modifier";s:6:"public";s:11:"description";s:63:"

Empties the list of SNS topics to send notifications to.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:297:"public function delete_bucket_notification($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'PUT'; $opt['sub_resource'] = 'notification'; $opt['body'] = $this->base_notification_xml; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:35:"

Delete bucket notifications.

";s:4:"code";s:198:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->delete_bucket_notification($bucket); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:2:{i:0;s:160:"create_bucket_notification()";i:1;s:154:"get_bucket_notifications()";}}s:7:"seealso";a:1:{s:4:"link";s:131:"Setting Up Notification of Bucket Events";}}i:27;a:8:{s:4:"name";s:20:"delete_bucket_policy";s:8:"modifier";s:6:"public";s:11:"description";s:199:"

Deletes the bucket policy for the specified Amazon S3 bucket. To delete the policy, the caller must be the bucket owner and have DeletePolicy permissions for the specified bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:493:"

A CFResponse object containing a parsed HTTP response. If you do not have DeletePolicy permissions, Amazon S3 returns a 403 Access Denied error. If you have the correct permissions, but are not the bucket owner, Amazon S3 returns a 405 Method Not Allowed error. If the bucket doesn’t have a policy, Amazon S3 returns a 204 No Content error.

";s:6:"source";s:236:"public function delete_bucket_policy($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'DELETE'; $opt['sub_resource'] = 'policy'; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:30:"

Delete a bucket policy.

";s:4:"code";s:220:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Delete the bucket policy $response = $s3->delete_bucket_policy($bucket); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:3:{i:0;s:133:"get_bucket_policy()";i:1;s:151:"if_bucket_policy_exists()";i:2;s:133:"set_bucket_policy()";}}}i:28;a:7:{s:4:"name";s:18:"delete_bucket_tags";s:8:"modifier";s:6:"public";s:11:"description";s:60:"

Delete all associated tags from the specified bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:235:"public function delete_bucket_tags($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'DELETE'; $opt['sub_resource'] = 'tagging'; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:2:{s:5:"title";s:42:"

Create, get and delete bucket tags.

";s:4:"code";s:1342:"$s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); #--------------------------------------------------------------------# # Create a new bucket $response = $s3->create_bucket($bucket, AmazonS3::REGION_US_STANDARD); if ($response->isOK()) { // Give the bucket a moment to create while (!$s3->if_bucket_exists($bucket)) { sleep(1); } } #--------------------------------------------------------------------# # Create new bucket tags $response = $s3->create_bucket_tags($bucket, array( 'tags' => array( 'project' => 'foo', 'user' => 'bar', ) )); if ($response->isOK()) { // Give the configuration a moment to settle in while (!$s3->get_bucket_tags($bucket)->isOK()) { sleep(1); } } #--------------------------------------------------------------------# # Retrieve the bucket tags $response = $s3->get_bucket_tags($bucket); print_r($response->body); echo PHP_EOL; #--------------------------------------------------------------------# # Delete the bucket tags $response = $s3->delete_bucket_tags($bucket); if ($response->isOK()) { // Delete the bucket $response = $s3->delete_bucket($bucket, true); if ($response->isOK()) { echo 'Bucket was deleted!' . PHP_EOL; } else { echo 'Bucket deletion failed. #sadtromboneissad' . PHP_EOL; } }";}}}i:29;a:7:{s:4:"name";s:12:"delete_cache";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:169:"

Deletes a cached CFResponse object using the specified cache storage type.

";s:11:"returnvalue";s:118:"

A value of true if cached object exists and is successfully deleted, otherwise false.

";s:6:"source";s:125:"public function delete_cache() { $this->use_cache_flow = true; $this->delete_cache = true; return $this; }";s:8:"examples";a:1:{s:7:"example";a:3:{i:0;a:4:{s:5:"title";s:41:"

Delete a cached response from APC.

";s:11:"description";s:87:"

Note: This method is inherited by all service-specific classes.

";s:4:"code";s:169:"// Instantiate $sdb = new AmazonSDB(); $sdb->set_cache_config('apc'); // Delete the data $response = $sdb->delete_cache()->list_domains(); var_dump($response);";s:6:"result";s:11:"bool(false)";}i:1;a:4:{s:5:"title";s:53:"

Delete a cached response from the file system.

";s:11:"description";s:87:"

Note: This method is inherited by all service-specific classes.

";s:4:"code";s:173:"// Instantiate $sdb = new AmazonSDB(); $sdb->set_cache_config('./cache'); // Delete the data $response = $sdb->delete_cache()->list_domains(); var_dump($response);";s:6:"result";s:10:"bool(true)";}i:2;a:4:{s:5:"title";s:46:"

Delete a cached response from Memcache.

";s:11:"description";s:87:"

Note: This method is inherited by all service-specific classes.

";s:4:"code";s:205:"// Instantiate $sdb = new AmazonSDB(); $sdb->set_cache_config(array( array('host' => '127.0.0.1') )); // Delete the data $response = $sdb->delete_cache()->list_domains(); var_dump($response);";s:6:"result";s:10:"bool(true)";}}}}i:30;a:7:{s:4:"name";s:18:"delete_cors_config";s:8:"modifier";s:6:"public";s:11:"description";s:38:"

Deletes the CORS configuration.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:232:"public function delete_cors_config($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'DELETE'; $opt['sub_resource'] = 'cors'; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{i:0;a:0:{}}}i:31;a:6:{s:4:"name";s:23:"delete_lifecycle_config";s:8:"modifier";s:6:"public";s:11:"description";s:87:"

Deletes the configuration that relates to the object’s lifecycle.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:242:"public function delete_lifecycle_config($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'DELETE'; $opt['sub_resource'] = 'lifecycle'; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";}i:32;a:9:{s:4:"name";s:13:"delete_object";s:8:"modifier";s:6:"public";s:11:"description";s:61:"

Deletes an Amazon S3 object from the specified bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:3:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

The file name for the object.

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:1132:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:557:"public function delete_object($bucket, $filename, $opt = null) { // Add this to our request if (!$opt) $opt = array(); $opt['verb'] = 'DELETE'; $opt['resource'] = $filename; // Enable MFA delete? // @codeCoverageIgnoreStart if (isset($opt['MFASerial']) && isset($opt['MFAToken'])) { $opt['headers'] = array( 'x-amz-mfa' => ($opt['MFASerial'] . ' ' . $opt['MFAToken']) ); } // @codeCoverageIgnoreEnd // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{i:0;a:3:{s:5:"title";s:24:"

Delete an object.

";s:4:"code";s:334:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->delete_object($bucket, 'prefix with spaces/åéîøü/åéîøü/åéîøü with spaces.txt'); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:1;a:3:{s:5:"title";s:46:"

Delete a specific version of an object.

";s:4:"code";s:427:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Delete a specific version $response = $s3->delete_object($bucket, 'test1.txt', array( 'versionId' => '0NNAq8PwvXvg8EfAYG9sSmwKTZeixZgZNE6PbodG8td0DJ3gVOmjI2Gh/oFnb0Ie=' )); // Success? var_dump($response->isOK()); var_dump(strpos((string) $response->header['_info']['url'], 'versionId=' . $version_id) !== false);";s:6:"result";s:21:"bool(true) bool(true)";}i:2;a:3:{s:5:"title";s:75:"

Delete a specific version of an object from an MFA-protected bucket.

";s:4:"code";s:478:"// Instantiate the class $s3 = new AmazonS3(); $response = $s3->delete_object('my-bucket', 'test1.txt', array( 'versionId' => '0NNAq8PwvXvg8EfAYG9sSmwKTZeixZgZNE6PbodG8td0DJ3gVOmjI2Gh/oFnb0Ie=', 'MFASerial' => CFCredentials::get()->mfa_serial, // Custom property in the config file. 'MFAToken' => '12345678' )); // Success? var_dump($response->isOK()); var_dump(strpos((string) $response->header['_info']['url'], 'versionId=' . $version_id) !== false);";s:6:"result";s:21:"bool(true) bool(true)";}}}s:7:"related";a:1:{s:6:"method";a:11:{i:0;s:115:"copy_object()";i:1;s:121:"create_object()";i:2;s:112:"get_object()";i:3;s:124:"get_object_acl()";i:4;s:139:"get_object_filesize()";i:5;s:136:"get_object_headers()";i:6;s:127:"get_object_list()";i:7;s:130:"if_object_exists()";i:8;s:118:"list_objects()";i:9;s:124:"set_object_acl()";i:10;s:121:"update_object()";}}s:7:"seealso";a:1:{s:4:"link";s:68:"Multi-Factor Authentication";}}i:33;a:8:{s:4:"name";s:31:"delete_object_expiration_config";s:8:"modifier";s:6:"public";s:11:"description";s:18:"

@deprecated

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:2:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";}i:1;a:2:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";}}}s:11:"returnvalue";a:0:{}s:6:"source";s:134:"public function delete_object_expiration_config($bucket, $opt = null) { return $this->delete_lifecycle_config($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:2:{s:5:"title";s:65:"

Create, get and delete an object expiration configuration.

";s:4:"code";s:2097:"$s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); #--------------------------------------------------------------------# # Create a new bucket $response = $s3->create_bucket($bucket, AmazonS3::REGION_US_STANDARD); if ($response->isOK()) { // Give the bucket a moment to create while (!$s3->if_bucket_exists($bucket)) { sleep(1); } } #--------------------------------------------------------------------# # Create some files in the bucket for ($i = 0; $i < 10; $i++) { $even = ($i % 2) ? 'odd' : 'even'; $s3->batch()->create_object($bucket, ($even . '/åéîøü' . $i), array( 'body' => 'sample text', 'contentType' => 'text/plain; charset=utf-8' )); } $responses = $s3->batch()->send(); if ($responses->areOK()) { print_r($s3->get_object_list($bucket)); echo PHP_EOL; } #--------------------------------------------------------------------# # Create an object expiration configuration $response = $s3->create_object_expiration_config($bucket, array( 'rules' => array( array( 'id' => 'unique-rule-identifier', 'prefix' => 'even/', 'expiration' => array( 'days' => 3 ) ), array( 'prefix' => 'odd/', 'expiration' => array( 'days' => 1 ) ) ) )); if ($response->isOK()) { // Give the configuration a moment to settle in while (!$s3->get_object_expiration_config($bucket)->isOK()) { sleep(1); } } #--------------------------------------------------------------------# # Lookup the configuration $response = $s3->get_object_expiration_config($bucket); print_r($response->body); echo PHP_EOL; #--------------------------------------------------------------------# # Delete the configuration $response = $s3->delete_object_expiration_config($bucket); if ($response->isOK()) { // Delete the bucket $response = $s3->delete_bucket($bucket, true); if ($response->isOK()) { echo 'Bucket was deleted!' . PHP_EOL; } else { echo 'Bucket deletion failed. #sadtromboneissad' . PHP_EOL; } }";}}s:7:"related";a:0:{}}i:34;a:7:{s:4:"name";s:14:"delete_objects";s:8:"modifier";s:6:"public";s:11:"description";s:247:"

Deletes one or more specified Amazon S3 objects from the specified bucket.

Since delete_object() is designed for deleting a single object, this method is intended to be used when there are two or more objects to delete.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:1671:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:1635:"public function delete_objects($bucket, $opt = null) { // Add this to our request if (!$opt) $opt = array(); $opt['verb'] = 'POST'; $opt['sub_resource'] = 'delete'; $opt['body'] = ''; // Bail out if (!isset($opt['objects']) || !is_array($opt['objects'])) { throw new S3_Exception('The ' . __FUNCTION__ . ' method requires the "objects" option to be set as an array.'); } $xml = new SimpleXMLElement($this->multi_object_delete_xml); // Add the objects foreach ($opt['objects'] as $object) { $xobject = $xml->addChild('Object'); $node = $xobject->addChild('Key'); $node[0] = $object['key']; if (isset($object['version_id'])) { $xobject->addChild('VersionId', $object['version_id']); } } // Quiet mode? if (isset($opt['quiet'])) { $quiet = 'false'; if (is_bool($opt['quiet'])) // Boolean { $quiet = $opt['quiet'] ? 'true' : 'false'; } elseif (is_string($opt['quiet'])) // String { $quiet = ($opt['quiet'] === 'true') ? 'true' : 'false'; } $xml->addChild('Quiet', $quiet); } // Enable MFA delete? // @codeCoverageIgnoreStart if (isset($opt['MFASerial']) && isset($opt['MFAToken'])) { $opt['headers'] = array( 'x-amz-mfa' => ($opt['MFASerial'] . ' ' . $opt['MFAToken']) ); } // @codeCoverageIgnoreEnd $opt['body'] = $xml->asXML(); // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:7:"seealso";a:1:{s:4:"link";s:68:"Multi-Factor Authentication";}}i:35;a:8:{s:4:"name";s:21:"delete_website_config";s:8:"modifier";s:6:"public";s:11:"description";s:54:"

Removes the website configuration for a bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:238:"public function delete_website_config($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'DELETE'; $opt['sub_resource'] = 'website'; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:36:"

Delete website configuration.

";s:4:"code";s:193:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->delete_website_config($bucket); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:2:{i:0;s:145:"create_website_config()";i:1;s:136:"get_website_config()";}}}i:36;a:9:{s:4:"name";s:15:"disable_logging";s:8:"modifier";s:6:"public";s:11:"description";s:66:"

Disables access logging for the specified Amazon S3 bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:180:"

The name of the bucket to use. Pass null if using set_vhost().

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:390:"public function disable_logging($bucket, $opt = null) { // Add this to our request if (!$opt) $opt = array(); $opt['verb'] = 'PUT'; $opt['sub_resource'] = 'logging'; $opt['headers'] = array( 'Content-Type' => 'application/xml' ); $opt['body'] = $this->base_logging_xml; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:36:"

Disable logging for a bucket.

";s:4:"code";s:394:"// Instantiate the class $s3 = new AmazonS3(); $logging_bucket = 'my-bucket-logs' . strtolower($s3->key); $logged_bucket = 'my-bucket-test' . strtolower($s3->key); // Disable logging for a given bucket $response = $s3->disable_logging($logged_bucket); // Delete bucket that contained the logs $s3->delete_bucket($logging_bucket, true); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:2:{i:0;s:124:"enable_logging()";i:1;s:106:"get_logs()";}}s:7:"seealso";a:1:{s:4:"link";s:123:"Server Access Logging Configuration API";}}i:37;a:7:{s:4:"name";s:11:"disable_ssl";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:312:"

Disables SSL/HTTPS connections for hosts that don’t support them. Some services, however, still require SSL support.

This method will throw a user warning when invoked, which can be hidden by changing your error_reporting() settings.

";s:11:"returnvalue";s:43:"

A reference to the current instance.

";s:6:"source";s:192:"public function disable_ssl() { trigger_error('Disabling SSL connections is potentially unsafe and highly discouraged.', E_USER_WARNING); $this->use_ssl = false; return $this; }";s:8:"examples";a:1:{s:7:"example";a:4:{s:5:"title";s:35:"

Disable SSL for the service.

";s:11:"description";s:170:"";s:4:"code";s:175:"// Disable SSL (Using @ to suppress the warning from the output) $sdb = new AmazonSDB(); @$sdb->disable_ssl(true); // Test if the value was set var_dump($sdb->use_ssl);";s:6:"result";s:11:"bool(false)";}}}i:38;a:7:{s:4:"name";s:24:"disable_ssl_verification";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:402:"

Disables the verification of the SSL Certificate Authority. Doing so can enable an attacker to carry out a man-in-the-middle attack.

https://secure.wikimedia.org/wikipedia/en/wiki/Man-in-the-middle_attack

This method will throw a user warning when invoked, which can be hidden by changing your error_reporting() settings.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:16:"ssl_verification";}}s:11:"returnvalue";s:43:"

A reference to the current instance.

";s:6:"source";s:314:"public function disable_ssl_verification($ssl_verification = false) { trigger_error('Disabling the verification of SSL certificates can lead to man-in-the-middle attacks. It is potentially unsafe and highly discouraged.', E_USER_WARNING); $this->ssl_verification = $ssl_verification; return $this; }";}i:39;a:9:{s:4:"name";s:18:"disable_versioning";s:8:"modifier";s:6:"public";s:11:"description";s:70:"

Disables versioning support for the specified Amazon S3 bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:1215:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:850:"public function disable_versioning($bucket, $opt = null) { if (!$opt) $opt = array(); // Add this to our request $opt['verb'] = 'PUT'; $opt['sub_resource'] = 'versioning'; $opt['headers'] = array( 'Content-Type' => 'application/xml' ); $xml = simplexml_load_string($this->base_versioning_xml); $xml->addChild('Status', 'Suspended'); // Enable MFA delete? // @codeCoverageIgnoreStart if (isset($opt['MFASerial']) && isset($opt['MFAToken']) && isset($opt['MFAStatus'])) { $xml->addChild('MfaDelete', $opt['MFAStatus']); $opt['headers']['x-amz-mfa'] = ($opt['MFASerial'] . ' ' . $opt['MFAToken']); } // @codeCoverageIgnoreEnd $opt['body'] = $xml->asXML(); // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:2:{i:0;a:3:{s:5:"title";s:42:"

Disable the versioning on a bucket.

";s:4:"code";s:276:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->disable_versioning($bucket); var_dump($response->isOK()); $status = $s3->get_versioning_status($bucket); var_dump((string) $status->body->Status);";s:6:"result";s:32:"bool(true) string(9) "Suspended"";}i:1;a:3:{s:5:"title";s:55:"

Disable the versioning on an MFA-enabled bucket.

";s:4:"code";s:310:"// Instantiate the class $s3 = new AmazonS3(); $response = $s3->disable_versioning('my-bucket', array( 'MFASerial' => CFCredentials::get()->mfa_serial, // Custom property in the config file. 'MFAToken' => '12345678', 'MFAStatus' => 'Disabled' )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}}s:7:"related";a:1:{s:6:"method";a:4:{i:0;s:160:"delete_all_object_versions()";i:1;s:133:"enable_versioning()";i:2;s:145:"get_versioning_status()";i:3;s:163:"list_bucket_object_versions()";}}s:7:"seealso";a:1:{s:4:"link";s:68:"Multi-Factor Authentication";}}i:40;a:8:{s:4:"name";s:17:"enable_debug_mode";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:75:"

Enables HTTP request/response header logging to STDERR.

";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:7:"enabled";s:4:"type";s:7:"boolean";s:11:"description";s:74:"

Whether or not to enable debug mode. Defaults to true.

";}}s:11:"returnvalue";s:43:"

A reference to the current instance.

";s:6:"source";s:109:"public function enable_debug_mode($enabled = true) { $this->debug_mode = $enabled; return $this; }";s:8:"examples";a:1:{s:7:"example";a:4:{s:5:"title";s:82:"

Enable the logging of HTTP request/response headers to STDERR.

";s:11:"description";s:87:"

Note: This method is inherited by all service-specific classes.

";s:4:"code";s:131:"// Adjust offset $sdb = new AmazonSDB(); $sdb->enable_debug_mode(); // Test if the value was set var_dump($sdb->debug_mode);";s:6:"result";s:10:"bool(true)";}}}i:41;a:9:{s:4:"name";s:14:"enable_logging";s:8:"modifier";s:6:"public";s:11:"description";s:65:"

Enables access logging for the specified Amazon S3 bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:4:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:216:"

The name of the bucket to enable logging for. Pass a null value when using the set_vhost() method.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:13:"target_bucket";s:4:"type";s:6:"string";s:11:"description";s:51:"

The name of the bucket to store the logs in.

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:13:"target_prefix";s:4:"type";s:6:"string";s:11:"description";s:48:"

The prefix to give to the log file names.

";}i:3;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:736:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:2675:"public function enable_logging($bucket, $target_bucket, $target_prefix, $opt = null) { // Add this to our request if (!$opt) $opt = array(); $opt['verb'] = 'PUT'; $opt['sub_resource'] = 'logging'; $opt['headers'] = array( 'Content-Type' => 'application/xml' ); $xml = simplexml_load_string($this->base_logging_xml); $LoggingEnabled = $xml->addChild('LoggingEnabled'); $LoggingEnabled->addChild('TargetBucket', $target_bucket); $LoggingEnabled->addChild('TargetPrefix', $target_prefix); $TargetGrants = $LoggingEnabled->addChild('TargetGrants'); if (isset($opt['users']) && is_array($opt['users'])) { foreach ($opt['users'] as $user) { $grant = $TargetGrants->addChild('Grant'); $grantee = $grant->addChild('Grantee'); switch ($user['id']) { // Authorized Users case self::USERS_AUTH: $grantee->addAttribute('xsi:type', 'Group', 'http://www.w3.org/2001/XMLSchema-instance'); $grantee->addChild('URI', self::USERS_AUTH); break; // All Users case self::USERS_ALL: $grantee->addAttribute('xsi:type', 'Group', 'http://www.w3.org/2001/XMLSchema-instance'); $grantee->addChild('URI', self::USERS_ALL); break; // The Logging User case self::USERS_LOGGING: $grantee->addAttribute('xsi:type', 'Group', 'http://www.w3.org/2001/XMLSchema-instance'); $grantee->addChild('URI', self::USERS_LOGGING); break; // Email Address or Canonical Id default: if (strpos($user['id'], '@')) { $grantee->addAttribute('xsi:type', 'AmazonCustomerByEmail', 'http://www.w3.org/2001/XMLSchema-instance'); $grantee->addChild('EmailAddress', $user['id']); } else { // Assume Canonical Id $grantee->addAttribute('xsi:type', 'CanonicalUser', 'http://www.w3.org/2001/XMLSchema-instance'); $grantee->addChild('ID', $user['id']); } break; } $grant->addChild('Permission', $user['permission']); } } $opt['body'] = $xml->asXML(); // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:34:"

Enable logging on a bucket.

";s:4:"code";s:1542:"// Instantiate the class $s3 = new AmazonS3(); $logged_bucket = 'my-bucket-test' . strtolower($s3->key); $logging_bucket = 'my-bucket-logs' . strtolower($s3->key); // Create bucket for storing logs $bucket = $s3->create_bucket($logging_bucket, AmazonS3::REGION_US_STANDARD); // Ensure that the bucket was created successfully... if ($bucket->isOK()) { // Enable READ_ACP and WRITE permissions for the system-wide "logging" user. $acl = $s3->set_bucket_acl($logging_bucket, array( array( 'id' => AmazonS3::USERS_LOGGING, 'permission' => AmazonS3::GRANT_READ_ACP ), // Logging user, READ_ACP array( 'id' => AmazonS3::USERS_LOGGING, 'permission' => AmazonS3::GRANT_WRITE ), // Logging user, WRITE array( 'id' => CFCredentials::get()->canonical_id, 'permission' => AmazonS3::GRANT_FULL_CONTROL ), // Self, FULL_CONTROL )); // Ensure that the ACL was set correctly... if ($acl->isOK()) { // Enable logging on the bucket $response = $s3->enable_logging($logged_bucket, $logging_bucket, 'log_', array( 'users' => array( array('id' => AmazonS3::USERS_AUTH, 'permission' => AmazonS3::GRANT_READ), array('id' => AmazonS3::USERS_ALL, 'permission' => AmazonS3::GRANT_READ), array('id' => AmazonS3::USERS_LOGGING, 'permission' => AmazonS3::GRANT_READ), array('id' => 'email@domain.com', 'permission' => AmazonS3::GRANT_FULL_CONTROL), ) )); // Success? var_dump($response->isOK()); } }";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:2:{i:0;s:127:"disable_logging()";i:1;s:106:"get_logs()";}}s:7:"seealso";a:1:{s:4:"link";s:123:"Server Access Logging Configuration API";}}i:42;a:7:{s:4:"name";s:17:"enable_path_style";s:8:"modifier";s:6:"public";s:11:"description";s:75:"

Enables the use of the older path-style URI access for all requests.

";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:5:"style";s:4:"type";s:6:"string";s:11:"description";s:111:"

Whether or not to enable path-style URI access for all requests. The default value is true.

";}}s:11:"returnvalue";s:43:"

A reference to the current instance.

";s:6:"source";s:105:"public function enable_path_style($style = true) { $this->path_style = $style; return $this; }";s:7:"related";a:1:{s:6:"method";a:3:{i:0;s:145:"get_canonical_user_id()";i:1;s:112:"set_region()";i:2;s:109:"set_vhost()";}}}i:43;a:9:{s:4:"name";s:17:"enable_versioning";s:8:"modifier";s:6:"public";s:11:"description";s:69:"

Enables versioning support for the specified Amazon S3 bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:1170:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:847:"public function enable_versioning($bucket, $opt = null) { if (!$opt) $opt = array(); // Add this to our request $opt['verb'] = 'PUT'; $opt['sub_resource'] = 'versioning'; $opt['headers'] = array( 'Content-Type' => 'application/xml' ); $xml = simplexml_load_string($this->base_versioning_xml); $xml->addChild('Status', 'Enabled'); // Enable MFA delete? // @codeCoverageIgnoreStart if (isset($opt['MFASerial']) && isset($opt['MFAToken']) && isset($opt['MFAStatus'])) { $xml->addChild('MfaDelete', $opt['MFAStatus']); $opt['headers']['x-amz-mfa'] = ($opt['MFASerial'] . ' ' . $opt['MFAToken']); } // @codeCoverageIgnoreEnd $opt['body'] = $xml->asXML(); // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:2:{i:0;a:3:{s:5:"title";s:37:"

Enable versioning on a bucket.

";s:4:"code";s:297:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->enable_versioning($bucket); sleep(1); $status = $s3->get_versioning_status($bucket); // Success? var_dump($response->isOK()); var_dump((string) $status->body->Status);";s:6:"result";s:30:"bool(true) string(7) "Enabled"";}i:1;a:3:{s:5:"title";s:69:"

Enable versioning and Multi-Factor Authentication on a bucket.

";s:4:"code";s:308:"// Instantiate the class $s3 = new AmazonS3(); $response = $s3->enable_versioning('my-bucket', array( 'MFASerial' => CFCredentials::get()->mfa_serial, // Custom property in the config file. 'MFAToken' => '12345678', 'MFAStatus' => 'Enabled' )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}}s:7:"related";a:1:{s:6:"method";a:4:{i:0;s:160:"delete_all_object_versions()";i:1;s:136:"disable_versioning()";i:2;s:145:"get_versioning_status()";i:3;s:163:"list_bucket_object_versions()";}}s:7:"seealso";a:1:{s:4:"link";s:68:"Multi-Factor Authentication";}}i:44;a:7:{s:4:"name";s:7:"factory";s:8:"modifier";s:13:"public static";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:76:"

Alternate approach to constructing a new instance. Supports chaining.

";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:7:"options";s:4:"type";s:5:"array";s:11:"description";s:1567:"

An associative array of parameters that can have the following keys:

";}}s:11:"returnvalue";a:1:{s:11:"@attributes";a:1:{s:4:"type";s:4:"void";}}s:6:"source";s:303:"public static function factory(array $options = array()) { 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::factory().'); } $self = get_called_class(); return new $self($options); }";}i:45;a:8:{s:4:"name";s:22:"generate_access_policy";s:8:"modifier";s:6:"public";s:11:"description";s:66:"

Generates the XML to be used for the Access Control Policy.

";s:10:"parameters";a:1:{s:9:"parameter";a:3:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:12:"canonical_id";s:4:"type";s:6:"string";s:11:"description";s:250:"

The canonical ID for the bucket owner. This is provided as the id return value from get_canonical_user_id().

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:14:"canonical_name";s:4:"type";s:6:"string";s:11:"description";s:263:"

The canonical display name for the bucket owner. This is provided as the display_name value from get_canonical_user_id().

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:5:"users";s:4:"type";s:5:"array";s:11:"description";s:132:"

An array of associative arrays. Each associative array contains an id value and a permission value.

";}}}s:11:"returnvalue";s:33:"

Access Control Policy XML.

";s:6:"source";s:2063:"public function generate_access_policy($canonical_id, $canonical_name, $users) { $xml = simplexml_load_string($this->base_acp_xml); $owner = $xml->addChild('Owner'); $owner->addChild('ID', $canonical_id); $owner->addChild('DisplayName', $canonical_name); $acl = $xml->addChild('AccessControlList'); foreach ($users as $user) { $grant = $acl->addChild('Grant'); $grantee = $grant->addChild('Grantee'); switch ($user['id']) { // Authorized Users case self::USERS_AUTH: $grantee->addAttribute('xsi:type', 'Group', 'http://www.w3.org/2001/XMLSchema-instance'); $grantee->addChild('URI', self::USERS_AUTH); break; // All Users case self::USERS_ALL: $grantee->addAttribute('xsi:type', 'Group', 'http://www.w3.org/2001/XMLSchema-instance'); $grantee->addChild('URI', self::USERS_ALL); break; // The Logging User case self::USERS_LOGGING: $grantee->addAttribute('xsi:type', 'Group', 'http://www.w3.org/2001/XMLSchema-instance'); $grantee->addChild('URI', self::USERS_LOGGING); break; // Email Address or Canonical Id default: if (strpos($user['id'], '@')) { $grantee->addAttribute('xsi:type', 'AmazonCustomerByEmail', 'http://www.w3.org/2001/XMLSchema-instance'); $grantee->addChild('EmailAddress', $user['id']); } else { // Assume Canonical Id $grantee->addAttribute('xsi:type', 'CanonicalUser', 'http://www.w3.org/2001/XMLSchema-instance'); $grantee->addChild('ID', $user['id']); } break; } $grant->addChild('Permission', $user['permission']); } return $xml->asXML(); }";s:7:"related";a:1:{s:6:"method";a:4:{i:0;s:124:"get_bucket_acl()";i:1;s:124:"get_object_acl()";i:2;s:124:"set_bucket_acl()";i:3;s:124:"set_object_acl()";}}s:7:"seealso";a:1:{s:4:"link";s:105:"Access Control Lists";}}i:46;a:7:{s:4:"name";s:30:"generate_access_policy_headers";s:8:"modifier";s:6:"public";s:11:"description";s:82:"

Generates the HTTP headers to be used for the Access Control Policy Grants.

";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:5:"users";s:4:"type";s:5:"array";s:11:"description";s:132:"

An array of associative arrays. Each associative array contains an id value and a permission value.

";}}s:11:"returnvalue";s:49:"

HTTP headers to be applied to the request.

";s:6:"source";s:1361:"public function generate_access_policy_headers($users) { $headers = array(); foreach ($users as $user) { // Determine permission. If doesn't exist, create it. $permission = 'x-amz-grant-' . str_replace('_', '-', strtolower($user['permission'])); if (!isset($headers[$permission])) { $headers[$permission] = array(); } // Handle the IDs switch ($user['id']) { case self::USERS_AUTH: // Authorized Users case self::USERS_ALL: // All Users case self::USERS_LOGGING: // The Logging User $headers[$permission][] = 'uri="' . $user['id'] . '"'; break; // Email Address or Canonical Id default: if (strpos($user['id'], '@')) { // Treat as email address $headers[$permission][] = 'emailAddress="' . $user['id'] . '"'; } else { // Assume Canonical Id $headers[$permission][] = 'id="' . $user['id'] . '"'; } break; } } foreach ($headers as &$permission) { $permission = implode(', ', $permission); } return $headers; }";s:7:"seealso";a:1:{s:4:"link";s:105:"Access Control Lists";}}i:47;a:9:{s:4:"name";s:14:"get_bucket_acl";s:8:"modifier";s:6:"public";s:11:"description";s:86:"

Gets the access control list (ACL) settings for the specified Amazon S3 bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:809:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:255:"public function get_bucket_acl($bucket, $opt = null) { // Add this to our request if (!$opt) $opt = array(); $opt['verb'] = 'GET'; $opt['sub_resource'] = 'acl'; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:41:"

Get the ACL settings for a bucket.

";s:4:"code";s:198:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket-us-east-acl' . strtolower($s3->key); $response = $s3->get_bucket_acl($bucket); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:16:{i:0;s:121:"create_bucket()";i:1;s:160:"delete_all_object_versions()";i:2;s:136:"delete_all_objects()";i:3;s:121:"delete_bucket()";i:4;s:148:"generate_access_policy()";i:5;s:139:"get_bucket_filesize()";i:6;s:136:"get_bucket_headers()";i:7;s:127:"get_bucket_list()";i:8;s:151:"get_bucket_object_count()";i:9;s:133:"get_bucket_region()";i:10;s:124:"get_object_acl()";i:11;s:130:"if_bucket_exists()";i:12;s:151:"if_bucket_policy_exists()";i:13;s:118:"list_buckets()";i:14;s:124:"set_bucket_acl()";i:15;s:124:"set_object_acl()";}}s:7:"seealso";a:1:{s:4:"link";s:116:"REST Access Control Policy";}}i:48;a:8:{s:4:"name";s:19:"get_bucket_filesize";s:8:"modifier";s:6:"public";s:11:"description";s:77:"

Gets the cumulative file size of the contents of the Amazon S3 bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:15:"friendly_format";s:4:"type";s:7:"boolean";s:11:"description";s:220:"

A value of true will format the return value to 2 decimal points using the largest possible unit (i.e., 3.42 GB). A value of false will format the return value as the raw number of bytes.

";}}}s:11:"returnvalue";s:77:"

The number of bytes as an integer, or the friendly format as a string.

";s:6:"source";s:891:"public function get_bucket_filesize($bucket, $friendly_format = false) { if ($this->use_batch_flow) { throw new S3_Exception(__FUNCTION__ . '() cannot be batch requested'); } $filesize = 0; $list = $this->list_objects($bucket); foreach ($list->body->Contents as $filename) { $filesize += (integer) $filename->Size; } while ((string) $list->body->IsTruncated === 'true') { $body = (array) $list->body; $list = $this->list_objects($bucket, array( 'marker' => (string) end($body['Contents'])->Key )); foreach ($list->body->Contents as $object) { $filesize += (integer) $object->Size; } } if ($friendly_format) { $filesize = $this->util->size_readable($filesize); } return $filesize; }";s:8:"examples";a:1:{s:7:"example";a:2:{i:0;a:2:{s:5:"title";s:58:"

Get the size of the contents of a bucket, in bytes.

";s:4:"code";s:180:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_bucket_filesize($bucket); // Success? var_dump($response);";}i:1;a:2:{s:5:"title";s:89:"

Get the size of the contents of a bucket, measured in the largest reasonable unit.

";s:4:"code";s:186:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_bucket_filesize($bucket, true); // Success? var_dump($response);";}}}s:7:"related";a:1:{s:6:"method";a:14:{i:0;s:121:"create_bucket()";i:1;s:160:"delete_all_object_versions()";i:2;s:136:"delete_all_objects()";i:3;s:121:"delete_bucket()";i:4;s:124:"get_bucket_acl()";i:5;s:136:"get_bucket_headers()";i:6;s:127:"get_bucket_list()";i:7;s:151:"get_bucket_object_count()";i:8;s:133:"get_bucket_region()";i:9;s:139:"get_object_filesize()";i:10;s:130:"if_bucket_exists()";i:11;s:151:"if_bucket_policy_exists()";i:12;s:118:"list_buckets()";i:13;s:124:"set_bucket_acl()";}}}i:49;a:8:{s:4:"name";s:18:"get_bucket_headers";s:8:"modifier";s:6:"public";s:11:"description";s:64:"

Gets the HTTP headers for the specified Amazon S3 bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:809:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:169:"public function get_bucket_headers($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'HEAD'; return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:36:"

Get the headers for a bucket.

";s:4:"code";s:190:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_bucket_headers($bucket); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:13:{i:0;s:121:"create_bucket()";i:1;s:160:"delete_all_object_versions()";i:2;s:136:"delete_all_objects()";i:3;s:121:"delete_bucket()";i:4;s:124:"get_bucket_acl()";i:5;s:139:"get_bucket_filesize()";i:6;s:127:"get_bucket_list()";i:7;s:151:"get_bucket_object_count()";i:8;s:133:"get_bucket_region()";i:9;s:130:"if_bucket_exists()";i:10;s:151:"if_bucket_policy_exists()";i:11;s:118:"list_buckets()";i:12;s:124:"set_bucket_acl()";}}}i:50;a:9:{s:4:"name";s:15:"get_bucket_list";s:8:"modifier";s:6:"public";s:11:"description";s:70:"

Gets a simplified list of bucket names on an Amazon S3 account.

";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:4:"pcre";s:4:"type";s:6:"string";s:11:"description";s:86:"

A Perl-Compatible Regular Expression (PCRE) to filter the bucket names against.

";}}s:11:"returnvalue";s:105:"

The list of matching bucket names. If there are no results, the method will return an empty array.

";s:6:"source";s:475:"public function get_bucket_list($pcre = null) { if ($this->use_batch_flow) { throw new S3_Exception(__FUNCTION__ . '() cannot be batch requested'); } // Get a list of buckets. $list = $this->list_buckets(); if ($list = $list->body->query('descendant-or-self::Name')) { $list = $list->map_string($pcre); return $list; } // @codeCoverageIgnoreStart return array(); // @codeCoverageIgnoreEnd }";s:8:"examples";a:1:{s:7:"example";a:2:{i:0;a:2:{s:5:"title";s:47:"

Get the list of buckets in your account.

";s:4:"code";s:119:"// Instantiate the class $s3 = new AmazonS3(); $response = $s3->get_bucket_list(); // Success? print_r($response);";}i:1;a:2:{s:5:"title";s:92:"

Get the list of buckets in your account that match a PCRE regular expression pattern.

";s:4:"code";s:177:"// Instantiate the class $s3 = new AmazonS3(); // Only return the buckets with 'my-' in the name $response = $s3->get_bucket_list('/my-/i'); // Success? print_r($response);";}}}s:7:"related";a:1:{s:6:"method";a:14:{i:0;s:121:"create_bucket()";i:1;s:160:"delete_all_object_versions()";i:2;s:136:"delete_all_objects()";i:3;s:121:"delete_bucket()";i:4;s:124:"get_bucket_acl()";i:5;s:139:"get_bucket_filesize()";i:6;s:136:"get_bucket_headers()";i:7;s:151:"get_bucket_object_count()";i:8;s:133:"get_bucket_region()";i:9;s:127:"get_object_list()";i:10;s:130:"if_bucket_exists()";i:11;s:151:"if_bucket_policy_exists()";i:12;s:118:"list_buckets()";i:13;s:124:"set_bucket_acl()";}}s:7:"seealso";a:1:{s:4:"link";s:71:"Regular Expressions (Perl-Compatible)";}}i:51;a:9:{s:4:"name";s:24:"get_bucket_notifications";s:8:"modifier";s:6:"public";s:11:"description";s:784:"

Gets the notification configuration of a bucket. Currently, the s3:ReducedRedundancyLostObject event is the only event supported for notifications. The s3:ReducedRedundancyLostObject event is triggered when Amazon S3 detects that it has lost all replicas of a Reduced Redundancy Storage object and can no longer service requests for that object.

If notifications are not enabled on the bucket, the operation returns an empty NotificatonConfiguration element.

By default, you must be the bucket owner to read the notification configuration of a bucket. However, the bucket owner can use a bucket policy to grant permission to other users to read this configuration with the s3:GetBucketNotification permission.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:243:"public function get_bucket_notifications($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'GET'; $opt['sub_resource'] = 'notification'; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:32:"

Get bucket notifications.

";s:4:"code";s:196:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_bucket_notifications($bucket); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:2:{i:0;s:160:"create_bucket_notification()";i:1;s:160:"delete_bucket_notification()";}}s:7:"seealso";a:1:{s:4:"link";s:131:"Setting Up Notification of Bucket Events";}}i:52;a:8:{s:4:"name";s:23:"get_bucket_object_count";s:8:"modifier";s:6:"public";s:11:"description";s:68:"

Gets the number of Amazon S3 objects in the specified bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}}s:11:"returnvalue";s:53:"

The number of Amazon S3 objects in the bucket.

";s:6:"source";s:302:"public function get_bucket_object_count($bucket) { if ($this->use_batch_flow) { // @codeCoverageIgnoreStart throw new S3_Exception(__FUNCTION__ . '() cannot be batch requested'); // @codeCoverageIgnoreEnd } return count($this->get_object_list($bucket)); }";s:8:"examples";a:1:{s:7:"example";a:2:{s:5:"title";s:51:"

Get the number of objects inside the bucket.

";s:4:"code";s:184:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_bucket_object_count($bucket); // Success? var_dump($response);";}}s:7:"related";a:1:{s:6:"method";a:14:{i:0;s:121:"create_bucket()";i:1;s:160:"delete_all_object_versions()";i:2;s:136:"delete_all_objects()";i:3;s:121:"delete_bucket()";i:4;s:124:"get_bucket_acl()";i:5;s:139:"get_bucket_filesize()";i:6;s:136:"get_bucket_headers()";i:7;s:127:"get_bucket_list()";i:8;s:133:"get_bucket_region()";i:9;s:139:"get_object_filesize()";i:10;s:130:"if_bucket_exists()";i:11;s:151:"if_bucket_policy_exists()";i:12;s:118:"list_buckets()";i:13;s:124:"set_bucket_acl()";}}}i:53;a:8:{s:4:"name";s:17:"get_bucket_policy";s:8:"modifier";s:6:"public";s:11:"description";s:567:"

Gets the policy of the specified Amazon S3 bucket.

To use this operation, the caller must have GetPolicy permissions for the specified bucket and must be the bucket owner. If the caller does not have GetPolicy permissions, this method will generate a 403 Access Denied error. If the caller has the correct permissions but is not the bucket owner, this method will generate a 405 Method Not Allowed error. If the bucket does not have a policy defined for it, this method will generate a 404 Policy Not Found error.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:230:"public function get_bucket_policy($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'GET'; $opt['sub_resource'] = 'policy'; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:48:"

Get the bucket policy for a given bucket.

";s:4:"code";s:214:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Get the bucket policy $response = $s3->get_bucket_policy($bucket); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:3:{i:0;s:142:"delete_bucket_policy()";i:1;s:151:"if_bucket_policy_exists()";i:2;s:133:"set_bucket_policy()";}}}i:54;a:8:{s:4:"name";s:17:"get_bucket_region";s:8:"modifier";s:6:"public";s:11:"description";s:74:"

Gets the region in which the specified Amazon S3 bucket is located.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:615:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:415:"public function get_bucket_region($bucket, $opt = null) { // Add this to our request if (!$opt) $opt = array(); $opt['verb'] = 'GET'; $opt['sub_resource'] = 'location'; // Authenticate to S3 $response = $this->authenticate($bucket, $opt); if ($response->isOK()) { // Handle body $response->body = (string) $response->body; } return $response; }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:59:"

Get the region code that the bucket is contained in.

";s:4:"code";s:278:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket-us-east' . strtolower($s3->key); $response = $s3->get_bucket_region($bucket); // Success? var_dump($response->isOK()); var_dump($response->body === ''); // U.S. Standard Region is an empty string.";s:6:"result";s:21:"bool(true) bool(true)";}}s:7:"related";a:1:{s:6:"method";a:13:{i:0;s:121:"create_bucket()";i:1;s:160:"delete_all_object_versions()";i:2;s:136:"delete_all_objects()";i:3;s:121:"delete_bucket()";i:4;s:124:"get_bucket_acl()";i:5;s:139:"get_bucket_filesize()";i:6;s:136:"get_bucket_headers()";i:7;s:127:"get_bucket_list()";i:8;s:151:"get_bucket_object_count()";i:9;s:130:"if_bucket_exists()";i:10;s:151:"if_bucket_policy_exists()";i:11;s:118:"list_buckets()";i:12;s:124:"set_bucket_acl()";}}}i:55;a:7:{s:4:"name";s:15:"get_bucket_tags";s:8:"modifier";s:6:"public";s:11:"description";s:61:"

Retrieve all associated tags for the specified bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:312:"public function get_bucket_tags($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'GET'; $opt['sub_resource'] = 'tagging'; $opt['headers'] = array( 'Content-Type' => 'application/xml' ); // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:2:{s:5:"title";s:42:"

Create, get and delete bucket tags.

";s:4:"code";s:1342:"$s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); #--------------------------------------------------------------------# # Create a new bucket $response = $s3->create_bucket($bucket, AmazonS3::REGION_US_STANDARD); if ($response->isOK()) { // Give the bucket a moment to create while (!$s3->if_bucket_exists($bucket)) { sleep(1); } } #--------------------------------------------------------------------# # Create new bucket tags $response = $s3->create_bucket_tags($bucket, array( 'tags' => array( 'project' => 'foo', 'user' => 'bar', ) )); if ($response->isOK()) { // Give the configuration a moment to settle in while (!$s3->get_bucket_tags($bucket)->isOK()) { sleep(1); } } #--------------------------------------------------------------------# # Retrieve the bucket tags $response = $s3->get_bucket_tags($bucket); print_r($response->body); echo PHP_EOL; #--------------------------------------------------------------------# # Delete the bucket tags $response = $s3->delete_bucket_tags($bucket); if ($response->isOK()) { // Delete the bucket $response = $s3->delete_bucket($bucket, true); if ($response->isOK()) { echo 'Bucket was deleted!' . PHP_EOL; } else { echo 'Bucket deletion failed. #sadtromboneissad' . PHP_EOL; } }";}}}i:56;a:6:{s:4:"name";s:21:"get_canonical_user_id";s:8:"modifier";s:6:"public";s:11:"description";s:77:"

Gets the canonical user ID and display name from the Amazon S3 server.

";s:11:"returnvalue";s:96:"

An associative array containing the id and display_name values.

";s:6:"source";s:367:"public function get_canonical_user_id() { if ($this->use_batch_flow) { throw new S3_Exception(__FUNCTION__ . '() cannot be batch requested'); } $id = $this->list_buckets(); return array( 'id' => (string) $id->body->Owner->ID, 'display_name' => (string) $id->body->Owner->DisplayName ); }";s:7:"related";a:1:{s:6:"method";a:3:{i:0;s:133:"enable_path_style()";i:1;s:112:"set_region()";i:2;s:109:"set_vhost()";}}}i:57;a:7:{s:4:"name";s:15:"get_cors_config";s:8:"modifier";s:6:"public";s:11:"description";s:40:"

Retrieves the CORS configuration.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:226:"public function get_cors_config($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'GET'; $opt['sub_resource'] = 'cors'; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{i:0;a:0:{}}}i:58;a:6:{s:4:"name";s:20:"get_lifecycle_config";s:8:"modifier";s:6:"public";s:11:"description";s:89:"

Retrieves the configuration that relates to the object’s lifecycle.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:236:"public function get_lifecycle_config($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'GET'; $opt['sub_resource'] = 'lifecycle'; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";}i:59;a:9:{s:4:"name";s:8:"get_logs";s:8:"modifier";s:6:"public";s:11:"description";s:75:"

Gets the access logs associated with the specified Amazon S3 bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:201:"

The name of the bucket to use. Pass a null value when using the set_vhost() method.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:809:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:253:"public function get_logs($bucket, $opt = null) { // Add this to our request if (!$opt) $opt = array(); $opt['verb'] = 'GET'; $opt['sub_resource'] = 'logging'; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:51:"

Get the logs associated with a given bucket.

";s:4:"code";s:180:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_logs($bucket); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:2:{i:0;s:127:"disable_logging()";i:1;s:124:"enable_logging()";}}s:7:"seealso";a:1:{s:4:"link";s:105:"Server Access Logging";}}i:60;a:8:{s:4:"name";s:20:"get_multipart_counts";s:8:"modifier";s:6:"public";s:11:"description";s:254:"

Calculates the correct values for sequentially reading a file for multipart upload. This method should be used in conjunction with upload_part().

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filesize";s:4:"type";s:7:"integer";s:11:"description";s:44:"

The size in bytes of the entire file.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:9:"part_size";s:4:"type";s:7:"integer";s:11:"description";s:57:"

The size in bytes of the part of the file to send.

";}}}s:11:"returnvalue";s:101:"

An array containing key-value pairs. The keys are seekTo and length.

";s:6:"source";s:413:"public function get_multipart_counts($filesize, $part_size) { $i = 0; $sizecount = $filesize; $values = array(); while ($sizecount > 0) { $sizecount -= $part_size; $values[] = array( 'seekTo' => ($part_size * $i), 'length' => (($sizecount > 0) ? $part_size : ($sizecount + $part_size)), ); $i++; } return $values; }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:70:"

Get the seek position and length values for a multipart upload.

";s:4:"code";s:162:"define('MB', 1048576); // Instantiate the class $s3 = new AmazonS3(); $response = $s3->get_multipart_counts(125*MB, 40*MB); // Success? var_dump($response);";s:6:"result";s:421:"array(4) { [0]=> array(2) { ["seekTo"]=> int(0) ["length"]=> int(41943040) } [1]=> array(2) { ["seekTo"]=> int(41943040) ["length"]=> int(41943040) } [2]=> array(2) { ["seekTo"]=> int(83886080) ["length"]=> int(41943040) } [3]=> array(2) { ["seekTo"]=> int(125829120) ["length"]=> int(5242880) } }";}}s:7:"related";a:1:{s:6:"method";a:8:{i:0;s:148:"abort_multipart_upload()";i:1;s:175:"abort_multipart_uploads_by_date()";i:2;s:157:"complete_multipart_upload()";i:3;s:133:"create_mpu_object()";i:4;s:157:"initiate_multipart_upload()";i:5;s:148:"list_multipart_uploads()";i:6;s:112:"list_parts()";i:7;s:115:"upload_part()";}}}i:61;a:8:{s:4:"name";s:10:"get_object";s:8:"modifier";s:6:"public";s:11:"description";s:255:"

Gets the contents of an Amazon S3 object in the specified bucket.

The MD5 value for an object can be retrieved from the ETag HTTP header for any object that was uploaded with a normal PUT/POST. This value is incorrect for multipart uploads.

";s:10:"parameters";a:1:{s:9:"parameter";a:3:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

The file name for the object.

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:2829:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:1069:"public function get_object($bucket, $filename, $opt = null) { if (!$opt) $opt = array(); // Add this to our request $opt['verb'] = 'GET'; $opt['resource'] = $filename; if (!isset($opt['headers']) || !is_array($opt['headers'])) { $opt['headers'] = array(); } if (isset($opt['lastmodified'])) { $opt['headers']['If-Modified-Since'] = $opt['lastmodified']; } if (isset($opt['etag'])) { $opt['headers']['If-None-Match'] = $opt['etag']; } // Partial content range if (isset($opt['range'])) { $opt['headers']['Range'] = 'bytes=' . $opt['range']; } // GET responses if (isset($opt['response'])) { foreach ($opt['response'] as $key => $value) { $opt['response-' . $key] = $value; unset($opt['response'][$key]); } } // Authenticate to S3 $this->parse_the_response = false; $response = $this->authenticate($bucket, $opt); $this->parse_the_response = true; return $response; }";s:8:"examples";a:1:{s:7:"example";a:7:{i:0;a:3:{s:5:"title";s:21:"

Get an object.

";s:4:"code";s:331:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_object($bucket, 'prefix with spaces/åéîøü/åéîøü/åéîøü with spaces.txt'); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:1;a:3:{s:5:"title";s:57:"

Get an object in pieces by specifying byte ranges.

";s:4:"code";s:680:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Empty response $response = ''; // Read the first chunk $response .= $s3->get_object($bucket, 'prefix with spaces/åéîøü/åéîøü/åéîøü with spaces.txt', array( 'range' => '0-10' ))->body; // Read the second chunk $response .= $s3->get_object($bucket, 'prefix with spaces/åéîøü/åéîøü/åéîøü with spaces.txt', array( 'range' => '11-21' ))->body; // Success? var_dump($response);";s:6:"result";s:34:"string(21) "This is my body text."";}i:2;a:3:{s:5:"title";s:85:"

Conditionally get an object if the object has changed since we last pulled it.

";s:4:"code";s:1156:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Get the file once $response = $s3->get_object($bucket, 'prefix with spaces/åéîøü/åéîøü/åéîøü with spaces.txt'); // Store the ETag and Last-Modified headers $etag = $response->header['etag']; $last_modified = $response->header['last-modified']; /*---- Later... ----*/ // Ask the server if the file has changed $new_response = $s3->get_object($bucket, 'prefix with spaces/åéîøü/åéîøü/åéîøü with spaces.txt', array( 'lastmodified' => $last_modified, 'etag' => $etag )); if ($new_response->isOK()) { // The server replied with "Yes, the file HAS changed. Here you go." (200) // Do something awesome with the updated data. } elseif ($new_response->isOK(304)) { // The server replied with "Dude, you've already got it." (304) // Do nothing because you're already awesome. } // Success? var_dump($new_response->status);";s:6:"result";s:8:"int(304)";}i:3;a:3:{s:5:"title";s:43:"

Get a specific version of an object.

";s:4:"code";s:421:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Get a specific version $response = $s3->get_object($bucket, 'test1.txt', array( 'versionId' => '0NNAq8PwvXvg8EfAYG9sSmwKTZeixZgZNE6PbodG8td0DJ3gVOmjI2Gh/oFnb0Ie=' )); // Success? var_dump($response->isOK()); var_dump(strpos((string) $response->header['_info']['url'], 'versionId=' . $version_id) !== false);";s:6:"result";s:21:"bool(true) bool(true)";}i:4;a:3:{s:5:"title";s:45:"

Download an object to the file system.

";s:4:"code";s:251:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_object($bucket, 'large_video.mov', array( 'fileDownload' => 'large_video.mov' )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:5;a:3:{s:5:"title";s:41:"

Download to an open file resource.

";s:4:"code";s:298:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $file_resource = fopen('large_video.mov', 'w+'); $response = $s3->get_object($bucket, 'large_video.mov', array( 'fileDownload' => $file_resource )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:6;a:3:{s:5:"title";s:42:"

Override specific response headers.

";s:4:"code";s:678:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_object($bucket, 'mårkér wîth spåcés ånd întl/åéîøü.txt', array( 'response' => array( 'content-type' => 'text/plain', 'content-language' => 'en-US', 'expires' => gmdate(DATE_RFC2822, strtotime('1 January 1980')) ) )); // Success? var_dump($response->isOK()); // Check that we got back what we asked for var_dump($response->header['content-language']); var_dump($response->header['content-type']); var_dump($response->header['expires']);";s:6:"result";s:97:"bool(true) string(5) "en-US" string(10) "text/plain" string(31) "Tue, 01 Jan 1980 08:00:00 +0000"";}}}s:7:"related";a:1:{s:6:"method";a:11:{i:0;s:115:"copy_object()";i:1;s:121:"create_object()";i:2;s:121:"delete_object()";i:3;s:124:"get_object_acl()";i:4;s:139:"get_object_filesize()";i:5;s:136:"get_object_headers()";i:6;s:127:"get_object_list()";i:7;s:130:"if_object_exists()";i:8;s:118:"list_objects()";i:9;s:124:"set_object_acl()";i:10;s:121:"update_object()";}}}i:62;a:9:{s:4:"name";s:14:"get_object_acl";s:8:"modifier";s:6:"public";s:11:"description";s:86:"

Gets the access control list (ACL) settings for the specified Amazon S3 object.

";s:10:"parameters";a:1:{s:9:"parameter";a:3:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

The file name for the object.

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:1023:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:300:"public function get_object_acl($bucket, $filename, $opt = null) { // Add this to our request if (!$opt) $opt = array(); $opt['verb'] = 'GET'; $opt['resource'] = $filename; $opt['sub_resource'] = 'acl'; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:2:{i:0;a:3:{s:5:"title";s:42:"

Get the ACL settings for an object.

";s:4:"code";s:199:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_object_acl($bucket, 'test1.txt'); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:1;a:3:{s:5:"title";s:64:"

Get the ACL settings for a specific version of an object.

";s:4:"code";s:481:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Get a specific version $response = $s3->get_object_acl($bucket, 'test1.txt', array( 'versionId' => '0NNAq8PwvXvg8EfAYG9sSmwKTZeixZgZNE6PbodG8td0DJ3gVOmjI2Gh/oFnb0Ie=' )); // Success? var_dump($response->isOK()); var_dump(strpos((string) $response->header['_info']['url'], 'versionId=' . '0NNAq8PwvXvg8EfAYG9sSmwKTZeixZgZNE6PbodG8td0DJ3gVOmjI2Gh/oFnb0Ie=') !== false);";s:6:"result";s:21:"bool(true) bool(true)";}}}s:7:"related";a:1:{s:6:"method";a:14:{i:0;s:115:"copy_object()";i:1;s:121:"create_object()";i:2;s:121:"delete_object()";i:3;s:148:"generate_access_policy()";i:4;s:124:"get_bucket_acl()";i:5;s:112:"get_object()";i:6;s:139:"get_object_filesize()";i:7;s:136:"get_object_headers()";i:8;s:127:"get_object_list()";i:9;s:130:"if_object_exists()";i:10;s:118:"list_objects()";i:11;s:124:"set_bucket_acl()";i:12;s:124:"set_object_acl()";i:13;s:121:"update_object()";}}s:7:"seealso";a:1:{s:4:"link";s:116:"REST Access Control Policy";}}i:63;a:8:{s:4:"name";s:28:"get_object_expiration_config";s:8:"modifier";s:6:"public";s:11:"description";s:18:"

@deprecated

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:2:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";}i:1;a:2:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";}}}s:11:"returnvalue";a:0:{}s:6:"source";s:128:"public function get_object_expiration_config($bucket, $opt = null) { return $this->get_lifecycle_config($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:2:{s:5:"title";s:65:"

Create, get and delete an object expiration configuration.

";s:4:"code";s:2097:"$s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); #--------------------------------------------------------------------# # Create a new bucket $response = $s3->create_bucket($bucket, AmazonS3::REGION_US_STANDARD); if ($response->isOK()) { // Give the bucket a moment to create while (!$s3->if_bucket_exists($bucket)) { sleep(1); } } #--------------------------------------------------------------------# # Create some files in the bucket for ($i = 0; $i < 10; $i++) { $even = ($i % 2) ? 'odd' : 'even'; $s3->batch()->create_object($bucket, ($even . '/åéîøü' . $i), array( 'body' => 'sample text', 'contentType' => 'text/plain; charset=utf-8' )); } $responses = $s3->batch()->send(); if ($responses->areOK()) { print_r($s3->get_object_list($bucket)); echo PHP_EOL; } #--------------------------------------------------------------------# # Create an object expiration configuration $response = $s3->create_object_expiration_config($bucket, array( 'rules' => array( array( 'id' => 'unique-rule-identifier', 'prefix' => 'even/', 'expiration' => array( 'days' => 3 ) ), array( 'prefix' => 'odd/', 'expiration' => array( 'days' => 1 ) ) ) )); if ($response->isOK()) { // Give the configuration a moment to settle in while (!$s3->get_object_expiration_config($bucket)->isOK()) { sleep(1); } } #--------------------------------------------------------------------# # Lookup the configuration $response = $s3->get_object_expiration_config($bucket); print_r($response->body); echo PHP_EOL; #--------------------------------------------------------------------# # Delete the configuration $response = $s3->delete_object_expiration_config($bucket); if ($response->isOK()) { // Delete the bucket $response = $s3->delete_bucket($bucket, true); if ($response->isOK()) { echo 'Bucket was deleted!' . PHP_EOL; } else { echo 'Bucket deletion failed. #sadtromboneissad' . PHP_EOL; } }";}}s:7:"related";a:0:{}}i:64;a:8:{s:4:"name";s:19:"get_object_filesize";s:8:"modifier";s:6:"public";s:11:"description";s:60:"

Gets the file size of the specified Amazon S3 object.

";s:10:"parameters";a:1:{s:9:"parameter";a:3:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

The file name for the object.

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:15:"friendly_format";s:4:"type";s:7:"boolean";s:11:"description";s:220:"

A value of true will format the return value to 2 decimal points using the largest possible unit (i.e., 3.42 GB). A value of false will format the return value as the raw number of bytes.

";}}}s:11:"returnvalue";s:114:"

The number of bytes as an integer, or the friendly format as a string. Returns false if the request failed.

";s:6:"source";s:532:"public function get_object_filesize($bucket, $filename, $friendly_format = false) { if ($this->use_batch_flow) { throw new S3_Exception(__FUNCTION__ . '() cannot be batch requested'); } $response = $this->get_object_headers($bucket, $filename); if (!$response->isOK()) { return false; } $filesize = (integer) $response->header['content-length']; if ($friendly_format) { $filesize = $this->util->size_readable($filesize); } return $filesize; }";s:8:"examples";a:1:{s:7:"example";a:2:{i:0;a:2:{s:5:"title";s:44:"

Get the size of the object, in bytes.

";s:4:"code";s:200:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_object_filesize($bucket, 'video/sample.mp4'); // Success? var_dump($response);";}i:1;a:2:{s:5:"title";s:75:"

Get the size of the object, measured in the largest reasonable unit.

";s:4:"code";s:206:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_object_filesize($bucket, 'video/sample.mp4', true); // Success? var_dump($response);";}}}s:7:"related";a:1:{s:6:"method";a:13:{i:0;s:115:"copy_object()";i:1;s:121:"create_object()";i:2;s:121:"delete_object()";i:3;s:139:"get_bucket_filesize()";i:4;s:151:"get_bucket_object_count()";i:5;s:112:"get_object()";i:6;s:124:"get_object_acl()";i:7;s:136:"get_object_headers()";i:8;s:127:"get_object_list()";i:9;s:130:"if_object_exists()";i:10;s:118:"list_objects()";i:11;s:124:"set_object_acl()";i:12;s:121:"update_object()";}}}i:65;a:8:{s:4:"name";s:18:"get_object_headers";s:8:"modifier";s:6:"public";s:11:"description";s:247:"

Gets the HTTP headers for the specified Amazon S3 object.

The MD5 value for an object can be retrieved from the ETag HTTP header for any object that was uploaded with a normal PUT/POST. This value is incorrect for multipart uploads.

";s:10:"parameters";a:1:{s:9:"parameter";a:3:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

The file name for the object.

";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:1023:"

An associative array of parameters that can have the following keys:

";}}}s:11:"returnvalue";s:149:"

A CFResponse object containing a parsed HTTP response.

";s:6:"source";s:271:"public function get_object_headers($bucket, $filename, $opt = null) { // Add this to our request if (!$opt) $opt = array(); $opt['verb'] = 'HEAD'; $opt['resource'] = $filename; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:2:{i:0;a:3:{s:5:"title";s:37:"

Get the headers for an object.

";s:4:"code";s:339:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_object_headers($bucket, 'prefix with spaces/åéîøü/åéîøü/åéîøü with spaces.txt'); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:1;a:3:{s:5:"title";s:59:"

Get the headers for a specific version of an object.

";s:4:"code";s:486:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // HEAD a specific version $response = $s3->get_object_headers($bucket, 'test1.txt', array( 'versionId' => '0NNAq8PwvXvg8EfAYG9sSmwKTZeixZgZNE6PbodG8td0DJ3gVOmjI2Gh/oFnb0Ie=' )); // Success? var_dump($response->isOK()); var_dump(strpos((string) $response->header['_info']['url'], 'versionId=' . '0NNAq8PwvXvg8EfAYG9sSmwKTZeixZgZNE6PbodG8td0DJ3gVOmjI2Gh/oFnb0Ie=') !== false);";s:6:"result";s:21:"bool(true) bool(true)";}}}s:7:"related";a:1:{s:6:"method";a:11:{i:0;s:115:"copy_object()";i:1;s:121:"create_object()";i:2;s:121:"delete_object()";i:3;s:112:"get_object()";i:4;s:124:"get_object_acl()";i:5;s:139:"get_object_filesize()";i:6;s:127:"get_object_list()";i:7;s:130:"if_object_exists()";i:8;s:118:"list_objects()";i:9;s:124:"set_object_acl()";i:10;s:121:"update_object()";}}}i:66;a:9:{s:4:"name";s:15:"get_object_list";s:8:"modifier";s:6:"public";s:11:"description";s:83:"

Gets a simplified list of Amazon S3 object file names contained in a bucket.

";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

The name of the bucket to use.

";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:1451:"

An associative array of parameters that can have the following keys:

<

ul>

  • delimiter - string - Optional - Keys that contain the same string between the prefix and the first occurrence of the delimiter will be rolled up into a single result element in the CommonPrefixes collection.
  • marker - string - Optional - Restricts the response to contain results that only occur alphabetically after the value of the marker.
  • max-keys - integer - Optional - The maximum number of results returned by the method call. The returned list will contain no more results than the specified value, but may return less. A value of zero is treated as if you did not specify max-keys.
  • pcre - string - Optional - A Perl-Compatible Regular Expression (PCRE) to filter the names against. This is applied only AFTER any native Amazon S3 filtering from specified prefix, marker, max-keys, or delimiter values are applied.
  • prefix - string - Optional - Restricts the response to contain results that begin only with the specified prefix.
  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • ";}}}s:11:"returnvalue";s:105:"

    The list of matching object names. If there are no results, the method will return an empty array.

    ";s:6:"source";s:2654:"public function get_object_list($bucket, $opt = null) { if ($this->use_batch_flow) { throw new S3_Exception(__FUNCTION__ . '() cannot be batch requested'); } if (!$opt) $opt = array(); unset($opt['returnCurlHandle']); // This would cause problems // Set some default values $pcre = isset($opt['pcre']) ? $opt['pcre'] : null; $max_keys = (isset($opt['max-keys']) && is_int($opt['max-keys'])) ? $opt['max-keys'] : null; $objects = array(); if (!$max_keys) { // No max-keys specified. Get everything. do { $list = $this->list_objects($bucket, $opt); if (is_string($list->body)) { $list->body = new CFSimpleXML($list->body); } if ($keys = $list->body->query('descendant-or-self::Key')->map_string($pcre)) { $objects = array_merge($objects, $keys); } $body = (array) $list->body; $opt = array_merge($opt, array( 'marker' => (isset($body['Contents']) && is_array($body['Contents'])) ? ((string) end($body['Contents'])->Key) : ((string) $list->body->Contents->Key) )); } while ((string) $list->body->IsTruncated === 'true'); } else { // Max-keys specified. Approximate number of loops and make the requests. $max_keys = $opt['max-keys']; $loops = ceil($max_keys / 1000); do { $list = $this->list_objects($bucket, $opt); if (is_string($list->body)) { $list->body = new CFSimpleXML($list->body); } $keys = $list->body->query('descendant-or-self::Key')->map_string($pcre); if ($count = count($keys)) { $objects = array_merge($objects, $keys); if ($count < 1000) { break; } } if ($max_keys > 1000) { $max_keys -= 1000; } $body = (array) $list->body; $opt = array_merge($opt, array( 'max-keys' => $max_keys, 'marker' => (isset($body['Contents']) && is_array($body['Contents'])) ? ((string) end($body['Contents'])->Key) : ((string) $list->body->Contents->Key) )); } while (--$loops); } return $objects; }";s:8:"examples";a:1:{s:7:"example";a:2:{i:0;a:3:{s:5:"title";s:47:"

    Get a list of all filenames in a bucket.

    ";s:4:"code";s:197:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_object_list($bucket); // Success? var_dump(gettype($response) === 'array');";s:6:"result";s:10:"bool(true)";}i:1;a:3:{s:5:"title";s:98:"

    Get a list of all filenames in a bucket that match a given PCRE regular expression pattern.

    ";s:4:"code";s:275:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Get all filenames that match this pattern $response = $s3->get_object_list($bucket, array( 'pcre' => '/pdf/i' )); // Success? var_dump(gettype($response) === 'array');";s:6:"result";s:10:"bool(true)";}}}s:7:"related";a:1:{s:6:"method";a:12:{i:0;s:115:"copy_object()";i:1;s:121:"create_object()";i:2;s:121:"delete_object()";i:3;s:127:"get_bucket_list()";i:4;s:112:"get_object()";i:5;s:124:"get_object_acl()";i:6;s:139:"get_object_filesize()";i:7;s:136:"get_object_headers()";i:8;s:130:"if_object_exists()";i:9;s:118:"list_objects()";i:10;s:124:"set_object_acl()";i:11;s:121:"update_object()";}}s:7:"seealso";a:1:{s:4:"link";s:71:"Regular Expressions (Perl-Compatible)";}}i:67;a:8:{s:4:"name";s:19:"get_object_metadata";s:8:"modifier";s:6:"public";s:11:"description";s:250:"

    Gets the collective metadata for the given Amazon S3 object.

    The MD5 value for an object can be retrieved from the ETag HTTP header for any object that was uploaded with a normal PUT/POST. This value is incorrect for multipart uploads.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:3:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:46:"

    The file name for the Amazon S3 object.

    ";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:733:"

    An associative array of parameters that can have the following keys:

    ";}}}s:11:"returnvalue";s:174:"

    If the object exists, the method returns the collective metadata for the Amazon S3 object. If the object does not exist, the method returns boolean false.

    ";s:6:"source";s:2109:"public function get_object_metadata($bucket, $filename, $opt = null) { $batch = new CFBatchRequest(); $this->batch($batch)->get_object_acl($bucket, $filename); // Get ACL info $this->batch($batch)->get_object_headers($bucket, $filename); // Get content-type $this->batch($batch)->list_objects($bucket, array( // Get other metadata 'max-keys' => 1, 'prefix' => $filename )); $response = $this->batch($batch)->send(); // Fail if any requests were unsuccessful if (!$response->areOK()) { return false; } $data = array( 'ACL' => array(), 'ContentType' => null, 'ETag' => null, 'Headers' => null, 'Key' => null, 'LastModified' => null, 'Owner' => array(), 'Size' => null, 'StorageClass' => null, ); // Add the content type $data['ContentType'] = (string) $response[1]->header['content-type']; // Add the other metadata (including storage type) $contents = json_decode(json_encode($response[2]->body->query('descendant-or-self::Contents')->first()), true); $data = array_merge($data, (is_array($contents) ? $contents : array())); // Add ACL info $grants = $response[0]->body->query('descendant-or-self::Grant'); $max = count($grants); // Add raw header info $data['Headers'] = $response[1]->header; foreach (array('_info', 'x-amz-id-2', 'x-amz-request-id', 'cneonction', 'server', 'content-length', 'content-type', 'etag') as $header) { unset($data['Headers'][$header]); } ksort($data['Headers']); if (count($grants) > 0) { foreach ($grants as $grant) { $dgrant = array( 'id' => (string) $this->util->try_these(array('ID', 'URI'), $grant->Grantee), 'permission' => (string) $grant->Permission ); $data['ACL'][] = $dgrant; } } return $data; }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:38:"

    Get the metadata for an object.

    ";s:4:"code";s:421:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_object_metadata($bucket, 'üpløåd/î\'vé nøw béén üpløådéd.txt'); // Success? var_dump($response['ContentType']); var_dump($response['Headers']['content-language']); var_dump($response['Headers']['x-amz-meta-ice-ice-baby']);";s:6:"result";s:73:"string(10) "text/plain" string(5) "en-US" string(18) "too cold, too cold"";}}s:7:"related";a:1:{s:6:"method";a:2:{i:0;s:139:"change_content_type()";i:1;s:157:"change_storage_redundancy()";}}}i:68;a:9:{s:4:"name";s:14:"get_object_url";s:8:"modifier";s:6:"public";s:11:"description";s:122:"

    Gets the web-accessible URL for the Amazon S3 object or generates a time-limited signed request for a private file.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:46:"

    The file name for the Amazon S3 object.

    ";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:7:"preauth";s:4:"type";s:14:"integer|string";s:11:"description";s:224:"

    Specifies that a presigned URL for this request should be returned. May be passed as a number of seconds since UNIX Epoch, or any string compatible with strtotime().

    ";}i:3;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:1647:"

    An associative array of parameters that can have the following keys:

    ";}}}s:11:"returnvalue";s:80:"

    The file URL, with authentication and/or torrent parameters if requested.

    ";s:6:"source";s:1032:"public function get_object_url($bucket, $filename, $preauth = 0, $opt = null) { // Add this to our request if (!$opt) $opt = array(); $opt['verb'] = isset($opt['method']) ? $opt['method'] : 'GET'; $opt['resource'] = $filename; $opt['preauth'] = $preauth; if (isset($opt['torrent']) && $opt['torrent']) { $opt['sub_resource'] = 'torrent'; unset($opt['torrent']); } // GET responses if (isset($opt['response'])) { foreach ($opt['response'] as $key => $value) { $opt['response-' . $key] = $value; unset($opt['response'][$key]); } } // Determine whether or not to use SSL $use_ssl = isset($opt['https']) ? (bool) $opt['https'] : false; unset($opt['https']); $current_use_ssl_setting = $this->use_ssl; // Authenticate to S3 $this->use_ssl = $use_ssl; $response = $this->authenticate($bucket, $opt); $this->use_ssl = $current_use_ssl_setting; return $response; }";s:8:"examples";a:1:{s:7:"example";a:3:{i:0;a:3:{s:5:"title";s:38:"

    Get the URL for a given object.

    ";s:4:"code";s:162:"// Instantiate the class $s3 = new AmazonS3(); // Get the URL $url = $s3->get_object_url('my-bucket', 'video/sample_public.mp4'); // Success? var_dump($url);";s:6:"result";s:70:"string(57) "http://my-bucket.s3.amazonaws.com/video/sample_public.mp4"";}i:1;a:2:{s:5:"title";s:69:"

    Get an object URL that will return requested response headers.

    ";s:4:"code";s:889:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Get the URL $url = $s3->get_object_url($bucket, 'mårkér wîth spåcés ånd întl/åéîøü.txt', '5 minutes', array( 'response' => array( 'content-type' => 'text/plain', 'content-language' => 'en-US', 'expires' => gmdate(DATE_RFC2822, strtotime('1 January 1980')) ) )); // Try to fetch the URL so we can get the status code $http = new CFRequest($url); $http->add_header('Content-Type', ''); # Simulate a web browser $http->send_request(true); $code = $http->get_response_code(); $headers = $http->get_response_header(); // Success? var_dump($url); var_dump($code); var_dump($headers['content-language']); var_dump($headers['content-type']); var_dump($headers['expires']);";}i:2;a:2:{s:5:"title";s:59:"

    AmazonS3 - Get Object URL with temporary credentials

    ";s:4:"code";s:1772:"// Dependencies require_once dirname(__FILE__) . '/../../sdk.class.php'; require_once dirname(__FILE__) . '/../testutil.inc.php'; // Instantiate STS and get temporary credentials $sts = new AmazonSTS(); $response = $sts->get_session_token(); if ($response->isOK()) { $credentials = array( 'key' => (string) $response->body->GetSessionTokenResult->Credentials->AccessKeyId, 'secret' => (string) $response->body->GetSessionTokenResult->Credentials->SecretAccessKey, 'token' => (string) $response->body->GetSessionTokenResult->Credentials->SessionToken, ); } else { die('Temporary credentials could not retrieved.'); } // Instantiate S3 $s3 = new AmazonS3($credentials); $source_bucket = 'my-bucket' . strtolower(CFCredentials::get()->key); $dest_bucket = 'my-bucket' . strtolower(CFCredentials::get()->key); // Pull over an object that we want to get the URL for. $copy = $s3->copy_object( array( // Source 'bucket' => $source_bucket, 'filename' => 'text/sample.txt' ), array( // Destination 'bucket' => $dest_bucket, 'filename' => 'text/sample_private.txt' ), array( // Optional parameters 'acl' => AmazonS3::ACL_PRIVATE // Let's explicitly set it to private. ) ); // Ensure that the copy was successful if ($copy->isOK()) { // Get the URL $url = $s3->get_object_url($dest_bucket, 'text/sample_private.txt', '5 minutes'); // Try to fetch the URL so we can get the status code $http = new RequestCore($url); $http->add_header('Content-Type', ''); # Simulate a web browser $http->send_request(true); $code = $http->get_response_code(); // Success? var_dump($url); var_dump($code); } else { die('S3 object for test was not copied.'); }";}}}s:7:"related";a:1:{s:6:"method";s:127:"get_torrent_url()";}s:7:"seealso";a:1:{s:4:"link";s:116:"Using Query String Authentication";}}i:69;a:9:{s:4:"name";s:15:"get_torrent_url";s:8:"modifier";s:6:"public";s:11:"description";s:304:"

    Gets the web-accessible URL to a torrent of the Amazon S3 object. The Amazon S3 object’s access control list settings (ACL) MUST be set to ACL_PUBLIC for a valid URL to be returned.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:3:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

    The file name for the object.

    ";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:7:"preauth";s:4:"type";s:14:"integer|string";s:11:"description";s:224:"

    Specifies that a presigned URL for this request should be returned. May be passed as a number of seconds since UNIX Epoch, or any string compatible with strtotime().

    ";}}}s:11:"returnvalue";s:68:"

    The torrent URL, with authentication parameters if requested.

    ";s:6:"source";s:179:"public function get_torrent_url($bucket, $filename, $preauth = 0) { return $this->get_object_url($bucket, $filename, $preauth, array( 'torrent' => true )); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:41:"

    Get the torrent URL for an object.

    ";s:4:"code";s:163:"// Instantiate the class $s3 = new AmazonS3(); // Get the URL $url = $s3->get_torrent_url('my-bucket', 'video/sample_public.mp4'); // Success? var_dump($url);";s:6:"result";s:78:"string(65) "http://my-bucket.s3.amazonaws.com/video/sample_public.mp4?torrent"";}}s:7:"related";a:1:{s:6:"method";s:124:"get_object_url()";}s:7:"seealso";a:1:{s:4:"link";s:158:"Using BitTorrent to Retrieve Objects Stored in Amazon S3";}}i:70;a:8:{s:4:"name";s:21:"get_versioning_status";s:8:"modifier";s:6:"public";s:11:"description";s:58:"

    Gets an Amazon S3 bucket’s versioning status.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:809:"

    An associative array of parameters that can have the following keys:

    ";}}}s:11:"returnvalue";s:149:"

    A CFResponse object containing a parsed HTTP response.

    ";s:6:"source";s:238:"public function get_versioning_status($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'GET'; $opt['sub_resource'] = 'versioning'; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:45:"

    Get the versioning status of a bucket.

    ";s:4:"code";s:216:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Get the full status $response = $s3->get_versioning_status($bucket); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:4:{i:0;s:160:"delete_all_object_versions()";i:1;s:136:"disable_versioning()";i:2;s:133:"enable_versioning()";i:3;s:163:"list_bucket_object_versions()";}}}i:71;a:8:{s:4:"name";s:18:"get_website_config";s:8:"modifier";s:6:"public";s:11:"description";s:258:"

    Retrieves the website configuration for a bucket. The contents of this response are identical to the content submitted by the user during the website creation operation. If a website configuration has never been set, Amazon S3 will return a 404 error.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

    An associative array of parameters that can have the following keys:

    ";}}}s:11:"returnvalue";s:149:"

    A CFResponse object containing a parsed HTTP response.

    ";s:6:"source";s:315:"public function get_website_config($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'GET'; $opt['sub_resource'] = 'website'; $opt['headers'] = array( 'Content-Type' => 'application/xml' ); // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:45:"

    Get an existing website configuration.

    ";s:4:"code";s:190:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->get_website_config($bucket); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:2:{i:0;s:145:"create_website_config()";i:1;s:145:"delete_website_config()";}}}i:72;a:8:{s:4:"name";s:16:"if_bucket_exists";s:8:"modifier";s:6:"public";s:11:"description";s:134:"

    Gets whether or not the specified Amazon S3 bucket exists in Amazon S3. This includes buckets that do not belong to the caller.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}}s:11:"returnvalue";s:106:"

    A value of true if the bucket exists, or a value of false if it does not.

    ";s:6:"source";s:273:"public function if_bucket_exists($bucket) { if ($this->use_batch_flow) { throw new S3_Exception(__FUNCTION__ . '() cannot be batch requested'); } $header = $this->get_bucket_headers($bucket); return (integer) $header->status !== 404; }";s:8:"examples";a:1:{s:7:"example";a:4:{s:5:"title";s:49:"

    Check if a bucket exists in the S3 system.

    ";s:11:"description";s:90:"

    Note: A successful response does NOT mean that you own the bucket.

    ";s:4:"code";s:212:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->if_bucket_exists($bucket); // Success? (Boolean, not a CFResponse object) var_dump($response);";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:14:{i:0;s:121:"create_bucket()";i:1;s:160:"delete_all_object_versions()";i:2;s:136:"delete_all_objects()";i:3;s:121:"delete_bucket()";i:4;s:124:"get_bucket_acl()";i:5;s:139:"get_bucket_filesize()";i:6;s:136:"get_bucket_headers()";i:7;s:127:"get_bucket_list()";i:8;s:151:"get_bucket_object_count()";i:9;s:133:"get_bucket_region()";i:10;s:151:"if_bucket_policy_exists()";i:11;s:130:"if_object_exists()";i:12;s:118:"list_buckets()";i:13;s:124:"set_bucket_acl()";}}}i:73;a:8:{s:4:"name";s:23:"if_bucket_policy_exists";s:8:"modifier";s:6:"public";s:11:"description";s:97:"

    Gets whether or not the specified Amazon S3 bucket has a bucket policy associated with it.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}}s:11:"returnvalue";s:112:"

    A value of true if a bucket policy exists, or a value of false if one does not.

    ";s:6:"source";s:490:"public function if_bucket_policy_exists($bucket) { if ($this->use_batch_flow) { // @codeCoverageIgnoreStart throw new S3_Exception(__FUNCTION__ . '() cannot be batch requested'); // @codeCoverageIgnoreEnd } $response = $this->get_bucket_policy($bucket); if ($response->isOK()) { return true; } elseif ($response->status === 404) { return false; } // @codeCoverageIgnoreStart return null; // @codeCoverageIgnoreEnd }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:39:"

    Check if a bucket policy exists.

    ";s:4:"code";s:219:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->if_bucket_policy_exists($bucket); // Success? (Boolean, not a CFResponse object) var_dump($response);";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:17:{i:0;s:121:"create_bucket()";i:1;s:160:"delete_all_object_versions()";i:2;s:136:"delete_all_objects()";i:3;s:121:"delete_bucket()";i:4;s:142:"delete_bucket_policy()";i:5;s:124:"get_bucket_acl()";i:6;s:139:"get_bucket_filesize()";i:7;s:136:"get_bucket_headers()";i:8;s:127:"get_bucket_list()";i:9;s:151:"get_bucket_object_count()";i:10;s:133:"get_bucket_policy()";i:11;s:133:"get_bucket_region()";i:12;s:130:"if_bucket_exists()";i:13;s:130:"if_object_exists()";i:14;s:118:"list_buckets()";i:15;s:124:"set_bucket_acl()";i:16;s:133:"set_bucket_policy()";}}}i:74;a:8:{s:4:"name";s:16:"if_object_exists";s:8:"modifier";s:6:"public";s:11:"description";s:89:"

    Gets whether or not the specified Amazon S3 object exists in the specified bucket.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

    The file name for the object.

    ";}}}s:11:"returnvalue";s:106:"

    A value of true if the object exists, or a value of false if it does not.

    ";s:6:"source";s:430:"public function if_object_exists($bucket, $filename) { if ($this->use_batch_flow) { throw new S3_Exception(__FUNCTION__ . '() cannot be batch requested'); } $header = $this->get_object_headers($bucket, $filename); if ($header->isOK()) { return true; } elseif ($header->status === 404) { return false; } // @codeCoverageIgnoreStart return null; // @codeCoverageIgnoreEnd }";s:8:"examples";a:1:{s:7:"example";a:4:{s:5:"title";s:40:"

    Check to see if an object exists.

    ";s:11:"description";s:104:"

    Note: This does not check whether you can read the object — only if it exists.

    ";s:4:"code";s:225:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->if_object_exists($bucket, 'test1.txt'); // Success? (Boolean, not a CFResponse object) var_dump($response);";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:13:{i:0;s:115:"copy_object()";i:1;s:121:"create_object()";i:2;s:121:"delete_object()";i:3;s:112:"get_object()";i:4;s:124:"get_object_acl()";i:5;s:139:"get_object_filesize()";i:6;s:136:"get_object_headers()";i:7;s:127:"get_object_list()";i:8;s:130:"if_bucket_exists()";i:9;s:151:"if_bucket_policy_exists()";i:10;s:118:"list_objects()";i:11;s:124:"set_object_acl()";i:12;s:121:"update_object()";}}}i:75;a:9:{s:4:"name";s:25:"initiate_multipart_upload";s:8:"modifier";s:6:"public";s:11:"description";s:73:"

    Initiates a multipart upload and returns an UploadId.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:3:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

    The file name for the object.

    ";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:2185:"

    An associative array of parameters that can have the following keys:

    ";}}}s:11:"returnvalue";s:149:"

    A CFResponse object containing a parsed HTTP response.

    ";s:6:"source";s:1946:"public function initiate_multipart_upload($bucket, $filename, $opt = null) { if (!$opt) $opt = array(); // Add this to our request $opt['verb'] = 'POST'; $opt['resource'] = $filename; $opt['sub_resource'] = 'uploads'; $opt['body'] = ''; // Handle content type. Can also be passed as an HTTP header. if (isset($opt['contentType'])) { $opt['headers']['Content-Type'] = $opt['contentType']; unset($opt['contentType']); } // Set a default content type. if (!isset($opt['headers']['Content-Type'])) { $opt['headers']['Content-Type'] = 'application/octet-stream'; } // Handle Access Control Lists. Can also be passed as an HTTP header. if (isset($opt['acl'])) { if (is_array($opt['acl'])) { $opt['headers'] = array_merge($opt['headers'], $this->generate_access_policy_headers($opt['acl'])); } else { $opt['headers']['x-amz-acl'] = $opt['acl']; } } // Handle storage settings. Can also be passed as an HTTP header. if (isset($opt['storage'])) { $opt['headers']['x-amz-storage-class'] = $opt['storage']; unset($opt['storage']); } // Handle encryption settings. Can also be passed as an HTTP header. if (isset($opt['encryption'])) { $opt['headers']['x-amz-server-side-encryption'] = $opt['encryption']; unset($opt['encryption']); } // Handle meta tags. Can also be passed as an HTTP header. if (isset($opt['meta'])) { foreach ($opt['meta'] as $meta_key => $meta_value) { // e.g., `My Meta Header` is converted to `x-amz-meta-my-meta-header`. $opt['headers']['x-amz-meta-' . strtolower(str_replace(' ', '-', $meta_key))] = $meta_value; } unset($opt['meta']); } // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:4:{s:5:"title";s:39:"

    Initiate a new multipart upload.

    ";s:11:"description";s:236:"
    1. Initiate a new multipart upload using initiate_multipart_upload().
    2. Upload the parts using upload_part().
    3. Complete the upload using complete_multipart_upload().
    ";s:4:"code";s:582:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Initiate a new multipart upload $response = $s3->initiate_multipart_upload($bucket, 'movie.mp4', array( 'contentType' => 'video/mp4', 'acl' => AmazonS3::ACL_PUBLIC, 'storage' => AmazonS3::STORAGE_STANDARD, 'meta' => array( 'resolution' => '720p', 'rating' => 'US PG-13', 'runtime' => '2:04:37' ) )); // Get the Upload ID $upload_id = (string) $response->body->UploadId; // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:8:{i:0;s:148:"abort_multipart_upload()";i:1;s:175:"abort_multipart_uploads_by_date()";i:2;s:157:"complete_multipart_upload()";i:3;s:133:"create_mpu_object()";i:4;s:142:"get_multipart_counts()";i:5;s:148:"list_multipart_uploads()";i:6;s:112:"list_parts()";i:7;s:115:"upload_part()";}}s:7:"seealso";a:1:{s:4:"link";s:116:"REST Access Control Policy";}}i:76;a:8:{s:4:"name";s:27:"list_bucket_object_versions";s:8:"modifier";s:6:"public";s:11:"description";s:84:"

    Gets a list of all the versions of Amazon S3 objects in the specified bucket.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:1813:"

    An associative array of parameters that can have the following keys:

    ";}}}s:11:"returnvalue";s:149:"

    A CFResponse object containing a parsed HTTP response.

    ";s:6:"source";s:498:"public function list_bucket_object_versions($bucket, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'GET'; $opt['sub_resource'] = 'versions'; foreach (array('delimiter', 'key-marker', 'max-keys', 'prefix', 'version-id-marker') as $param) { if (isset($opt[$param])) { $opt['query_string'][$param] = $opt[$param]; unset($opt[$param]); } } // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:2:{i:0;a:3:{s:5:"title";s:44:"

    List all object versions in a bucket.

    ";s:4:"code";s:199:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->list_bucket_object_versions($bucket); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:1;a:3:{s:5:"title";s:79:"

    List all object versions in a bucket that match the provided parameters.

    ";s:4:"code";s:359:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->list_bucket_object_versions($bucket, array( 'prefix' => 'test1.txt', 'max-keys' => 1 )); // Success? var_dump($response->isOK()); var_dump((string) $response->body->Prefix); var_dump((string) $response->body->MaxKeys);";s:6:"result";s:46:"bool(true) string(9) "test1.txt" string(1) "1"";}}}s:7:"related";a:1:{s:6:"method";a:4:{i:0;s:160:"delete_all_object_versions()";i:1;s:136:"disable_versioning()";i:2;s:133:"enable_versioning()";i:3;s:145:"get_versioning_status()";}}}i:77;a:8:{s:4:"name";s:12:"list_buckets";s:8:"modifier";s:6:"public";s:11:"description";s:84:"

    Gets a list of all buckets contained in the caller’s Amazon S3 account.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:809:"

    An associative array of parameters that can have the following keys:

    ";}}s:11:"returnvalue";s:149:"

    A CFResponse object containing a parsed HTTP response.

    ";s:6:"source";s:148:"public function list_buckets($opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'GET'; return $this->authenticate('', $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:43:"

    List all buckets under your account.

    ";s:4:"code";s:128:"// Instantiate the class $s3 = new AmazonS3(); $response = $s3->list_buckets(); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:13:{i:0;s:121:"create_bucket()";i:1;s:160:"delete_all_object_versions()";i:2;s:136:"delete_all_objects()";i:3;s:121:"delete_bucket()";i:4;s:124:"get_bucket_acl()";i:5;s:139:"get_bucket_filesize()";i:6;s:136:"get_bucket_headers()";i:7;s:127:"get_bucket_list()";i:8;s:151:"get_bucket_object_count()";i:9;s:133:"get_bucket_region()";i:10;s:130:"if_bucket_exists()";i:11;s:151:"if_bucket_policy_exists()";i:12;s:124:"set_bucket_acl()";}}}i:78;a:8:{s:4:"name";s:22:"list_multipart_uploads";s:8:"modifier";s:6:"public";s:11:"description";s:47:"

    Lists the in-progress multipart uploads.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:1395:"

    An associative array of parameters that can have the following keys:

    ";}}}s:11:"returnvalue";s:149:"

    A CFResponse object containing a parsed HTTP response.

    ";s:6:"source";s:503:"public function list_multipart_uploads($bucket, $opt = null) { if (!$opt) $opt = array(); // Add this to our request $opt['verb'] = 'GET'; $opt['sub_resource'] = 'uploads'; foreach (array('key-marker', 'max-uploads', 'upload-id-marker') as $param) { if (isset($opt[$param])) { $opt['query_string'][$param] = $opt[$param]; unset($opt[$param]); } } // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:46:"

    List all in-progress multipart uploads.

    ";s:4:"code";s:228:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->list_multipart_uploads($bucket, array( 'max-uploads' => 1, )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:8:{i:0;s:148:"abort_multipart_upload()";i:1;s:175:"abort_multipart_uploads_by_date()";i:2;s:157:"complete_multipart_upload()";i:3;s:133:"create_mpu_object()";i:4;s:142:"get_multipart_counts()";i:5;s:157:"initiate_multipart_upload()";i:6;s:112:"list_parts()";i:7;s:115:"upload_part()";}}}i:79;a:8:{s:4:"name";s:12:"list_objects";s:8:"modifier";s:6:"public";s:11:"description";s:671:"

    Gets a list of all Amazon S3 objects in the specified bucket.

    NOTE: This method is paginated, and will not return more than max-keys keys. If you want to retrieve a list of all keys, you will need to make multiple calls to this function using the marker option to specify the pagination offset (the key of the last processed key—lexically ordered) and the IsTruncated response key to detect when all results have been processed. See: the S3 REST documentation for get_bucket for more information.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:1612:"

    An associative array of parameters that can have the following keys:

    ";}}}s:11:"returnvalue";s:149:"

    A CFResponse object containing a parsed HTTP response.

    ";s:6:"source";s:451:"public function list_objects($bucket, $opt = null) { if (!$opt) $opt = array(); // Add this to our request $opt['verb'] = 'GET'; foreach (array('delimiter', 'marker', 'max-keys', 'prefix') as $param) { if (isset($opt[$param])) { $opt['query_string'][$param] = $opt[$param]; unset($opt[$param]); } } // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{i:0;a:3:{s:5:"title";s:40:"

    List all objects inside a bucket.

    ";s:4:"code";s:184:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->list_objects($bucket); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:1;a:3:{s:5:"title";s:72:"

    List all objects inside a bucket that match the parameters given.

    ";s:4:"code";s:288:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->list_objects($bucket, array( 'prefix' => 'word/', 'max-keys' => 1 )); // Success? var_dump($response->isOK()); var_dump(count($response->body->Contents))";s:6:"result";s:17:"bool(true) int(1)";}i:2;a:3:{s:5:"title";s:99:"

    List all objects inside a bucket that match the parameters given. Supports UTF-8 characters.

    ";s:4:"code";s:308:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->list_objects($bucket, array( 'delimiter' => '/', 'marker' => 'mårkér wîth spåcés ånd întl' )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}}s:7:"related";a:1:{s:6:"method";a:11:{i:0;s:115:"copy_object()";i:1;s:121:"create_object()";i:2;s:121:"delete_object()";i:3;s:112:"get_object()";i:4;s:124:"get_object_acl()";i:5;s:139:"get_object_filesize()";i:6;s:136:"get_object_headers()";i:7;s:127:"get_object_list()";i:8;s:130:"if_object_exists()";i:9;s:124:"set_object_acl()";i:10;s:121:"update_object()";}}}i:80;a:8:{s:4:"name";s:10:"list_parts";s:8:"modifier";s:6:"public";s:11:"description";s:68:"

    Lists the completed parts of an in-progress multipart upload.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

    The file name for the object.

    ";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:9:"upload_id";s:4:"type";s:6:"string";s:11:"description";s:284:"

    The upload ID identifying the multipart upload whose parts are being listed. The upload ID is retrieved from a call to initiate_multipart_upload().

    ";}i:3;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:847:"

    An associative array of parameters that can have the following keys:

    ";}}}s:11:"returnvalue";s:149:"

    A CFResponse object containing a parsed HTTP response.

    ";s:6:"source";s:567:"public function list_parts($bucket, $filename, $upload_id, $opt = null) { if (!$opt) $opt = array(); // Add this to our request $opt['verb'] = 'GET'; $opt['resource'] = $filename; $opt['uploadId'] = $upload_id; $opt['query_string'] = array(); foreach (array('max-parts', 'part-number-marker') as $param) { if (isset($opt[$param])) { $opt['query_string'][$param] = $opt[$param]; unset($opt[$param]); } } // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:61:"

    List all of the completed parts of a multipart upload.

    ";s:4:"code";s:319:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->list_parts($bucket, 'movie.mp4', 'f_JM_zwhU37pj1tS.F2BXVWUJtGcNso1WEikZImjrBCYUbUQwNnOUwX.Z00O1QmKQXAjqQBD4BVZRGmEXAMPLE--', array( 'max-parts' => 10 )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:8:{i:0;s:148:"abort_multipart_upload()";i:1;s:175:"abort_multipart_uploads_by_date()";i:2;s:157:"complete_multipart_upload()";i:3;s:133:"create_mpu_object()";i:4;s:142:"get_multipart_counts()";i:5;s:157:"initiate_multipart_upload()";i:6;s:148:"list_multipart_uploads()";i:7;s:115:"upload_part()";}}}i:81;a:6:{s:4:"name";s:23:"register_stream_wrapper";s:8:"modifier";s:6:"public";s:11:"description";s:73:"

    Loads and registers the S3StreamWrapper class as a stream wrapper.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:8:"protocol";s:4:"type";s:6:"string";s:11:"description";s:44:"

    The name of the protocol to register.

    ";}}s:11:"returnvalue";s:49:"

    Whether or not the registration succeeded.

    ";s:6:"source";s:260:"public function register_stream_wrapper($protocol = 's3') { require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'extensions' . DIRECTORY_SEPARATOR . 's3streamwrapper.class.php'; return S3StreamWrapper::register($this, $protocol); }";}i:82;a:8:{s:4:"name";s:32:"register_streaming_read_callback";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:753:"

    Register a callback function to execute whenever a data stream is read from using CFRequest::streaming_read_callback().

    The user-defined callback function should accept three arguments:

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"callback";s:4:"type";s:21:"string|array|function";s:11:"description";s:363:"

    The callback function is called by call_user_func(), so you can pass the following values:

    ";}}s:11:"returnvalue";s:43:"

    A reference to the current instance.

    ";s:6:"source";s:143:"public function register_streaming_read_callback($callback) { $this->registered_streaming_read_callback = $callback; return $this; }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:85:"

    Register a callback function to execute when data is read from an open stream.

    ";s:4:"code";s:694:"$s3 = new AmazonS3(); // Define callback function function callback($curl_handle, $file_handle, $length) { $total = curl_getinfo($curl_handle, CURLINFO_CONTENT_LENGTH_DOWNLOAD); $transferred = curl_getinfo($curl_handle, CURLINFO_SIZE_DOWNLOAD); $percentage = floor(($transferred / $total) * 100); echo 'Transferred ' . $transferred . ' KB out of ' . $total . ' KB (' . $percentage . '%)' . PHP_EOL; } // Register a callback function to execute when a stream is read locally. $s3->register_streaming_read_callback('callback'); // Download a public object. $response = $s3->create_object('my-bucket', 'my-large-file.mp4', array( 'fileUpload' => './uploads/my-large-file.mp4' ));";s:6:"result";s:94:"Transferred 7200 bytes out of 9000000 (0%) ... Transferred 9000000 bytes out of 9000000 (100%)";}}}i:83;a:8:{s:4:"name";s:33:"register_streaming_write_callback";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:608:"

    Register a callback function to execute whenever a data stream is written to using CFRequest::streaming_write_callback().

    The user-defined callback function should accept two arguments:

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"callback";s:4:"type";s:21:"string|array|function";s:11:"description";s:363:"

    The callback function is called by call_user_func(), so you can pass the following values:

    ";}}s:11:"returnvalue";s:43:"

    A reference to the current instance.

    ";s:6:"source";s:145:"public function register_streaming_write_callback($callback) { $this->registered_streaming_write_callback = $callback; return $this; }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:86:"

    Register a callback function to execute when data is written to an open stream.

    ";s:4:"code";s:685:"$s3 = new AmazonS3(); // Define callback function function callback($curl_handle, $length) { $total = curl_getinfo($curl_handle, CURLINFO_CONTENT_LENGTH_DOWNLOAD); $transferred = curl_getinfo($curl_handle, CURLINFO_SIZE_DOWNLOAD); $percentage = floor(($transferred / $total) * 100); echo 'Transferred ' . $transferred . ' KB out of ' . $total . ' KB (' . $percentage . '%)' . PHP_EOL; } // Register a callback function to execute when a stream is written locally. $s3->register_streaming_write_callback('callback'); // Download a public object. $response = $s3->get_object('my-bucket', 'my-large-file.mp4', array( 'fileDownload' => './downloads/my-large-file.mp4' ));";s:6:"result";s:94:"Transferred 7200 bytes out of 9000000 (0%) ... Transferred 9000000 bytes out of 9000000 (100%)";}}}i:84;a:6:{s:4:"name";s:23:"restore_archived_object";s:8:"modifier";s:6:"public";s:11:"description";s:70:"

    Restore an object archived in Amazon Glacier back to Amazon S3.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

    The file name for the object.

    ";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:4:"days";s:4:"type";s:7:"integer";s:11:"description";s:124:"

    The number of days until the targeted objects are to be moved or expired from the bucket. Must be a positive integer.

    ";}i:3;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

    An associative array of parameters that can have the following keys:

    ";}}}s:11:"returnvalue";s:149:"

    A CFResponse object containing a parsed HTTP response.

    ";s:6:"source";s:549:"public function restore_archived_object($bucket, $filename, $days, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'POST'; $opt['resource'] = $filename; $opt['sub_resource'] = 'restore'; $opt['headers'] = array( 'Content-Type' => 'application/xml' ); $xml = simplexml_load_string($this->restore_request_xml, $this->parser_class); $xml->addChild('Days', (integer) $days); $opt['body'] = $xml->asXML(); // Authenticate to S3 return $this->authenticate($bucket, $opt); }";}i:85;a:7:{s:4:"name";s:4:"send";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:71:"

    Executes the batch request queue by sending all queued requests.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:16:"clear_after_send";s:4:"type";s:7:"boolean";s:11:"description";s:204:"

    Whether or not to clear the batch queue after sending a request. Defaults to true. Set this to false if you are caching batch responses and want to retrieve results later.

    ";}}s:11:"returnvalue";s:126:"

    An array of CFResponse objects.

    ";s:6:"source";s:2018:"public function send($clear_after_send = true) { if ($this->use_batch_flow) { // When we send the request, disable batch flow. $this->use_batch_flow = false; // If we're not caching, simply send the request. if (!$this->use_cache_flow) { $response = $this->batch_object->send(); $parsed_data = array_map(array($this, 'parse_callback'), $response); $parsed_data = new CFArray($parsed_data); // Clear the queue if ($clear_after_send) { $this->batch_object->queue = array(); } return $parsed_data; } // Generate an identifier specific to this particular set of arguments. $cache_id = $this->key . '_' . get_class($this) . '_' . sha1(serialize($this->batch_object)); // Instantiate the appropriate caching object. $this->cache_object = new $this->cache_class($cache_id, $this->cache_location, $this->cache_expires, $this->cache_compress); if ($this->delete_cache) { $this->use_cache_flow = false; $this->delete_cache = false; return $this->cache_object->delete(); } // Invoke the cache callback function to determine whether to pull data from the cache or make a fresh request. $data_set = $this->cache_object->response_manager(array($this, 'cache_callback_batch'), array($this->batch_object)); $parsed_data = array_map(array($this, 'parse_callback'), $data_set); $parsed_data = new CFArray($parsed_data); // Clear the queue if ($clear_after_send) { $this->batch_object->queue = array(); } // End! return $parsed_data; } // Load the class $null = new CFBatchRequest(); unset($null); throw new CFBatchRequest_Exception('You must use $object->batch()->send()'); }";}i:86;a:7:{s:4:"name";s:15:"set_batch_class";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:291:"

    Set a custom class for this functionality. Use this method when extending/overriding existing classes with new functionality.

    The replacement class must extend from CFBatchRequest.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:5:"class";s:4:"type";s:6:"string";s:11:"description";s:63:"

    The name of the new class to use for this functionality.

    ";}}s:11:"returnvalue";s:43:"

    A reference to the current instance.

    ";s:6:"source";s:116:"public function set_batch_class($class = 'CFBatchRequest') { $this->batch_class = $class; return $this; }";}i:87;a:9:{s:4:"name";s:14:"set_bucket_acl";s:8:"modifier";s:6:"public";s:11:"description";s:86:"

    Sets the access control list (ACL) settings for the specified Amazon S3 bucket.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:3:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"acl";s:4:"type";s:6:"string";s:11:"description";s:574:"

    The ACL settings for the specified bucket. [Allowed values: AmazonS3::ACL_PRIVATE, AmazonS3::ACL_PUBLIC, AmazonS3::ACL_OPEN, AmazonS3::ACL_AUTH_READ, AmazonS3::ACL_OWNER_READ, AmazonS3::ACL_OWNER_FULL_CONTROL]. Alternatively, an array of associative arrays. Each associative array contains an id and a permission key. The default value is ACL_PRIVATE.

    ";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

    An associative array of parameters that can have the following keys:

    ";}}}s:11:"returnvalue";s:149:"

    A CFResponse object containing a parsed HTTP response.

    ";s:6:"source";s:1037:"public function set_bucket_acl($bucket, $acl = self::ACL_PRIVATE, $opt = null) { // Add this to our request if (!$opt) $opt = array(); $opt['verb'] = 'PUT'; $opt['sub_resource'] = 'acl'; $opt['headers'] = array( 'Content-Type' => 'application/xml' ); // Make sure these are defined. // @codeCoverageIgnoreStart if (!$this->credentials->canonical_id || !$this->credentials->canonical_name) { // Fetch the data live. $canonical = $this->get_canonical_user_id(); $this->credentials->canonical_id = $canonical['id']; $this->credentials->canonical_name = $canonical['display_name']; } // @codeCoverageIgnoreEnd if (is_array($acl)) { $opt['headers'] = array_merge($opt['headers'], $this->generate_access_policy_headers($acl)); } else { $opt['body'] = ''; $opt['headers']['x-amz-acl'] = $acl; } // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:2:{i:0;a:3:{s:5:"title";s:44:"

    Set a canned ACL setting on a bucket.

    ";s:4:"code";s:221:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket-us-east-acl' . strtolower($s3->key); $response = $s3->set_bucket_acl($bucket, AmazonS3::ACL_PRIVATE); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:1;a:3:{s:5:"title";s:44:"

    Set a custom ACL setting on a bucket.

    ";s:4:"code";s:474:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket-us-east-acl' . strtolower($s3->key); $response = $s3->set_bucket_acl($bucket, array( array( 'id' => AmazonS3::USERS_AUTH, 'permission' => AmazonS3::GRANT_READ ), // Authenticated users, READ array( 'id' => CFCredentials::get()->canonical_id, 'permission' => AmazonS3::GRANT_FULL_CONTROL ) // Self, FULL_CONTROL )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}}s:7:"related";a:1:{s:6:"method";a:16:{i:0;s:121:"create_bucket()";i:1;s:160:"delete_all_object_versions()";i:2;s:136:"delete_all_objects()";i:3;s:121:"delete_bucket()";i:4;s:148:"generate_access_policy()";i:5;s:124:"get_bucket_acl()";i:6;s:139:"get_bucket_filesize()";i:7;s:136:"get_bucket_headers()";i:8;s:127:"get_bucket_list()";i:9;s:151:"get_bucket_object_count()";i:10;s:133:"get_bucket_region()";i:11;s:124:"get_object_acl()";i:12;s:130:"if_bucket_exists()";i:13;s:151:"if_bucket_policy_exists()";i:14;s:118:"list_buckets()";i:15;s:124:"set_object_acl()";}}s:7:"seealso";a:1:{s:4:"link";s:116:"REST Access Control Policy";}}i:88;a:9:{s:4:"name";s:17:"set_bucket_policy";s:8:"modifier";s:6:"public";s:11:"description";s:542:"

    Sets the policy sub-resource for the specified Amazon S3 bucket. The specified policy replaces any policy the bucket already has.

    To perform this operation, the caller must be authorized to set a policy for the bucket and have PutPolicy permissions. If the caller does not have PutPolicy permissions for the bucket, Amazon S3 returns a 403 Access Denied error. If the caller has the correct permissions but has not been authorized by the bucket owner, Amazon S3 returns a 405 Method Not Allowed error.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:3:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"policy";s:4:"type";s:8:"CFPolicy";s:11:"description";s:30:"

    The JSON policy to use.

    ";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

    An associative array of parameters that can have the following keys:

    ";}}}s:11:"returnvalue";s:149:"

    A CFResponse object containing a parsed HTTP response.

    ";s:6:"source";s:291:"public function set_bucket_policy($bucket, CFPolicy $policy, $opt = null) { if (!$opt) $opt = array(); $opt['verb'] = 'PUT'; $opt['sub_resource'] = 'policy'; $opt['body'] = $policy->get_json(); // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:4:{s:5:"title";s:32:"

    Set a bucket-wide policy.

    ";s:11:"description";s:175:"

    See Access Policy Language for more information about writing S3 policies.

    ";s:4:"code";s:593:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket-test' . strtolower($s3->key); // Generate a new policy object $policy = new CFPolicy($s3, array( 'Version' => '2008-10-17', 'Statement' => array( array( // Statement #1 'Sid' => 'AddPerm', 'Effect' => 'Allow', 'Principal' => array( 'AWS' => '*' ), 'Action' => array('s3:*'), 'Resource' => array("arn:aws:s3:::${bucket}/*") ) ) )); // Set the bucket policy $response = $s3->set_bucket_policy($bucket, $policy); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:3:{i:0;s:142:"delete_bucket_policy()";i:1;s:133:"get_bucket_policy()";i:2;s:151:"if_bucket_policy_exists()";}}s:7:"seealso";a:1:{s:4:"link";s:130:"Appendix: The Access Policy Language";}}i:89;a:8:{s:4:"name";s:16:"set_cache_config";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:65:"

    Set the caching configuration to use for response caching.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"location";s:4:"type";s:6:"string";s:11:"description";s:1095:"

    The location to store the cache object in. This may vary by cache method.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:4:"gzip";s:4:"type";s:7:"boolean";s:11:"description";s:241:"

    Whether or not data should be gzipped before being stored. A value of true will compress the contents before caching them. A value of false will leave the contents uncompressed. Defaults to true.

    ";}}}s:11:"returnvalue";s:43:"

    A reference to the current instance.

    ";s:6:"source";s:1210:"public function set_cache_config($location, $gzip = true) { // If location is empty, don't do anything. if (empty($location)) { return $this; } // If we have an array, we're probably passing in Memcached servers and ports. if (is_array($location)) { $this->cache_class = 'CacheMC'; } else { // I would expect locations like `/tmp/cache`, `pdo.mysql://user:pass@hostname:port`, `pdo.sqlite:memory:`, and `apc`. $type = strtolower(substr($location, 0, 3)); switch ($type) { case 'apc': $this->cache_class = 'CacheAPC'; break; case 'xca': // First three letters of `xcache` $this->cache_class = 'CacheXCache'; break; case 'pdo': $this->cache_class = 'CachePDO'; $location = substr($location, 4); break; default: $this->cache_class = 'CacheFile'; break; } } // Set the remaining cache information. $this->cache_location = $location; $this->cache_compress = $gzip; return $this; }";s:8:"examples";a:1:{s:7:"example";a:2:{i:0;a:4:{s:5:"title";s:65:"

    Fire a single request, and then cache the response to APC.

    ";s:11:"description";s:87:"

    Note: This method is inherited by all service-specific classes.

    ";s:4:"code";s:302:"// Instantiate $sdb = new AmazonSDB(); $sdb->set_cache_config('apc'); // First time pulls live data $response = $sdb->cache(10)->list_domains(); var_dump($response->isOK()); // Second time pulls from cache $response = $sdb->cache(10)->list_domains(); var_dump($response->isOK());";s:6:"result";s:21:"bool(true) bool(true)";}i:1;a:4:{s:5:"title";s:77:"

    Fire a single request, and then cache the response to the file system.

    ";s:11:"description";s:87:"

    Note: This method is inherited by all service-specific classes.

    ";s:4:"code";s:306:"// Instantiate $sdb = new AmazonSDB(); $sdb->set_cache_config('./cache'); // First time pulls live data $response = $sdb->cache(10)->list_domains(); var_dump($response->isOK()); // Second time pulls from cache $response = $sdb->cache(10)->list_domains(); var_dump($response->isOK());";s:6:"result";s:21:"bool(true) bool(true)";}}}}i:90;a:8:{s:4:"name";s:12:"set_hostname";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:145:"

    Set the hostname to connect to. This is useful for alternate services that are API-compatible with AWS, but run from a different hostname.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:2:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"hostname";s:4:"type";s:6:"string";s:11:"description";s:133:"

    The alternate hostname to use in place of the default one. Useful for mock or test applications living on different hostnames.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:11:"port_number";s:4:"type";s:7:"integer";s:11:"description";s:139:"

    The alternate port number to use in place of the default one. Useful for mock or test applications living on different port numbers.

    ";}}}s:11:"returnvalue";s:43:"

    A reference to the current instance.

    ";s:6:"source";s:341:"public function set_hostname($hostname, $port_number = null) { if ($this->override_hostname) { $this->hostname = $hostname; if ($port_number) { $this->port_number = $port_number; $this->hostname .= ':' . (string) $this->port_number; } } return $this; }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:46:"

    Configure hostname and resource prefix.

    ";s:4:"code";s:316:"// Instantiate the class $ec2 = new AmazonEC2(); // Point to the new endpoint $ec2->set_hostname('localhost', '3000'); $ec2->set_resource_prefix('/services/mock'); $ec2->allow_hostname_override(false); // Describe images $response = $ec2->describe_images(); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}}i:91;a:8:{s:4:"name";s:15:"set_max_retries";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:65:"

    Sets the maximum number of times to retry failed requests.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:7:"retries";s:4:"type";s:7:"integer";s:11:"description";s:88:"

    The maximum number of times to retry failed requests. Defaults to 3.

    ";}}s:11:"returnvalue";s:43:"

    A reference to the current instance.

    ";s:6:"source";s:105:"public function set_max_retries($retries = 3) { $this->max_retries = $retries; return $this; }";s:8:"examples";a:1:{s:7:"example";a:4:{s:5:"title";s:65:"

    Sets the maximum number of times to retry failed requests.

    ";s:11:"description";s:87:"

    Note: This method is inherited by all service-specific classes.

    ";s:4:"code";s:131:"// Adjust offset $sdb = new AmazonSDB(); $sdb->set_max_retries(3); // Test if the value was set var_dump($sdb->max_retries);";s:6:"result";s:6:"int(3)";}}}i:92;a:9:{s:4:"name";s:14:"set_object_acl";s:8:"modifier";s:6:"public";s:11:"description";s:86:"

    Sets the access control list (ACL) settings for the specified Amazon S3 object.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

    The file name for the object.

    ";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"acl";s:4:"type";s:6:"string";s:11:"description";s:515:"

    The ACL settings for the specified object. Accepts any of the following constants: [Allowed values: AmazonS3::ACL_PRIVATE, AmazonS3::ACL_PUBLIC, AmazonS3::ACL_OPEN, AmazonS3::ACL_AUTH_READ, AmazonS3::ACL_OWNER_READ, AmazonS3::ACL_OWNER_FULL_CONTROL]. Alternatively, an array of associative arrays. Each associative array contains an id and a permission key. The default value is ACL_PRIVATE.

    ";}i:3;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:519:"

    An associative array of parameters that can have the following keys:

    ";}}}s:11:"returnvalue";s:149:"

    A CFResponse object containing a parsed HTTP response.

    ";s:6:"source";s:1383:"public function set_object_acl($bucket, $filename, $acl = self::ACL_PRIVATE, $opt = null) { // Add this to our request if (!$opt) $opt = array(); $opt['verb'] = 'PUT'; $opt['resource'] = $filename; $opt['sub_resource'] = 'acl'; // Retrieve the original metadata $metadata = $this->get_object_metadata($bucket, $filename); if ($metadata && $metadata['ContentType']) { $opt['headers']['Content-Type'] = $metadata['ContentType']; } if ($metadata && $metadata['StorageClass']) { $opt['headers']['x-amz-storage-class'] = $metadata['StorageClass']; } // Make sure these are defined. // @codeCoverageIgnoreStart if (!$this->credentials->canonical_id || !$this->credentials->canonical_name) { // Fetch the data live. $canonical = $this->get_canonical_user_id(); $this->credentials->canonical_id = $canonical['id']; $this->credentials->canonical_name = $canonical['display_name']; } // @codeCoverageIgnoreEnd if (is_array($acl)) { $opt['headers'] = array_merge($opt['headers'], $this->generate_access_policy_headers($acl)); } else { $opt['body'] = ''; $opt['headers']['x-amz-acl'] = $acl; } // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:2:{i:0;a:3:{s:5:"title";s:45:"

    Set a canned ACL setting on an object.

    ";s:4:"code";s:221:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->set_object_acl($bucket, 'test1.txt', AmazonS3::ACL_PUBLIC); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}i:1;a:3:{s:5:"title";s:45:"

    Set a custom ACL setting on an object.

    ";s:4:"code";s:475:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $response = $s3->set_object_acl($bucket, 'test1.txt', array( array( 'id' => AmazonS3::USERS_AUTH, 'permission' => AmazonS3::GRANT_READ ), // Authenticated users, READ array( 'id' => CFCredentials::get()->canonical_id, 'permission' => AmazonS3::GRANT_FULL_CONTROL ) // Self, FULL_CONTROL )); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}}s:7:"related";a:1:{s:6:"method";a:14:{i:0;s:115:"copy_object()";i:1;s:121:"create_object()";i:2;s:121:"delete_object()";i:3;s:148:"generate_access_policy()";i:4;s:124:"get_bucket_acl()";i:5;s:112:"get_object()";i:6;s:124:"get_object_acl()";i:7;s:139:"get_object_filesize()";i:8;s:136:"get_object_headers()";i:9;s:127:"get_object_list()";i:10;s:130:"if_object_exists()";i:11;s:118:"list_objects()";i:12;s:124:"set_bucket_acl()";i:13;s:121:"update_object()";}}s:7:"seealso";a:1:{s:4:"link";s:116:"REST Access Control Policy";}}i:93;a:7:{s:4:"name";s:16:"set_parser_class";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:282:"

    Set a custom class for this functionality. Use this method when extending/overriding existing classes with new functionality.

    The replacement class must extend from CFSimpleXML.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:5:"class";s:4:"type";s:6:"string";s:11:"description";s:63:"

    The name of the new class to use for this functionality.

    ";}}s:11:"returnvalue";s:43:"

    A reference to the current instance.

    ";s:6:"source";s:115:"public function set_parser_class($class = 'CFSimpleXML') { $this->parser_class = $class; return $this; }";}i:94;a:8:{s:4:"name";s:9:"set_proxy";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:37:"

    Set the proxy settings to use.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:5:"proxy";s:4:"type";s:6:"string";s:11:"description";s:102:"

    Accepts proxy credentials in the following format: proxy://user:pass@hostname:port

    ";}}s:11:"returnvalue";s:43:"

    A reference to the current instance.

    ";s:6:"source";s:85:"public function set_proxy($proxy) { $this->proxy = $proxy; return $this; }";s:8:"examples";a:1:{s:7:"example";a:4:{s:5:"title";s:48:"

    Set the proxy server to use for requests.

    ";s:11:"description";s:87:"

    Note: This method is inherited by all service-specific classes.

    ";s:4:"code";s:151:"// Adjust offset $sdb = new AmazonSDB(); $sdb->set_proxy('proxy://user:pass@hostname:port'); // Test if the value was set var_dump($sdb->proxy);";s:6:"result";s:44:"string(31) "proxy://user:pass@hostname:port"";}}}i:95;a:7:{s:4:"name";s:10:"set_region";s:8:"modifier";s:6:"public";s:11:"description";s:239:"

    Sets the region to use for subsequent Amazon S3 operations. This will also reset any prior use of enable_path_style().

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"region";s:4:"type";s:6:"string";s:11:"description";s:169:"

    The region to use for subsequent Amazon S3 operations. For a complete list of REGION constants, see the AmazonS3 Constants page in the API reference.

    ";}}s:11:"returnvalue";s:43:"

    A reference to the current instance.

    ";s:6:"source";s:554:"public function set_region($region) { // @codeCoverageIgnoreStart $this->set_hostname($region); switch ($region) { case self::REGION_US_E1: // Northern Virginia $this->enable_path_style(false); break; case self::REGION_EU_W1: // Ireland $this->enable_path_style(); // Always use path-style access for EU endpoint. break; default: $this->enable_path_style(false); break; } // @codeCoverageIgnoreEnd return $this; }";s:7:"related";a:1:{s:6:"method";a:3:{i:0;s:133:"enable_path_style()";i:1;s:145:"get_canonical_user_id()";i:2;s:109:"set_vhost()";}}}i:96;a:8:{s:4:"name";s:17:"set_request_class";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:276:"

    Set a custom class for this functionality. Use this method when extending/overriding existing classes with new functionality.

    The replacement class must extend from CFRequest.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:5:"class";s:4:"type";s:6:"string";s:11:"description";s:63:"

    The name of the new class to use for this functionality.

    ";}}s:11:"returnvalue";a:0:{}s:6:"source";s:115:"public function set_request_class($class = 'CFRequest') { $this->request_class = $class; return $this; }";s:8:"examples";a:1:{s:7:"example";a:4:{s:5:"title";s:51:"

    Set the request class to use in the toolkit.

    ";s:11:"description";s:158:"

    The new request class must extend from CFRequest.

    Note: This method is inherited by all service-specific classes.

    ";s:4:"code";s:310:"// Custom class to extend RequestCore class TestRequestCore extends RequestCore { public function test_method() { return true; } } // Instantiate class and set new class $sdb = new AmazonSDB(); $sdb->set_request_class('TestRequestCore'); // Test if the value was set var_dump($sdb->request_class);";s:6:"result";s:28:"string(15) "TestRequestCore"";}}}i:97;a:8:{s:4:"name";s:19:"set_resource_prefix";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:117:"

    Set the resource prefix to use. This method is useful for alternate services that are API-compatible with AWS.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"prefix";s:4:"type";s:6:"string";s:11:"description";s:97:"

    An alternate prefix to prepend to the resource path. Useful for mock or test applications.

    ";}}s:11:"returnvalue";s:43:"

    A reference to the current instance.

    ";s:6:"source";s:107:"public function set_resource_prefix($prefix) { $this->resource_prefix = $prefix; return $this; }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:46:"

    Configure hostname and resource prefix.

    ";s:4:"code";s:316:"// Instantiate the class $ec2 = new AmazonEC2(); // Point to the new endpoint $ec2->set_hostname('localhost', '3000'); $ec2->set_resource_prefix('/services/mock'); $ec2->allow_hostname_override(false); // Describe images $response = $ec2->describe_images(); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}}i:98;a:8:{s:4:"name";s:18:"set_response_class";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:279:"

    Set a custom class for this functionality. Use this method when extending/overriding existing classes with new functionality.

    The replacement class must extend from CFResponse.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:5:"class";s:4:"type";s:6:"string";s:11:"description";s:63:"

    The name of the new class to use for this functionality.

    ";}}s:11:"returnvalue";s:43:"

    A reference to the current instance.

    ";s:6:"source";s:118:"public function set_response_class($class = 'CFResponse') { $this->response_class = $class; return $this; }";s:8:"examples";a:1:{s:7:"example";a:4:{s:5:"title";s:52:"

    Set the response class to use in the toolkit.

    ";s:11:"description";s:160:"

    The new response class must extend from CFResponse.

    Note: This method is inherited by all service-specific classes.

    ";s:4:"code";s:316:"// Custom class to extend ResponseCore class TestResponseCore extends ResponseCore { public function test_method() { return true; } } // Instantiate class and set new class $sdb = new AmazonSDB(); $sdb->set_response_class('TestResponseCore'); // Test if the value was set var_dump($sdb->response_class);";s:6:"result";s:29:"string(16) "TestResponseCore"";}}}i:99;a:8:{s:4:"name";s:19:"set_utilities_class";s:8:"modifier";s:6:"public";s:11:"inheritance";a:1:{s:5:"class";a:1:{s:4:"name";s:9:"CFRuntime";}}s:11:"description";s:282:"

    Set a custom class for this functionality. Use this method when extending/overriding existing classes with new functionality.

    The replacement class must extend from CFUtilities.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:5:"class";s:4:"type";s:6:"string";s:11:"description";s:63:"

    The name of the new class to use for this functionality.

    ";}}s:11:"returnvalue";s:43:"

    A reference to the current instance.

    ";s:6:"source";s:175:"public function set_utilities_class($class = 'CFUtilities') { $this->utilities_class = $class; $this->util = new $this->utilities_class(); return $this; }";s:8:"examples";a:1:{s:7:"example";a:4:{s:5:"title";s:53:"

    Set the utilities class to use in the toolkit.

    ";s:11:"description";s:162:"

    The new utilities class must extend from CFUtilities.

    Note: This method is inherited by all service-specific classes.

    ";s:4:"code";s:317:"// Custom class to extend CFUtilities class TestUtilities extends CFUtilities { public function test_method() { return true; } } // Instantiate class and set new class $sdb = new AmazonSDB(); $sdb->set_utilities_class('TestUtilities'); // Test if the value was set var_dump($sdb->util->test_method());";s:6:"result";s:10:"bool(true)";}}}i:100;a:9:{s:4:"name";s:9:"set_vhost";s:8:"modifier";s:6:"public";s:11:"description";s:104:"

    Sets the virtual host to use in place of the default bucket.s3.amazonaws.com domain.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:5:"vhost";s:4:"type";s:6:"string";s:11:"description";s:99:"

    The virtual host to use in place of the default bucket.s3.amazonaws.com domain.

    ";}}s:11:"returnvalue";s:43:"

    A reference to the current instance.

    ";s:6:"source";s:85:"public function set_vhost($vhost) { $this->vhost = $vhost; return $this; }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:52:"

    Configure a virtual host to use for requests.

    ";s:4:"code";s:168:"// Instantiate the class $s3 = new AmazonS3(); $s3->set_vhost('cname.example.com'); $response = $s3->list_buckets(); // Success? var_dump($response->isOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:3:{i:0;s:133:"enable_path_style()";i:1;s:145:"get_canonical_user_id()";i:2;s:112:"set_region()";}}s:7:"seealso";a:1:{s:4:"link";s:114:"Virtual Hosting of Buckets";}}i:101;a:9:{s:4:"name";s:13:"update_object";s:8:"modifier";s:6:"public";s:11:"description";s:302:"

    Updates an Amazon S3 object with new headers or other metadata. To replace the content of the specified Amazon S3 object, call create_object() with the same bucket and file name parameters.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:3:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:60:"

    The name of the bucket that contains the source file.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:52:"

    The source file name that you want to update.

    ";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:1561:"

    An associative array of parameters that can have the following keys:

    ";}}}s:11:"returnvalue";s:149:"

    A CFResponse object containing a parsed HTTP response.

    ";s:6:"source";s:1057:"public function update_object($bucket, $filename, $opt = null) { if (!$opt) $opt = array(); $opt['metadataDirective'] = 'REPLACE'; // Retrieve the original metadata if ($metadata = $this->get_object_metadata($bucket, $filename)) { if (isset($metadata['ACL'])) { $opt['acl'] = isset($opt['acl']) ? $opt['acl'] : $metadata['ACL']; } if (isset($metadata['StorageClass'])) { $opt['headers']['x-amz-storage-class'] = $metadata['StorageClass']; } if (isset($metadata['ContentType'])) { $opt['headers']['Content-Type'] = $metadata['ContentType']; } } // Remove a header unset($metadata['Headers']['date']); // Merge headers $opt['headers'] = array_merge($opt['headers'], $metadata['Headers']); // Authenticate to S3 return $this->copy_object( array('bucket' => $bucket, 'filename' => $filename), array('bucket' => $bucket, 'filename' => $filename), $opt ); }";s:8:"examples";a:1:{s:7:"example";a:3:{s:5:"title";s:24:"

    Update an object.

    ";s:4:"code";s:608:"// Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); $headers = $s3->get_object_headers($bucket, 'test1.txt'); var_dump($headers->header['content-type']); $response = $s3->update_object($bucket, 'test1.txt', array( 'acl' => AmazonS3::ACL_PUBLIC, 'headers' => array( 'Content-Encoding' => 'UTF-8' ), 'meta' => array( 'Cache-Control' => 'Public', 'Max-Age' => '604800', ), )); var_dump($response->isOK()); sleep(2); $headers = $s3->get_object_headers($bucket, 'test1.txt'); var_dump($headers->header['content-type']);";s:6:"result";s:58:"string(10) "text/plain" bool(true) string(10) "text/plain"";}}s:7:"related";a:1:{s:6:"method";a:11:{i:0;s:115:"copy_object()";i:1;s:121:"create_object()";i:2;s:121:"delete_object()";i:3;s:112:"get_object()";i:4;s:124:"get_object_acl()";i:5;s:139:"get_object_filesize()";i:6;s:136:"get_object_headers()";i:7;s:127:"get_object_list()";i:8;s:130:"if_object_exists()";i:9;s:118:"list_objects()";i:10;s:124:"set_object_acl()";}}s:7:"seealso";a:1:{s:4:"link";s:117:"Copying Amazon S3 Objects";}}i:102;a:8:{s:4:"name";s:11:"upload_part";s:8:"modifier";s:6:"public";s:11:"description";s:432:"

    Uploads a single part of a multipart upload. The part size cannot be smaller than 5 MB or larger than 5 TB. A multipart upload can have no more than 10,000 parts.

    Amazon S3 charges for storage as well as requests to the service. Smaller part sizes (and more requests) allow for faster failures and better upload reliability. Larger part sizes (and fewer requests) costs slightly less but has lower upload reliability.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{i:0;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:37:"

    The name of the bucket to use.

    ";}i:1;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:8:"filename";s:4:"type";s:6:"string";s:11:"description";s:36:"

    The file name for the object.

    ";}i:2;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:9:"upload_id";s:4:"type";s:6:"string";s:11:"description";s:284:"

    The upload ID identifying the multipart upload whose parts are being listed. The upload ID is retrieved from a call to initiate_multipart_upload().

    ";}i:3;a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"opt";}s:4:"name";s:3:"opt";s:4:"type";s:5:"array";s:11:"description";s:2397:"

    An associative array of parameters that can have the following keys:

    ";}}}s:11:"returnvalue";s:149:"

    A CFResponse object containing a parsed HTTP response.

    ";s:6:"source";s:1144:"public function upload_part($bucket, $filename, $upload_id, $opt = null) { if (!$opt) $opt = array(); // Add this to our request $opt['verb'] = 'PUT'; $opt['resource'] = $filename; $opt['uploadId'] = $upload_id; if (!isset($opt['fileUpload']) || !isset($opt['partNumber'])) { throw new S3_Exception('The `fileUpload` and `partNumber` options are both required in ' . __FUNCTION__ . '().'); } // Handle expectation. Can also be passed as an HTTP header. if (isset($opt['expect'])) { $opt['headers']['Expect'] = $opt['expect']; unset($opt['expect']); } // Handle content length. Can also be passed as an HTTP header. if (isset($opt['length'])) { $opt['headers']['Content-Length'] = $opt['length']; unset($opt['length']); } // Handle content md5. Can also be passed as an HTTP header. if (isset($opt['md5'])) { $opt['headers']['Content-MD5'] = $opt['md5']; unset($opt['md5']); } $opt['headers']['Expect'] = '100-continue'; // Authenticate to S3 return $this->authenticate($bucket, $opt); }";s:8:"examples";a:1:{s:7:"example";a:4:{s:5:"title";s:42:"

    Upload parts of a file in sequence.

    ";s:11:"description";s:236:"
    1. Initiate a new multipart upload using initiate_multipart_upload().
    2. Upload the parts using upload_part().
    3. Complete the upload using complete_multipart_upload().
    ";s:4:"code";s:785:"// Define a mebibyte define('MB', 1024 * 1024); // Instantiate the class $s3 = new AmazonS3(); $bucket = 'my-bucket' . strtolower($s3->key); // Get the list of pieces $parts = $s3->get_multipart_counts(filesize('movie.mp4'), 50*MB); // Queue batch requests foreach ($parts as $i => $part) { $s3->batch()->upload_part($bucket, 'movie.mp4', 'f_JM_zwhU37pj1tS.F2BXVWUJtGcNso1WEikZImjrBCYUbUQwNnOUwX.Z00O1QmKQXAjqQBD4BVZRGmEXAMPLE--', array( 'expect' => '100-continue', 'fileUpload' => 'movie.mp4', 'partNumber' => ($i + 1), 'seekTo' => (integer) $part['seekTo'], 'length' => (integer) $part['length'], )); } // Send batch requests $batch_responses = $s3->batch()->send(); // Success? var_dump($batch_responses->areOK());";s:6:"result";s:10:"bool(true)";}}s:7:"related";a:1:{s:6:"method";a:8:{i:0;s:148:"abort_multipart_upload()";i:1;s:175:"abort_multipart_uploads_by_date()";i:2;s:157:"complete_multipart_upload()";i:3;s:133:"create_mpu_object()";i:4;s:142:"get_multipart_counts()";i:5;s:157:"initiate_multipart_upload()";i:6;s:148:"list_multipart_uploads()";i:7;s:112:"list_parts()";}}}i:103;a:7:{s:4:"name";s:26:"validate_bucketname_create";s:8:"modifier";s:6:"public";s:11:"description";s:159:"

    Validates whether or not the specified Amazon S3 bucket name is valid for DNS-style access. This method is leveraged by any method that creates buckets.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:42:"

    The name of the bucket to validate.

    ";}}s:11:"returnvalue";s:223:"

    Whether or not the specified Amazon S3 bucket name is valid for DNS-style access. A value of true means that the bucket name is valid. A value of false means that the bucket name is invalid.

    ";s:6:"source";s:1240:"public function validate_bucketname_create($bucket) { // list_buckets() uses this. Let it pass. if ($bucket === '') return true; if ( ($bucket === null || $bucket === false) || // Must not be null or false preg_match('/[^(a-z0-9\-\.)]/', $bucket) || // Must be in the lowercase Roman alphabet, period or hyphen !preg_match('/^([a-z]|\d)/', $bucket) || // Must start with a number or letter !(strlen($bucket) >= 3 && strlen($bucket) <= 63) || // Must be between 3 and 63 characters long (strpos($bucket, '..') !== false) || // Bucket names cannot contain two, adjacent periods (strpos($bucket, '-.') !== false) || // Bucket names cannot contain dashes next to periods (strpos($bucket, '.-') !== false) || // Bucket names cannot contain dashes next to periods preg_match('/(-|\.)$/', $bucket) || // Bucket names should not end with a dash or period preg_match('/^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/', $bucket) // Must not be formatted as an IP address ) return false; return true; }";s:7:"related";a:1:{s:6:"method";s:163:"validate_bucketname_support()";}}i:104;a:7:{s:4:"name";s:27:"validate_bucketname_support";s:8:"modifier";s:6:"public";s:11:"description";s:163:"

    Validates whether or not the specified Amazon S3 bucket name is valid for path-style access. This method is leveraged by any method that reads from buckets.

    ";s:10:"parameters";a:1:{s:9:"parameter";a:4:{s:11:"@attributes";a:1:{s:6:"choice";s:3:"req";}s:4:"name";s:6:"bucket";s:4:"type";s:6:"string";s:11:"description";s:42:"

    The name of the bucket to validate.

    ";}}s:11:"returnvalue";s:182:"

    Whether or not the bucket name is valid. A value of true means that the bucket name is valid. A value of false means that the bucket name is invalid.

    ";s:6:"source";s:774:"public function validate_bucketname_support($bucket) { // list_buckets() uses this. Let it pass. if ($bucket === '') return true; // Validate if ( ($bucket === null || $bucket === false) || // Must not be null or false preg_match('/[^(a-z0-9_\-\.)]/i', $bucket) || // Must be in the Roman alphabet, period, hyphen or underscore !preg_match('/^([a-z]|\d)/i', $bucket) || // Must start with a number or letter !(strlen($bucket) >= 3 && strlen($bucket) <= 255) || // Must be between 3 and 255 characters long preg_match('/^(?:[0-9]{1,3}\.){3}[0-9]{1,3}$/', $bucket) // Must not be formatted as an IP address ) return false; return true; }";s:7:"related";a:1:{s:6:"method";s:160:"validate_bucketname_create()";}}}}s:9:"constants";a:2:{s:11:"@attributes";a:1:{s:5:"count";s:2:"60";}s:8:"constant";a:60:{i:0;a:2:{s:4:"name";s:13:"ACL_AUTH_READ";s:5:"value";s:18:"authenticated-read";}i:1;a:2:{s:4:"name";s:8:"ACL_OPEN";s:5:"value";s:17:"public-read-write";}i:2;a:2:{s:4:"name";s:22:"ACL_OWNER_FULL_CONTROL";s:5:"value";s:25:"bucket-owner-full-control";}i:3;a:2:{s:4:"name";s:14:"ACL_OWNER_READ";s:5:"value";s:17:"bucket-owner-read";}i:4;a:2:{s:4:"name";s:11:"ACL_PRIVATE";s:5:"value";s:7:"private";}i:5;a:2:{s:4:"name";s:10:"ACL_PUBLIC";s:5:"value";s:11:"public-read";}i:6;a:2:{s:4:"name";s:5:"BUILD";s:5:"value";s:14:"20130314130000";}i:7;a:2:{s:4:"name";s:11:"DEFAULT_URL";s:5:"value";s:16:"s3.amazonaws.com";}i:8;a:2:{s:4:"name";s:18:"GRANT_FULL_CONTROL";s:5:"value";s:12:"FULL_CONTROL";}i:9;a:2:{s:4:"name";s:10:"GRANT_READ";s:5:"value";s:4:"READ";}i:10;a:2:{s:4:"name";s:14:"GRANT_READ_ACP";s:5:"value";s:8:"READ_ACP";}i:11;a:2:{s:4:"name";s:11:"GRANT_WRITE";s:5:"value";s:5:"WRITE";}i:12;a:2:{s:4:"name";s:15:"GRANT_WRITE_ACP";s:5:"value";s:9:"WRITE_ACP";}i:13;a:2:{s:4:"name";s:4:"NAME";s:5:"value";s:11:"aws-sdk-php";}i:14;a:2:{s:4:"name";s:8:"PCRE_ALL";s:5:"value";s:5:"/.*/i";}i:15;a:2:{s:4:"name";s:15:"REGION_APAC_NE1";s:5:"value";s:31:"s3-ap-northeast-1.amazonaws.com";}i:16;a:2:{s:4:"name";s:23:"REGION_APAC_NE1_WEBSITE";s:5:"value";s:39:"s3-website-ap-northeast-1.amazonaws.com";}i:17;a:2:{s:4:"name";s:15:"REGION_APAC_SE1";s:5:"value";s:31:"s3-ap-southeast-1.amazonaws.com";}i:18;a:2:{s:4:"name";s:23:"REGION_APAC_SE1_WEBSITE";s:5:"value";s:39:"s3-website-ap-southeast-1.amazonaws.com";}i:19;a:2:{s:4:"name";s:15:"REGION_APAC_SE2";s:5:"value";s:31:"s3-ap-southeast-2.amazonaws.com";}i:20;a:2:{s:4:"name";s:23:"REGION_APAC_SE2_WEBSITE";s:5:"value";s:39:"s3-website-ap-southeast-2.amazonaws.com";}i:21;a:2:{s:4:"name";s:17:"REGION_CALIFORNIA";s:5:"value";s:26:"s3-us-west-1.amazonaws.com";}i:22;a:2:{s:4:"name";s:25:"REGION_CALIFORNIA_WEBSITE";s:5:"value";s:34:"s3-website-us-west-1.amazonaws.com";}i:23;a:2:{s:4:"name";s:12:"REGION_EU_W1";s:5:"value";s:26:"s3-eu-west-1.amazonaws.com";}i:24;a:2:{s:4:"name";s:20:"REGION_EU_W1_WEBSITE";s:5:"value";s:34:"s3-website-eu-west-1.amazonaws.com";}i:25;a:2:{s:4:"name";s:14:"REGION_IRELAND";s:5:"value";s:26:"s3-eu-west-1.amazonaws.com";}i:26;a:2:{s:4:"name";s:22:"REGION_IRELAND_WEBSITE";s:5:"value";s:34:"s3-website-eu-west-1.amazonaws.com";}i:27;a:2:{s:4:"name";s:13:"REGION_OREGON";s:5:"value";s:26:"s3-us-west-2.amazonaws.com";}i:28;a:2:{s:4:"name";s:21:"REGION_OREGON_WEBSITE";s:5:"value";s:34:"s3-website-us-west-2.amazonaws.com";}i:29;a:2:{s:4:"name";s:16:"REGION_SAO_PAULO";s:5:"value";s:26:"s3-sa-east-1.amazonaws.com";}i:30;a:2:{s:4:"name";s:24:"REGION_SAO_PAULO_WEBSITE";s:5:"value";s:34:"s3-website-sa-east-1.amazonaws.com";}i:31;a:2:{s:4:"name";s:12:"REGION_SA_E1";s:5:"value";s:26:"s3-sa-east-1.amazonaws.com";}i:32;a:2:{s:4:"name";s:20:"REGION_SA_E1_WEBSITE";s:5:"value";s:34:"s3-website-sa-east-1.amazonaws.com";}i:33;a:2:{s:4:"name";s:16:"REGION_SINGAPORE";s:5:"value";s:31:"s3-ap-southeast-1.amazonaws.com";}i:34;a:2:{s:4:"name";s:24:"REGION_SINGAPORE_WEBSITE";s:5:"value";s:39:"s3-website-ap-southeast-1.amazonaws.com";}i:35;a:2:{s:4:"name";s:13:"REGION_SYDNEY";s:5:"value";s:31:"s3-ap-southeast-2.amazonaws.com";}i:36;a:2:{s:4:"name";s:21:"REGION_SYDNEY_WEBSITE";s:5:"value";s:39:"s3-website-ap-southeast-2.amazonaws.com";}i:37;a:2:{s:4:"name";s:12:"REGION_TOKYO";s:5:"value";s:31:"s3-ap-northeast-1.amazonaws.com";}i:38;a:2:{s:4:"name";s:20:"REGION_TOKYO_WEBSITE";s:5:"value";s:39:"s3-website-ap-northeast-1.amazonaws.com";}i:39;a:2:{s:4:"name";s:12:"REGION_US_E1";s:5:"value";s:16:"s3.amazonaws.com";}i:40;a:2:{s:4:"name";s:20:"REGION_US_E1_WEBSITE";s:5:"value";s:34:"s3-website-us-east-1.amazonaws.com";}i:41;a:2:{s:4:"name";s:14:"REGION_US_GOV1";s:5:"value";s:30:"s3-us-gov-west-1.amazonaws.com";}i:42;a:2:{s:4:"name";s:19:"REGION_US_GOV1_FIPS";s:5:"value";s:35:"s3-fips-us-gov-west-1.amazonaws.com";}i:43;a:2:{s:4:"name";s:22:"REGION_US_GOV1_WEBSITE";s:5:"value";s:38:"s3-website-us-gov-west-1.amazonaws.com";}i:44;a:2:{s:4:"name";s:18:"REGION_US_STANDARD";s:5:"value";s:16:"s3.amazonaws.com";}i:45;a:2:{s:4:"name";s:26:"REGION_US_STANDARD_WEBSITE";s:5:"value";s:34:"s3-website-us-east-1.amazonaws.com";}i:46;a:2:{s:4:"name";s:12:"REGION_US_W1";s:5:"value";s:26:"s3-us-west-1.amazonaws.com";}i:47;a:2:{s:4:"name";s:20:"REGION_US_W1_WEBSITE";s:5:"value";s:34:"s3-website-us-west-1.amazonaws.com";}i:48;a:2:{s:4:"name";s:12:"REGION_US_W2";s:5:"value";s:26:"s3-us-west-2.amazonaws.com";}i:49;a:2:{s:4:"name";s:20:"REGION_US_W2_WEBSITE";s:5:"value";s:34:"s3-website-us-west-2.amazonaws.com";}i:50;a:2:{s:4:"name";s:15:"REGION_VIRGINIA";s:5:"value";s:16:"s3.amazonaws.com";}i:51;a:2:{s:4:"name";s:23:"REGION_VIRGINIA_WEBSITE";s:5:"value";s:34:"s3-website-us-east-1.amazonaws.com";}i:52;a:2:{s:4:"name";s:15:"STORAGE_GLACIER";s:5:"value";s:7:"GLACIER";}i:53;a:2:{s:4:"name";s:15:"STORAGE_REDUCED";s:5:"value";s:18:"REDUCED_REDUNDANCY";}i:54;a:2:{s:4:"name";s:16:"STORAGE_STANDARD";s:5:"value";s:8:"STANDARD";}i:55;a:2:{s:4:"name";s:9:"USERAGENT";s:5:"value";s:65:"aws-sdk-php/1.6.2 PHP/5.4.9 curl/7.15.5 openssl/0.9.8e-fips-rhel5";}i:56;a:2:{s:4:"name";s:9:"USERS_ALL";s:5:"value";s:47:"http://acs.amazonaws.com/groups/global/AllUsers";}i:57;a:2:{s:4:"name";s:10:"USERS_AUTH";s:5:"value";s:57:"http://acs.amazonaws.com/groups/global/AuthenticatedUsers";}i:58;a:2:{s:4:"name";s:13:"USERS_LOGGING";s:5:"value";s:46:"http://acs.amazonaws.com/groups/s3/LogDelivery";}i:59;a:2:{s:4:"name";s:7:"VERSION";s:5:"value";s:5:"1.6.2";}}}s:10:"properties";a:2:{s:11:"@attributes";a:1:{s:5:"count";s:2:"56";}s:8:"property";a:56:{i:0;a:4:{s:4:"name";s:11:"api_version";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:33:"

    The supported API version.

    ";}i:1;a:4:{s:4:"name";s:10:"auth_class";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:39:"

    The authentication class to use.

    ";}i:2;a:4:{s:4:"name";s:10:"auth_token";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:39:"

    The Amazon Authentication Token.

    ";}i:3;a:3:{s:4:"name";s:12:"base_acp_xml";s:8:"modifier";s:6:"public";s:11:"description";s:70:"

    The base XML elements to use for access control policy methods.

    ";}i:4;a:3:{s:4:"name";s:24:"base_location_constraint";s:8:"modifier";s:6:"public";s:11:"description";s:68:"

    The base XML elements to use for creating buckets in regions.

    ";}i:5;a:3:{s:4:"name";s:16:"base_logging_xml";s:8:"modifier";s:6:"public";s:11:"description";s:56:"

    The base XML elements to use for logging methods.

    ";}i:6;a:3:{s:4:"name";s:21:"base_notification_xml";s:8:"modifier";s:6:"public";s:11:"description";s:54:"

    The base XML elements to use for notifications.

    ";}i:7;a:3:{s:4:"name";s:19:"base_versioning_xml";s:8:"modifier";s:6:"public";s:11:"description";s:51:"

    The base XML elements to use for versioning.

    ";}i:8;a:5:{s:4:"name";s:11:"batch_class";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"initializer";a:1:{s:11:"@attributes";a:2:{s:4:"type";s:6:"string";s:5:"value";s:14:"CFBatchRequest";}}s:11:"description";s:185:"

    The default class to use for handling batch requests (defaults to CFBatchRequest).

    ";}i:9;a:4:{s:4:"name";s:12:"batch_object";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:53:"

    The current instantiated batch request object.

    ";}i:10;a:3:{s:4:"name";s:18:"bucket_tagging_xml";s:8:"modifier";s:6:"public";s:11:"description";s:55:"

    The base XML elements to use for bucket tagging.

    ";}i:11;a:4:{s:4:"name";s:11:"cache_class";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:32:"

    The caching class to use.

    ";}i:12;a:4:{s:4:"name";s:14:"cache_compress";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:38:"

    The state of cache compression.

    ";}i:13;a:4:{s:4:"name";s:13:"cache_expires";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:49:"

    When the cache should be considered stale.

    ";}i:14;a:4:{s:4:"name";s:14:"cache_location";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:35:"

    The caching location to use.

    ";}i:15;a:4:{s:4:"name";s:12:"cache_object";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:45:"

    The current instantiated cache object.

    ";}i:16;a:3:{s:4:"name";s:16:"complete_mpu_xml";s:8:"modifier";s:6:"public";s:11:"description";s:70:"

    The base XML elements to use for completing a multipart upload.

    ";}i:17;a:3:{s:4:"name";s:15:"cors_config_xml";s:8:"modifier";s:6:"public";s:11:"description";s:53:"

    The base XML elements to use for CORS support.

    ";}i:18;a:4:{s:4:"name";s:11:"credentials";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:49:"

    The credentials to use for authentication.

    ";}i:19;a:4:{s:4:"name";s:10:"debug_mode";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:43:"

    The state of the debug mode setting.

    ";}i:20;a:4:{s:4:"name";s:12:"delete_cache";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:47:"

    The state of the cache deletion setting.

    ";}i:21;a:4:{s:4:"name";s:8:"hostname";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:45:"

    The alternate hostname to use, if any.

    ";}i:22;a:4:{s:4:"name";s:21:"internal_batch_object";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:56:"

    The internally instantiated batch request object.

    ";}i:23;a:4:{s:4:"name";s:3:"key";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:26:"

    The Amazon API Key.

    ";}i:24;a:5:{s:4:"name";s:11:"max_retries";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"initializer";a:1:{s:11:"@attributes";a:2:{s:4:"type";s:7:"integer";s:5:"value";s:1:"3";}}s:11:"description";s:52:"

    The number of times to retry failed requests.

    ";}i:25;a:3:{s:4:"name";s:23:"multi_object_delete_xml";s:8:"modifier";s:6:"public";s:11:"description";s:68:"

    The base XML elements to use for multi-object delete support.

    ";}i:26;a:3:{s:4:"name";s:21:"object_expiration_xml";s:8:"modifier";s:6:"public";s:11:"description";s:66:"

    The base XML elements to use for object expiration support.

    ";}i:27;a:4:{s:4:"name";s:9:"operation";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:32:"

    The operation to execute.

    ";}i:28;a:4:{s:4:"name";s:16:"operation_prefix";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:58:"

    The string prefix to prepend to the operation name.

    ";}i:29;a:5:{s:4:"name";s:17:"override_hostname";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"initializer";a:1:{s:11:"@attributes";a:2:{s:4:"type";s:7:"boolean";s:5:"value";s:4:"true";}}s:11:"description";s:184:"

    The state of the capability to override the hostname with set_hostname().

    ";}i:30;a:5:{s:4:"name";s:18:"parse_the_response";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"initializer";a:1:{s:11:"@attributes";a:2:{s:4:"type";s:7:"boolean";s:5:"value";s:4:"true";}}s:11:"description";s:65:"

    The state of whether the response should be parsed or not.

    ";}i:31;a:5:{s:4:"name";s:12:"parser_class";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"initializer";a:1:{s:11:"@attributes";a:2:{s:4:"type";s:6:"string";s:5:"value";s:11:"CFSimpleXML";}}s:11:"description";s:164:"

    The default class to use for parsing XML (defaults to CFSimpleXML).

    ";}i:32;a:3:{s:4:"name";s:10:"path_style";s:8:"modifier";s:6:"public";s:11:"description";s:38:"

    The DNS vs. Path-style setting.

    ";}i:33;a:4:{s:4:"name";s:7:"payload";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:27:"

    The payload to send.

    ";}i:34;a:4:{s:4:"name";s:11:"port_number";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:48:"

    The alternate port number to use, if any.

    ";}i:35;a:4:{s:4:"name";s:5:"proxy";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:39:"

    The proxy to use for connecting.

    ";}i:36;a:4:{s:4:"name";s:9:"redirects";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:54:"

    The number of times a request has been retried.

    ";}i:37;a:4:{s:4:"name";s:34:"registered_streaming_read_callback";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:77:"

    The user-defined callback function to call when a stream is read from.

    ";}i:38;a:4:{s:4:"name";s:35:"registered_streaming_write_callback";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:78:"

    The user-defined callback function to call when a stream is written to.

    ";}i:39;a:5:{s:4:"name";s:13:"request_class";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"initializer";a:1:{s:11:"@attributes";a:2:{s:4:"type";s:6:"string";s:5:"value";s:9:"CFRequest";}}s:11:"description";s:160:"

    The default class to use for HTTP requests (defaults to CFRequest).

    ";}i:40;a:3:{s:4:"name";s:11:"request_url";s:8:"modifier";s:6:"public";s:11:"description";s:23:"

    The request URL.

    ";}i:41;a:4:{s:4:"name";s:15:"resource_prefix";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:52:"

    The alternate resource prefix to use, if any.

    ";}i:42;a:5:{s:4:"name";s:14:"response_class";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"initializer";a:1:{s:11:"@attributes";a:2:{s:4:"type";s:6:"string";s:5:"value";s:10:"CFResponse";}}s:11:"description";s:164:"

    The default class to use for HTTP responses (defaults to CFResponse).

    ";}i:43;a:3:{s:4:"name";s:19:"restore_request_xml";s:8:"modifier";s:6:"public";s:11:"description";s:61:"

    The base XML elements to use for restoration requests.

    ";}i:44;a:4:{s:4:"name";s:10:"secret_key";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:33:"

    The Amazon API Secret Key.

    ";}i:45;a:4:{s:4:"name";s:7:"service";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:49:"

    An identifier for the current AWS service.

    ";}i:46;a:5:{s:4:"name";s:16:"ssl_verification";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"initializer";a:1:{s:11:"@attributes";a:2:{s:4:"type";s:7:"boolean";s:5:"value";s:4:"true";}}s:11:"description";s:49:"

    The state of SSL certificate verification.

    ";}i:47;a:3:{s:4:"name";s:16:"temporary_prefix";s:8:"modifier";s:6:"public";s:11:"description";s:72:"

    The state of whether the prefix change is temporary or permanent.

    ";}i:48;a:5:{s:4:"name";s:13:"use_aws_query";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"initializer";a:1:{s:11:"@attributes";a:2:{s:4:"type";s:7:"boolean";s:5:"value";s:4:"true";}}s:11:"description";s:64:"

    The state of whether auth should be handled as AWS Query.

    ";}i:49;a:4:{s:4:"name";s:14:"use_batch_flow";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:37:"

    The state of batch flow usage.

    ";}i:50;a:4:{s:4:"name";s:14:"use_cache_flow";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:37:"

    The state of cache flow usage.

    ";}i:51;a:5:{s:4:"name";s:7:"use_ssl";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"initializer";a:1:{s:11:"@attributes";a:2:{s:4:"type";s:7:"boolean";s:5:"value";s:4:"true";}}s:11:"description";s:34:"

    The state of SSL/HTTPS use.

    ";}i:52;a:4:{s:4:"name";s:4:"util";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"description";s:40:"

    Handle for the utility functions.

    ";}i:53;a:5:{s:4:"name";s:15:"utilities_class";s:11:"inheritance";a:1:{s:5:"class";a:2:{s:4:"name";s:9:"CFRuntime";s:4:"file";s:13:"sdk.class.php";}}s:8:"modifier";s:6:"public";s:11:"initializer";a:1:{s:11:"@attributes";a:2:{s:4:"type";s:6:"string";s:5:"value";s:11:"CFUtilities";}}s:11:"description";s:162:"

    The default class to use for utilities (defaults to CFUtilities).

    ";}i:54;a:3:{s:4:"name";s:5:"vhost";s:8:"modifier";s:6:"public";s:11:"description";s:32:"

    The virtual host setting.

    ";}i:55;a:3:{s:4:"name";s:18:"website_config_xml";s:8:"modifier";s:6:"public";s:11:"description";s:56:"

    The base XML elements to use for website support.

    ";}}}}}