mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-22 21:40:55 +01:00
d89b8ce2b2
Summary: Ref T1670. Mostly, use PhutilArgumentParser. This breaks up the mismash of functional stuff and PhabriatorDaemonControl into proper argumentparser Workflows. There are no functional changes, except that I removed the "pingConduit()" call prior to starting daemons, because I intend to remove all Conduit integration. Test Plan: - Ran `phd list`. - Ran `phd status` (running daemons). - Ran `phd status` (no running daemons). - Ran `phd stop <pid>` (dead task). - Ran `phd stop <pid>` (live task). - Ran `phd stop zebra` (invalid PID). - Ran `phd stop 1` (bad PID). - Ran `phd stop`. - Ran `phd debug zebra` (no match). - Ran `phd debug e` (ambiguous). - Ran `phd debug task`. - Ran `phd launch task`. - Ran `phd launch 0 task` (invalid arg). - Ran `phd launch 2 task`. - Ran `phd help`. - Ran `phd help list`. - Ran `phd start`. - Ran `phd restart`. - Looked at Repositories (daemon running). - Looked at Repositories (daemon not running). Reviewers: btrahan Reviewed By: btrahan CC: aran Maniphest Tasks: T1670 Differential Revision: https://secure.phabricator.com/D6490
29 lines
855 B
PHP
Executable file
29 lines
855 B
PHP
Executable file
#!/usr/bin/env php
|
|
<?php
|
|
|
|
$root = dirname(dirname(dirname(__FILE__)));
|
|
require_once $root.'/scripts/__init_script__.php';
|
|
|
|
PhabricatorDaemonManagementWorkflow::requireExtensions();
|
|
|
|
$args = new PhutilArgumentParser($argv);
|
|
$args->setTagline('manage daemons');
|
|
$args->setSynopsis(<<<EOSYNOPSIS
|
|
**phd** __command__ [__options__]
|
|
Manage Phabricator daeons.
|
|
|
|
EOSYNOPSIS
|
|
);
|
|
$args->parseStandardArguments();
|
|
$workflows = array(
|
|
new PhabricatorDaemonManagementListWorkflow(),
|
|
new PhabricatorDaemonManagementStatusWorkflow(),
|
|
new PhabricatorDaemonManagementStartWorkflow(),
|
|
new PhabricatorDaemonManagementStopWorkflow(),
|
|
new PhabricatorDaemonManagementRestartWorkflow(),
|
|
new PhabricatorDaemonManagementLaunchWorkflow(),
|
|
new PhabricatorDaemonManagementDebugWorkflow(),
|
|
new PhutilHelpArgumentWorkflow(),
|
|
);
|
|
|
|
$args->parseWorkflows($workflows);
|