libs/PHPCrawler.class.php
protected function starControllerProcessLoop()
  {
    // If multiprocess-mode is not MPMODE_PARENT_EXECUTES_USERCODE -> exit process
    if ($this->multiprocess_mode != PHPCrawlerMultiProcessModes::MPMODE_PARENT_EXECUTES_USERCODE) exit;
    
    $this->initCrawlerProcess();
    $this->initChildProcess();
    
    while (true)
    { 
      // Check for abort
      if ($this->checkForAbort() !== null)
      {
        $this->ProcessCommunication->killChildProcesses();
        break;
      }
      
      // Get next DocInfo-object from queue
      $DocInfo = $this->DocumentInfoQueue->getNextDocumentInfo();
      
      if ($DocInfo == null)
      { 
        
        // If there are nor more links in cache AND there are no more DocInfo-objects in queue -> passedthrough
        if ($this->LinkCache->containsURLs() == false && $this->DocumentInfoQueue->getDocumentInfoCount() == 0)
        {
          $this->ProcessCommunication->updateCrawlerStatus(null, PHPCrawlerAbortReasons::ABORTREASON_PASSEDTHROUGH);
        }
        
        sleep(0.2);
        continue;
      }
      
      // Update crawler-status
      $this->ProcessCommunication->updateCrawlerStatus($DocInfo);
      
      // Call the "abstract" method handlePageData
      $user_abort = false;
      $page_info = $DocInfo->toArray();
      $user_return_value = $this->handlePageData($page_info);
      if ($user_return_value < 0) $user_abort = true;
      
      // Call the "abstract" method handleDocumentInfo
      $user_return_value = $this->handleDocumentInfo($DocInfo);
      if ($user_return_value < 0) $user_abort = true;
        
      // Update status if user aborted process
      if ($user_abort == true) 
        $this->ProcessCommunication->updateCrawlerStatus(null, PHPCrawlerAbortReasons::ABORTREASON_USERABORT);
    }
  }
protected function starControllerProcessLoop()
  {
    // If multiprocess-mode is not MPMODE_PARENT_EXECUTES_USERCODE -> exit process
    if ($this->multiprocess_mode != PHPCrawlerMultiProcessModes::MPMODE_PARENT_EXECUTES_USERCODE) exit;
    
    $this->initCrawlerProcess();
    $this->initChildProcess();
    
    while (true)
    { 
      // Check for abort
      if ($this->checkForAbort() !== null)
      {
        $this->ProcessCommunication->killChildProcesses();
        break;
      }
      
      // Get next DocInfo-object from queue
      $DocInfo = $this->DocumentInfoQueue->getNextDocumentInfo();
      
      if ($DocInfo == null)
      { 
        
        // If there are nor more links in cache AND there are no more DocInfo-objects in queue -> passedthrough
        if ($this->LinkCache->containsURLs() == false && $this->DocumentInfoQueue->getDocumentInfoCount() == 0)
        {
          $this->ProcessCommunication->updateCrawlerStatus(null, PHPCrawlerAbortReasons::ABORTREASON_PASSEDTHROUGH);
        }
        
        sleep(0.2);
        continue;
      }
      
      // Update crawler-status
      $this->ProcessCommunication->updateCrawlerStatus($DocInfo);
      
      // Call the "abstract" method handlePageData
      $user_abort = false;
      $page_info = $DocInfo->toArray();
      $user_return_value = $this->handlePageData($page_info);
      if ($user_return_value < 0) $user_abort = true;
      
      // Call the "abstract" method handleDocumentInfo
      $user_return_value = $this->handleDocumentInfo($DocInfo);
      if ($user_return_value < 0) $user_abort = true;
        
      // Update status if user aborted process
      if ($user_abort == true) 
        $this->ProcessCommunication->updateCrawlerStatus(null, PHPCrawlerAbortReasons::ABORTREASON_USERABORT);
    }
  }
Starts the loop of the controller-process (main-process).