mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +01:00
Adding the Conduit query method.
Summary: T2154 Adding the Conduit query method implementation, and metadata to the phutil register library. Test Plan: Choose conduit.query on the web UI to see information about the method. Then, click the "Call Method" button and observe the method result. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D4550
This commit is contained in:
parent
117589c160
commit
bb175655ae
2 changed files with 43 additions and 0 deletions
|
@ -112,6 +112,7 @@ phutil_register_library_map(array(
|
|||
'ConduitAPI_conduit_connect_Method' => 'applications/conduit/method/ConduitAPI_conduit_connect_Method.php',
|
||||
'ConduitAPI_conduit_getcertificate_Method' => 'applications/conduit/method/ConduitAPI_conduit_getcertificate_Method.php',
|
||||
'ConduitAPI_conduit_ping_Method' => 'applications/conduit/method/ConduitAPI_conduit_ping_Method.php',
|
||||
'ConduitAPI_conduit_query_Method' => 'applications/conduit/method/ConduitAPI_conduit_query_Method.php',
|
||||
'ConduitAPI_daemon_launched_Method' => 'applications/daemon/conduit/ConduitAPI_daemon_launched_Method.php',
|
||||
'ConduitAPI_daemon_log_Method' => 'applications/daemon/conduit/ConduitAPI_daemon_log_Method.php',
|
||||
'ConduitAPI_daemon_setstatus_Method' => 'applications/daemon/conduit/ConduitAPI_daemon_setstatus_Method.php',
|
||||
|
@ -1550,6 +1551,7 @@ phutil_register_library_map(array(
|
|||
'ConduitAPI_conduit_connect_Method' => 'ConduitAPIMethod',
|
||||
'ConduitAPI_conduit_getcertificate_Method' => 'ConduitAPIMethod',
|
||||
'ConduitAPI_conduit_ping_Method' => 'ConduitAPIMethod',
|
||||
'ConduitAPI_conduit_query_Method' => 'ConduitAPIMethod',
|
||||
'ConduitAPI_daemon_launched_Method' => 'ConduitAPIMethod',
|
||||
'ConduitAPI_daemon_log_Method' => 'ConduitAPIMethod',
|
||||
'ConduitAPI_daemon_setstatus_Method' => 'ConduitAPIMethod',
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @group conduit
|
||||
*/
|
||||
final class ConduitAPI_conduit_query_Method extends ConduitAPIMethod {
|
||||
|
||||
public function getMethodDescription() {
|
||||
return "Returns the parameters of the Conduit methods.";
|
||||
}
|
||||
|
||||
public function defineParamTypes() {
|
||||
return array();
|
||||
}
|
||||
|
||||
public function defineReturnType() {
|
||||
return 'dict<dict>';
|
||||
}
|
||||
|
||||
public function defineErrorTypes() {
|
||||
return array();
|
||||
}
|
||||
|
||||
protected function execute(ConduitAPIRequest $request) {
|
||||
$classes = id(new PhutilSymbolLoader())
|
||||
->setAncestorClass('ConduitAPIMethod')
|
||||
->setType('class')
|
||||
->setConcreteOnly(true)
|
||||
->selectSymbolsWithoutLoading();
|
||||
|
||||
$names_to_params = array();
|
||||
foreach ($classes as $class) {
|
||||
$method_name = $class["name"];
|
||||
$obj = newv($method_name, array());
|
||||
$names_to_params[$this->getAPIMethodNameFromClassName($method_name)] =
|
||||
array("params" => $obj->defineParamTypes());
|
||||
}
|
||||
return $names_to_params;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue