setName('test') ->setDescription('the test command'); } protected function execute(Input $input, Output $output) { $aria2 = new Aria2('http://127.0.0.1:16800/jsonrpc'); try { // 获取所有活动的下载任务 $activeDownloads = $aria2->getGlobalStat(); dump('正在下载的任务数量:',intval($activeDownloads['result']['numWaiting'])); // dump('等待下载的任务数量:',$waitingCount); } catch (Exception $e) { dump($e); } // 指令输出 // $output->writeln('test'); } }