Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92291895
MacroCreateMemeConduitAPIMethod.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
Tue, Nov 19, 03:32
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Nov 21, 03:32 (2 d)
Engine
blob
Format
Raw Data
Handle
22414658
Attached To
rPH Phabricator
MacroCreateMemeConduitAPIMethod.php
View Options
<?php
final
class
MacroCreateMemeConduitAPIMethod
extends
MacroConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'macro.creatememe'
;
}
public
function
getMethodStatus
()
{
return
self
::
METHOD_STATUS_UNSTABLE
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Generate a meme.'
);
}
protected
function
defineParamTypes
()
{
return
array
(
'macroName'
=>
'string'
,
'upperText'
=>
'optional string'
,
'lowerText'
=>
'optional string'
,
);
}
protected
function
defineReturnType
()
{
return
'string'
;
}
protected
function
defineErrorTypes
()
{
return
array
(
'ERR-NOT-FOUND'
=>
pht
(
'Macro was not found.'
),
);
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
$user
=
$request
->
getUser
();
$macro_name
=
$request
->
getValue
(
'macroName'
);
$upper_text
=
$request
->
getValue
(
'upperText'
);
$lower_text
=
$request
->
getValue
(
'lowerText'
);
$uri
=
PhabricatorMacroMemeController
::
generateMacro
(
$user
,
$macro_name
,
$upper_text
,
$lower_text
);
if
(!
$uri
)
{
throw
new
ConduitException
(
'ERR-NOT-FOUND'
);
}
return
array
(
'uri'
=>
$uri
,
);
}
}
Event Timeline
Log In to Comment