Remove product literal strings in "pht()", part 8
[phabricator.git] / src / applications / daemon / management / PhabricatorDaemonManagementDebugWorkflow.php
blobe861d238f2db5c85b676657dc8b4d6a09648b76c
1 <?php
3 final class PhabricatorDaemonManagementDebugWorkflow
4 extends PhabricatorDaemonManagementWorkflow {
6 public function shouldParsePartial() {
7 return true;
10 protected function didConstruct() {
11 $this
12 ->setName('debug')
13 ->setExamples('**debug** __daemon__')
14 ->setSynopsis(
15 pht(
16 'Start __daemon__ in the foreground and print large volumes of '.
17 'diagnostic information to the console.'))
18 ->setArguments(
19 array(
20 array(
21 'name' => 'argv',
22 'wildcard' => true,
24 array(
25 'name' => 'pool',
26 'param' => 'count',
27 'help' => pht('Maximum pool size.'),
28 'default' => 1,
30 array(
31 'name' => 'as-current-user',
32 'help' => pht(
33 'Run the daemon as the current user '.
34 'instead of the configured %s',
35 'phd.user'),
37 ));
40 public function execute(PhutilArgumentParser $args) {
41 $argv = $args->getArg('argv');
42 $run_as_current_user = $args->getArg('as-current-user');
44 if (!$argv) {
45 throw new PhutilArgumentUsageException(
46 pht('You must specify which daemon to debug.'));
49 $config = array(
50 'class' => array_shift($argv),
51 'label' => 'debug',
52 'pool' => (int)$args->getArg('pool'),
53 'argv' => $argv,
56 return $this->launchDaemons(
57 array(
58 $config,
60 $is_debug = true,
61 $run_as_current_user);