Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F950371
MacroCreateMemeConduitAPIMethod.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
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
,
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Jun 17, 2:04 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
224159
Default Alt Text
MacroCreateMemeConduitAPIMethod.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment