Пример #1
0
 /**
  * @param \Symfony\Component\Console\Input\InputInterface $input
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $jobId = $input->getArgument('job-id');
     $pheanstalk = $this->pheanstalkFactory->create();
     $pheanstalk->delete($pheanstalk->peek($jobId));
     $output->writeln(sprintf('<info>Successfully deleted job %s</info>', $jobId));
 }
Пример #2
0
 /**
  * @param \Symfony\Component\Console\Input\InputInterface $input
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $jobState = $input->getOption('state');
     $this->assertInputStateValid($jobState);
     $peekMethod = $this->jobStateMap[$jobState];
     $output->writeln($this->formatOutput($this->pheanstalkFactory->create()->{$peekMethod}($input->getOption('tube')), $this->prettyPrinterLocator->determinePrinter($input->getOption('pretty'))));
 }
Пример #3
0
 /**
  * @param \Symfony\Component\Console\Input\InputInterface $input
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $tube = $input->getOption('tube');
     $pheanstalk = $this->pheanstalkFactory->create();
     $output->writeln($this->formatOutput($pheanstalk->stats(), 'Server-Wide'));
     if ($tube) {
         $tubes = [$tube];
     } else {
         $tubes = $pheanstalk->listTubes();
     }
     foreach ($tubes as $tube) {
         $output->writeln($this->formatOutput($pheanstalk->statsTube($tube), $tube));
     }
 }
Пример #4
0
 /**
  * @param \Symfony\Component\Console\Input\InputInterface $input
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $output->writeln($this->formatOutput($this->pheanstalkFactory->create()->listTubes()));
 }
Пример #5
0
 /**
  * @param \Symfony\Component\Console\Input\InputInterface $input
  * @param \Symfony\Component\Console\Output\OutputInterface $output
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $jobId = $input->getArgument('job-id');
     $pheanstalk = $this->pheanstalkFactory->create();
     $output->writeln($this->formatOutput($pheanstalk->statsJob($pheanstalk->peek($jobId))));
 }
Пример #6
0
 public function doRun(InputInterface $input, OutputInterface $output)
 {
     $this->pheanstalkFactory->setHost($input->getParameterOption('--host', self::DEFAULT_HOST));
     $this->pheanstalkFactory->setPort($input->getParameterOption('--port', self::DEFAULT_PORT));
     return parent::doRun($input, $output);
 }