1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-10 08:52:39 +01:00

Remove Conduit daemon methods

Summary: Fixes T1670. These are now unused.

Test Plan: Grepped for callsites.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T1670

Differential Revision: https://secure.phabricator.com/D6538
This commit is contained in:
epriestley 2013-07-23 12:10:21 -07:00
parent 794dc0151a
commit f9c6253665
4 changed files with 0 additions and 169 deletions

View file

@ -122,9 +122,6 @@ phutil_register_library_map(array(
'ConduitAPI_conpherence_querythread_Method' => 'applications/conpherence/conduit/ConduitAPI_conpherence_querythread_Method.php',
'ConduitAPI_conpherence_querytransaction_Method' => 'applications/conpherence/conduit/ConduitAPI_conpherence_querytransaction_Method.php',
'ConduitAPI_conpherence_updatethread_Method' => 'applications/conpherence/conduit/ConduitAPI_conpherence_updatethread_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',
'ConduitAPI_differential_Method' => 'applications/differential/conduit/ConduitAPI_differential_Method.php',
'ConduitAPI_differential_close_Method' => 'applications/differential/conduit/ConduitAPI_differential_close_Method.php',
'ConduitAPI_differential_createcomment_Method' => 'applications/differential/conduit/ConduitAPI_differential_createcomment_Method.php',
@ -2099,9 +2096,6 @@ phutil_register_library_map(array(
'ConduitAPI_conpherence_querythread_Method' => 'ConduitAPI_conpherence_Method',
'ConduitAPI_conpherence_querytransaction_Method' => 'ConduitAPI_conpherence_Method',
'ConduitAPI_conpherence_updatethread_Method' => 'ConduitAPI_conpherence_Method',
'ConduitAPI_daemon_launched_Method' => 'ConduitAPIMethod',
'ConduitAPI_daemon_log_Method' => 'ConduitAPIMethod',
'ConduitAPI_daemon_setstatus_Method' => 'ConduitAPIMethod',
'ConduitAPI_differential_Method' => 'ConduitAPIMethod',
'ConduitAPI_differential_close_Method' => 'ConduitAPIMethod',
'ConduitAPI_differential_createcomment_Method' => 'ConduitAPIMethod',

View file

@ -1,56 +0,0 @@
<?php
/**
* @group conduit
*/
final class ConduitAPI_daemon_launched_Method extends ConduitAPIMethod {
public function getMethodStatus() {
return self::METHOD_STATUS_DEPRECATED;
}
public function shouldRequireAuthentication() {
return false;
}
public function shouldAllowUnguardedWrites() {
return true;
}
public function getMethodDescription() {
return "Used by daemons to log run status.";
}
public function defineParamTypes() {
return array(
'daemon' => 'required string',
'host' => 'required string',
'pid' => 'required int',
'argv' => 'required string',
);
}
public function defineReturnType() {
return 'string';
}
public function defineErrorTypes() {
return array(
);
}
protected function execute(ConduitAPIRequest $request) {
$daemon_log = new PhabricatorDaemonLog();
$daemon_log->setDaemon($request->getValue('daemon'));
$daemon_log->setHost($request->getValue('host'));
$daemon_log->setPID($request->getValue('pid'));
$daemon_log->setStatus(PhabricatorDaemonLog::STATUS_RUNNING);
$daemon_log->setArgv(json_decode($request->getValue('argv')));
$daemon_log->save();
return $daemon_log->getID();
}
}

View file

@ -1,54 +0,0 @@
<?php
/**
* @group conduit
*/
final class ConduitAPI_daemon_log_Method extends ConduitAPIMethod {
public function getMethodStatus() {
return self::METHOD_STATUS_DEPRECATED;
}
public function shouldRequireAuthentication() {
return false;
}
public function shouldAllowUnguardedWrites() {
return true;
}
public function getMethodDescription() {
return "Used by daemons to log events.";
}
public function defineParamTypes() {
return array(
'daemonLogID' => 'required int',
'type' => 'required string',
'message' => 'optional string',
);
}
public function defineReturnType() {
return 'void';
}
public function defineErrorTypes() {
return array(
);
}
protected function execute(ConduitAPIRequest $request) {
$daemon_event = new PhabricatorDaemonLogEvent();
$daemon_event->setLogID($request->getValue('daemonLogID'));
$daemon_event->setLogType($request->getValue('type'));
$daemon_event->setMessage((string)$request->getValue('message'));
$daemon_event->setEpoch(time());
$daemon_event->save();
return;
}
}

View file

@ -1,53 +0,0 @@
<?php
/**
* @group conduit
*/
final class ConduitAPI_daemon_setstatus_Method extends ConduitAPIMethod {
public function getMethodStatus() {
return self::METHOD_STATUS_DEPRECATED;
}
public function shouldRequireAuthentication() {
return false;
}
public function shouldAllowUnguardedWrites() {
return true;
}
public function getMethodDescription() {
return "Used by daemons to update their status.";
}
public function defineParamTypes() {
return array(
'daemonLogID' => 'required string',
'status' => 'required enum<unknown, run, timeout, dead, exit>',
);
}
public function defineReturnType() {
return 'void';
}
public function defineErrorTypes() {
return array(
'ERR-INVALID-ID' => 'An invalid daemonLogID was provided.',
);
}
protected function execute(ConduitAPIRequest $request) {
$daemon_log = id(new PhabricatorDaemonLog())
->load($request->getValue('daemonLogID'));
if (!$daemon_log) {
throw new ConduitException('ERR-INVALID-ID');
}
$daemon_log->setStatus($request->getValue('status'));
$daemon_log->save();
}
}