public function traverseChildren(Link $sourceUrl, $childLinks, $depth)
    {                
        foreach ($childLinks as $url => $info) {            
            
            $filterCallback = $this->filterCallback;
            $childLink = new Link($url,$sourceUrl);
            $hash = $childLink->getAbsoluteUrl(false);
            $this->links[$hash]  = $childLink;
            
            if ($filterCallback && $filterCallback($url)===false &&
                    isset($this->links[$hash]) === false) {
                    $childLink->setAsShouldVisit(false);
                    $this->log(LogLevel::INFO, 'skipping '.$url.' link not match filter criteria');
                    return;
            }
            if (isset($this->links[$hash]) === false) {
                $this->links[$hash] = $info;
                $childLink->setCrawlDepth($depth);		
            } else {		
                $originalLink = $this->links[$hash];
                $originalLink->addMetaInfo('originalUrls',$childLink->getOriginalUrl());
                $originalLink->addMetaInfo('linksText',$childLink->getMetaInfo('linksText'));                
            }

            $this->childrenByDepth[$depth][$sourceUrl->getAbsoluteUrl(false)][] = $hash;                        
        }
        
    }
public function traverseChildren(Link $sourceUrl, $childLinks, $depth)
    {                
        foreach ($childLinks as $url => $info) {            
            
            $filterCallback = $this->filterCallback;
            $childLink = new Link($url,$sourceUrl);
            $hash = $childLink->getAbsoluteUrl(false);
            $this->links[$hash]  = $childLink;
            
            if ($filterCallback && $filterCallback($url)===false &&
                    isset($this->links[$hash]) === false) {
                    $childLink->setAsShouldVisit(false);
                    $this->log(LogLevel::INFO, 'skipping '.$url.' link not match filter criteria');
                    return;
            }
            if (isset($this->links[$hash]) === false) {
                $this->links[$hash] = $info;
                $childLink->setCrawlDepth($depth);		
            } else {		
                $originalLink = $this->links[$hash];
                $originalLink->addMetaInfo('originalUrls',$childLink->getOriginalUrl());
                $originalLink->addMetaInfo('linksText',$childLink->getMetaInfo('linksText'));                
            }

            $this->childrenByDepth[$depth][$sourceUrl->getAbsoluteUrl(false)][] = $hash;                        
        }
        
    }
public function traverseChildren ( Link $ sourceUrl , $ childLinks , $ depth ) { foreach ( $ childLinks as $ url => $ info ) { $ filterCallback = $ this -> filterCallback ; $ childLink = new Link ( $ url , $ sourceUrl ) ; $ hash = $ childLink -> getAbsoluteUrl ( false ) ; $ this -> links [ $ hash ] = $ childLink ; if ( $ filterCallback && $ filterCallback ( $ url ) === false && isset ( $ this -> links [ $ hash ] ) === false ) { $ childLink -> setAsShouldVisit ( false ) ; $ this -> log ( LogLevel :: INFO , 'skipping ' . $ url . ' link not match filter criteria' ) ; return ; } if ( isset ( $ this -> links [ $ hash ] ) === false ) { $ this -> links [ $ hash ] = $ info ; $ childLink -> setCrawlDepth ( $ depth ) ; } else { $ originalLink = $ this -> links [ $ hash ] ; $ originalLink -> addMetaInfo ( 'originalUrls' , $ childLink -> getOriginalUrl ( ) ) ; $ originalLink -> addMetaInfo ( 'linksText' , $ childLink -> getMetaInfo ( 'linksText' ) ) ; } $ this -> childrenByDepth [ $ depth ] [ $ sourceUrl -> getAbsoluteUrl ( false ) ] [ ] = $ hash ; } }
Crawl child links
@param Link $sourceUrl
@param array $childLinks
@param int   $depth
Crawl child links