Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F540047
DiffusionInternalCommitSearchConduitAPIMethod.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
DiffusionInternalCommitSearchConduitAPIMethod.php
View Options
<?php
final
class
DiffusionInternalCommitSearchConduitAPIMethod
extends
PhabricatorSearchEngineAPIMethod
{
public
function
getAPIMethodName
()
{
return
'internal.commit.search'
;
}
public
function
newSearchEngine
()
{
return
new
DiffusionInternalCommitSearchEngine
();
}
public
function
getMethodSummary
()
{
return
pht
(
'Read raw information about commits.'
);
}
protected
function
newConduitCallProxyClient
(
ConduitAPIRequest
$request
)
{
$viewer
=
$request
->
getViewer
();
$constraints
=
$request
->
getValue
(
'constraints'
);
if
(
is_array
(
$constraints
))
{
$repository_phids
=
idx
(
$constraints
,
'repositoryPHIDs'
);
}
else
{
$repository_phids
=
array
();
}
$repository_phid
=
null
;
if
(
is_array
(
$repository_phids
))
{
if
(
phutil_is_natural_list
(
$repository_phids
))
{
if
(
count
(
$repository_phids
)
===
1
)
{
$value
=
head
(
$repository_phids
);
if
(
is_string
(
$value
))
{
$repository_phid
=
$value
;
}
}
}
}
if
(
$repository_phid
===
null
)
{
throw
new
Exception
(
pht
(
'This internal method must be invoked with a "repositoryPHIDs" '
.
'constraint with exactly one value.'
));
}
$repository
=
id
(
new
PhabricatorRepositoryQuery
())
->
setViewer
(
$viewer
)
->
withPHIDs
(
array
(
$repository_phid
))
->
executeOne
();
if
(!
$repository
)
{
return
array
();
}
return
$repository
->
newConduitClientForRequest
(
$request
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 9:24 AM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
102137
Default Alt Text
DiffusionInternalCommitSearchConduitAPIMethod.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment