Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F103177906
DiffusionLookSoonConduitAPIMethod.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
Thu, Feb 27, 22:57
Size
1 KB
Mime Type
text/x-php
Expires
Sat, Mar 1, 22:57 (2 d)
Engine
blob
Format
Raw Data
Handle
24515074
Attached To
rPH Phabricator
DiffusionLookSoonConduitAPIMethod.php
View Options
<?php
final
class
DiffusionLookSoonConduitAPIMethod
extends
DiffusionConduitAPIMethod
{
public
function
getAPIMethodName
()
{
return
'diffusion.looksoon'
;
}
public
function
getMethodStatus
()
{
return
self
::
METHOD_STATUS_UNSTABLE
;
}
public
function
getMethodDescription
()
{
return
pht
(
'Advises Phabricator to look for new commits in a repository as soon '
.
'as possible. This advice is most useful if you have just pushed new '
.
'commits to that repository.'
);
}
protected
function
defineReturnType
()
{
return
'void'
;
}
protected
function
defineParamTypes
()
{
return
array
(
'callsigns'
=>
'required list<string>'
,
'urgency'
=>
'optional string'
,
);
}
protected
function
execute
(
ConduitAPIRequest
$request
)
{
// NOTE: The "urgency" parameter does nothing, it is just a hilarious joke
// which exemplifies the boundless clever wit of this project.
$callsigns
=
$request
->
getValue
(
'callsigns'
);
if
(!
$callsigns
)
{
return
null
;
}
$repositories
=
id
(
new
PhabricatorRepositoryQuery
())
->
setViewer
(
$request
->
getUser
())
->
withCallsigns
(
$callsigns
)
->
execute
();
foreach
(
$repositories
as
$repository
)
{
$repository
->
writeStatusMessage
(
PhabricatorRepositoryStatusMessage
::
TYPE_NEEDS_UPDATE
,
PhabricatorRepositoryStatusMessage
::
CODE_OKAY
);
}
return
null
;
}
}
Event Timeline
Log In to Comment