protected function addLinkToCache($link_raw, $link_code, $link_text = "") { //PHPCrawlerBenchmark::start("preparing_link_for_cache"); // If liks already was found and processed -> skip this link if (isset($this->found_links_map[$link_raw])) { return; } // Rebuild URL from link $url_rebuild = PHPCrawlerUtils::buildURLFromLink($link_raw, $this->baseUrlParts); // If link coulnd't be rebuild if ($url_rebuild == null) { return; } // Create an PHPCrawlerURLDescriptor-object with URL-data $UrlDescriptor = new PHPCrawlerURLDescriptor($url_rebuild, $link_raw, $link_code, $link_text, $this->SourceUrl->url_rebuild); // Add the PHPCrawlerURLDescriptor-object to LinkCache $this->LinkCache->addURL($UrlDescriptor); // Add the PHPCrawlerURLDescriptor-object to found-links-array $map_key = $link_raw; $this->found_links_map[$map_key] = true; //PHPCrawlerBenchmark::stop("preparing_link_for_cache"); }