Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92620616
PhutilAWSS3DeleteManagementWorkflow.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, 03:06
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 03:06 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22471628
Attached To
rPHU libphutil
PhutilAWSS3DeleteManagementWorkflow.php
View Options
<?php
final
class
PhutilAWSS3DeleteManagementWorkflow
extends
PhutilAWSS3ManagementWorkflow
{
protected
function
didConstruct
()
{
$this
->
setName
(
'delete'
)
->
setExamples
(
'**delete** --key __key__'
)
->
setSynopsis
(
pht
(
'Delete an object from S3.'
))
->
setArguments
(
array_merge
(
$this
->
getAWSArguments
(),
$this
->
getAWSS3BucketArguments
(),
array
(
array
(
'name'
=>
'key'
,
'param'
=>
'key'
,
'help'
=>
pht
(
'Specify a key to delete.'
),
),
)));
}
public
function
execute
(
PhutilArgumentParser
$args
)
{
$key
=
$args
->
getArg
(
'key'
);
if
(!
strlen
(
$key
))
{
throw
new
PhutilArgumentUsageException
(
pht
(
'Specify an AWS S3 object key to access with --key.'
));
}
$future
=
$this
->
newAWSFuture
(
new
PhutilAWSS3Future
())
->
setParametersForDeleteObject
(
$key
);
$future
->
resolve
();
echo
tsprintf
(
"%s
\n
"
,
pht
(
'Deleted "%s".'
,
$key
));
return
0
;
}
}
Event Timeline
Log In to Comment