Differential D11860 Diff 28618 src/applications/daemon/management/PhabricatorDaemonManagementDebugWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/daemon/management/PhabricatorDaemonManagementDebugWorkflow.php
Show All 20 Lines | $this | ||||
'name' => 'argv', | 'name' => 'argv', | ||||
'wildcard' => true, | 'wildcard' => true, | ||||
), | ), | ||||
array( | array( | ||||
'name' => 'as-current-user', | 'name' => 'as-current-user', | ||||
'help' => 'Run the daemon as the current user '. | 'help' => 'Run the daemon as the current user '. | ||||
'instead of the configured phd.user', | 'instead of the configured phd.user', | ||||
), | ), | ||||
array( | |||||
'name' => 'autoscale', | |||||
'help' => pht('Put the daemon in an autoscale group.'), | |||||
), | |||||
)); | )); | ||||
} | } | ||||
public function execute(PhutilArgumentParser $args) { | public function execute(PhutilArgumentParser $args) { | ||||
$argv = $args->getArg('argv'); | $argv = $args->getArg('argv'); | ||||
$run_as_current_user = $args->getArg('as-current-user'); | $run_as_current_user = $args->getArg('as-current-user'); | ||||
if (!$argv) { | if (!$argv) { | ||||
throw new PhutilArgumentUsageException( | throw new PhutilArgumentUsageException( | ||||
pht('You must specify which daemon to debug.')); | pht('You must specify which daemon to debug.')); | ||||
} | } | ||||
$daemon_class = array_shift($argv); | $config = array(); | ||||
$config['class'] = array_shift($argv); | |||||
$config['argv'] = $argv; | |||||
if ($args->getArg('autoscale')) { | |||||
$config['autoscale'] = array( | |||||
'group' => 'debug', | |||||
); | |||||
} | |||||
return $this->launchDaemons( | return $this->launchDaemons( | ||||
array( | array( | ||||
array($daemon_class, $argv), | $config, | ||||
), | ), | ||||
$is_debug = true, | $is_debug = true, | ||||
$run_as_current_user); | $run_as_current_user); | ||||
} | } | ||||
} | } |