Differential D11036 Diff 26502 src/applications/daemon/management/PhabricatorDaemonManagementDebugWorkflow.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/daemon/management/PhabricatorDaemonManagementDebugWorkflow.php
Show All 15 Lines | $this | ||||
'Start __daemon__ in the foreground and print large volumes of '. | 'Start __daemon__ in the foreground and print large volumes of '. | ||||
'diagnostic information to the console.')) | 'diagnostic information to the console.')) | ||||
->setArguments( | ->setArguments( | ||||
array( | array( | ||||
array( | array( | ||||
'name' => 'argv', | 'name' => 'argv', | ||||
'wildcard' => true, | 'wildcard' => true, | ||||
), | ), | ||||
array( | |||||
'name' => 'as-current-user', | |||||
'help' => 'Run the daemon as the current user '. | |||||
'instead of the configured phd.user', | |||||
), | |||||
)); | )); | ||||
} | } | ||||
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'); | |||||
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); | $daemon_class = array_shift($argv); | ||||
return $this->launchDaemon($daemon_class, $argv, $is_debug = true); | return $this->launchDaemon( | ||||
$daemon_class, | |||||
$argv, | |||||
$is_debug = true, | |||||
$run_as_current_user); | |||||
} | } | ||||
} | } |