Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F118850949
ConduitAPI_macro_creatememe_Method.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
Sun, Jun 22, 13:57
Size
1 KB
Mime Type
text/x-php
Expires
Tue, Jun 24, 13:57 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
26931701
Attached To
rPH Phabricator
ConduitAPI_macro_creatememe_Method.php
View Options
<?php
final
class
ConduitAPI_macro_creatememe_Method
extends
ConduitAPI_macro_Method
{
public
function
getMethodStatus
()
{
return
self
::
METHOD_STATUS_UNSTABLE
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Generate a meme.'
);
}
public
function
defineParamTypes
()
{
return
array
(
'macroName'
=>
'string'
,
'upperText'
=>
'optional string'
,
'lowerText'
=>
'optional string'
,
);
}
public
function
defineReturnType
()
{
return
'string'
;
}
public
function
defineErrorTypes
()
{
return
array
(
'ERR-NOT-FOUND'
=>
'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