Esempio n. 1
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');
 }