Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92615791
PhutilAWSS3Future.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 22, 01:51
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 01:51 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22471712
Attached To
rPHU libphutil
PhutilAWSS3Future.php
View Options
<?php
final
class
PhutilAWSS3Future
extends
PhutilAWSFuture
{
private
$bucket
;
public
function
getServiceName
()
{
return
's3'
;
}
public
function
setBucket
(
$bucket
)
{
$this
->
bucket
=
$bucket
;
return
$this
;
}
public
function
getBucket
()
{
return
$this
->
bucket
;
}
public
function
setParametersForGetObject
(
$key
)
{
$bucket
=
$this
->
getBucket
();
$this
->
setHTTPMethod
(
'GET'
);
$this
->
setPath
(
$bucket
.
'/'
.
$key
);
return
$this
;
}
public
function
setParametersForPutObject
(
$key
,
$value
)
{
$bucket
=
$this
->
getBucket
();
$this
->
setHTTPMethod
(
'PUT'
);
$this
->
setPath
(
$bucket
.
'/'
.
$key
);
$this
->
addHeader
(
'X-Amz-ACL'
,
'private'
);
$this
->
addHeader
(
'Content-Type'
,
'application/octet-stream'
);
$this
->
setData
(
$value
);
return
$this
;
}
public
function
setParametersForDeleteObject
(
$key
)
{
$bucket
=
$this
->
getBucket
();
$this
->
setHTTPMethod
(
'DELETE'
);
$this
->
setPath
(
$bucket
.
'/'
.
$key
);
return
$this
;
}
protected
function
didReceiveResult
(
$result
)
{
list
(
$status
,
$body
,
$headers
)
=
$result
;
if
(!
$status
->
isError
())
{
return
$body
;
}
if
(
$status
->
getStatusCode
()
===
404
)
{
return
null
;
}
return
parent
::
didReceiveResult
(
$result
);
}
}
Event Timeline
Log In to Comment