Path: blob/master/src/applications/daemon/management/PhabricatorDaemonManagementDebugWorkflow.php
12256 views
<?php12final class PhabricatorDaemonManagementDebugWorkflow3extends PhabricatorDaemonManagementWorkflow {45public function shouldParsePartial() {6return true;7}89protected function didConstruct() {10$this11->setName('debug')12->setExamples('**debug** __daemon__')13->setSynopsis(14pht(15'Start __daemon__ in the foreground and print large volumes of '.16'diagnostic information to the console.'))17->setArguments(18array(19array(20'name' => 'argv',21'wildcard' => true,22),23array(24'name' => 'pool',25'param' => 'count',26'help' => pht('Maximum pool size.'),27'default' => 1,28),29array(30'name' => 'as-current-user',31'help' => pht(32'Run the daemon as the current user '.33'instead of the configured %s',34'phd.user'),35),36));37}3839public function execute(PhutilArgumentParser $args) {40$argv = $args->getArg('argv');41$run_as_current_user = $args->getArg('as-current-user');4243if (!$argv) {44throw new PhutilArgumentUsageException(45pht('You must specify which daemon to debug.'));46}4748$config = array(49'class' => array_shift($argv),50'label' => 'debug',51'pool' => (int)$args->getArg('pool'),52'argv' => $argv,53);5455return $this->launchDaemons(56array(57$config,58),59$is_debug = true,60$run_as_current_user);61}6263}646566