Beispiel #1
0
 /**
  * Execute command
  *
  * @param InputInterface  $input
  * @param OutputInterface $output
  *
  * @return void
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $techHeader = new TechHeader();
     $techHeader->setRequest($this->request);
     $values = $techHeader->getHeaders($this->url);
     if (empty($values)) {
         if ($input->getOption('json')) {
             $this->output->write(json_encode(['error' => 'No detectable technology was found']));
         } else {
             $this->output->writeln('No detectable technology was found');
         }
         return;
     }
     if ($input->getOption('json')) {
         $this->output->write(json_encode($values));
     } else {
         $rows = array();
         foreach ($values as $key => $value) {
             $rows[] = array($key, $value);
         }
         $this->writeHeader('Server Technology');
         $table = new Table($this->output);
         $table->setHeaders(array('Key', 'Value'))->setRows($rows)->render();
     }
 }
Beispiel #2
0
 /**
  * Execute command
  *
  * @param InputInterface  $input
  * @param OutputInterface $output
  *
  * @return void
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $techHeader = new TechHeader();
     $techHeader->setRequest($this->request);
     $values = $techHeader->getHeaders();
     if (empty($values)) {
         return $this->out('Server Technology', 'No detectable technology was found');
     }
     $rows = [];
     foreach ($values as $key => $value) {
         $rows[] = [$key, $value];
     }
     $this->out('Server Technology', [['type' => 'table', 'data' => [['Key', 'Value'], $rows]]]);
 }
Beispiel #3
0
 /**
  * Check for server technologies
  *
  * @return void
  */
 public function checkServertech()
 {
     $rows = array();
     $techHeader = new TechHeader();
     $values = $techHeader->getHeaders($this->url);
     if (empty($values)) {
         $rows[] = array('No detectable technology was found');
     }
     foreach ($values as $key => $value) {
         $rows[] = array($key, $value);
     }
     $this->respond(array('body' => $rows));
 }
Beispiel #4
0
 /**
  * Analize the server technology being used
  *
  * @return void
  */
 protected function checkServerTech()
 {
     $this->writeHeader('Server Technology');
     $techHeader = new TechHeader();
     $techHeader->setRequest($this->request);
     $values = $techHeader->getHeaders($this->url);
     if (empty($values)) {
         $this->output->writeln('No detectable technology was found');
         return;
     }
     $rows = array();
     foreach ($values as $key => $value) {
         $rows[] = array($key, $value);
     }
     $table = new Table($this->output);
     $table->setHeaders(array('Key', 'Value'))->setRows($rows)->render();
 }
Beispiel #5
0
 /**
  * Check for server technologies
  *
  * @return void
  */
 public function checkServertech()
 {
     $rows = [];
     $techHeader = new TechHeader();
     $techHeader->setRequest($this->request);
     $values = $techHeader->getHeaders();
     if (empty($values)) {
         $rows[] = ['No detectable technology was found'];
     }
     foreach ($values as $key => $value) {
         $rows[] = [$key, $value];
     }
     $this->respond(['body' => $rows]);
 }