Exemple #1
0
 public function testCrawlBFSMaxQueueSize()
 {
     $this->spider->getQueueManager()->setTraversalAlgorithm(InMemoryQueueManager::ALGORITHM_BREADTH_FIRST);
     $this->spider->getDiscovererSet()->maxDepth = 1000;
     $this->spider->getDownloader()->setDownloadLimit(3);
     $this->spider->crawl();
     $expected = array($this->linkA, $this->linkB, $this->linkC);
     $this->assertEquals($expected, $this->statsHandler->getPersisted());
 }
Exemple #2
0
 public function handleSignal($signal)
 {
     switch ($signal) {
         case SIGTERM:
         case SIGKILL:
         case SIGINT:
         case SIGQUIT:
             echo "\n\nCAUGHT SIGNAL. TERMINATING\n\n";
             echo $this->statsHandler->toString();
             exit;
     }
 }