Exemple #1
0
 public function processResult(Result $result)
 {
     if ($result->isSuccess()) {
         $this->renderSuccess($result);
     } else {
         $this->renderFailure($result);
     }
 }
Exemple #2
0
 public function scan()
 {
     $this->eventDispatcher->simpleNotify('Scanner.Scan.Begin');
     while (($response = $this->responseRetriever->next()) && !$this->eventDispatcher->notifyUntil(new Event('Scanner.Scan.isStopped'))) {
         // this is the url filter
         if ($this->eventDispatcher->notifyUntil(new Event('Scanner.ProcessHtml.isFiltered', array('uri' => $response->getUri())))) {
             continue;
         }
         $resultArray = $this->checkResponse($response);
         $result = new Result($response->getUri(), $resultArray['type'], $response, '', $resultArray['time']);
         if ($result->isFailure()) {
             $result->setMessages($resultArray['messages']);
             $this->status = 1;
         }
         $this->eventDispatcher->simpleNotify('Scanner.Scan.Validate', array('result' => $result));
     }
     $this->eventDispatcher->simpleNotify('Scanner.Scan.Finish');
 }
Exemple #3
0
 public function processResult(Result $result)
 {
     ++$this->urlCount;
     $this->output->writeln('   ' . $result->getUrl());
     $this->output->writeln('');
 }
Exemple #4
0
 protected function renderSuccess(Result $result)
 {
     $this->output->writeln('   <info> ' . $result->getUrl() . ' </info> all tests passed');
 }