Exemple #1
0
 /**
  * Constructor - sets configuration
  * @global type $CrawlerConfig
  */
 private function __construct($seconds)
 {
     // Set the config property
     global $CrawlerConfig;
     $this->config = $CrawlerConfig;
     $this->started = time();
     $this->timelimit = $seconds;
     // Start a session
     if (!empty($this->config['AUTH']) && !empty($this->config['LOGIN_ENDPOINT'])) {
         CrawlerRequest::startSession();
     }
     // Make sure the table exists,
     // or create it if it doesn't
     CrawlerPDO::checkTable();
     // Set queue of URLs to crawl
     $this->queue = CrawlerPDO::getNextURLs();
     return;
 }