public function traverse(Link $url = null)
    {
        if ($url === null) {            
            $url = $this->baseUrl;
        }
                
        $this->links[$url->getAbsoluteUrl(false)] = $url;        
        $this->traverseSingle($url, 0);

        for($depth=1; $depth< $this->maxDepth; $depth++){ 
            $this->log(LogLevel::DEBUG, "crwaling in depth#".$depth);
            if(!isset($this->childrenByDepth[$depth])){
                $this->log(LogLevel::INFO, "skipping level#".$depth." no items found");
                continue;
            }
            
            $count=1;                        
            foreach($this->childrenByDepth[$depth] as $parentUrl => $parentChilds){                
                $this->log(LogLevel::DEBUG, '('.$count."/".count($this->childrenByDepth[$depth]).") crawling links of ".$parentUrl. ' count of links '.count($parentChilds));
                $parentLink = $this->links[$parentUrl];
                foreach($parentChilds as $childUrl){
                    $childLink = new Link($childUrl,$parentLink);
                    $this->traverseSingle($childLink, $depth);
                }
                $count++;
            }
            
        }
        
        return $this;
    }
public function traverse(Link $url = null)
    {
        if ($url === null) {            
            $url = $this->baseUrl;
        }
                
        $this->links[$url->getAbsoluteUrl(false)] = $url;        
        $this->traverseSingle($url, 0);

        for($depth=1; $depth< $this->maxDepth; $depth++){ 
            $this->log(LogLevel::DEBUG, "crwaling in depth#".$depth);
            if(!isset($this->childrenByDepth[$depth])){
                $this->log(LogLevel::INFO, "skipping level#".$depth." no items found");
                continue;
            }
            
            $count=1;                        
            foreach($this->childrenByDepth[$depth] as $parentUrl => $parentChilds){                
                $this->log(LogLevel::DEBUG, '('.$count."/".count($this->childrenByDepth[$depth]).") crawling links of ".$parentUrl. ' count of links '.count($parentChilds));
                $parentLink = $this->links[$parentUrl];
                foreach($parentChilds as $childUrl){
                    $childLink = new Link($childUrl,$parentLink);
                    $this->traverseSingle($childLink, $depth);
                }
                $count++;
            }
            
        }
        
        return $this;
    }
public function traverse ( Link $ url = null ) { if ( $ url === null ) { $ url = $ this -> baseUrl ; } $ this -> links [ $ url -> getAbsoluteUrl ( false ) ] = $ url ; $ this -> traverseSingle ( $ url , 0 ) ; for ( $ depth = 1 ; $ depth < $ this -> maxDepth ; $ depth ++ ) { $ this -> log ( LogLevel :: DEBUG , "crwaling in depth#" . $ depth ) ; if ( ! isset ( $ this -> childrenByDepth [ $ depth ] ) ) { $ this -> log ( LogLevel :: INFO , "skipping level#" . $ depth . " no items found" ) ; continue ; } $ count = 1 ; foreach ( $ this -> childrenByDepth [ $ depth ] as $ parentUrl => $ parentChilds ) { $ this -> log ( LogLevel :: DEBUG , '(' . $ count . "/" . count ( $ this -> childrenByDepth [ $ depth ] ) . ") crawling links of " . $ parentUrl . ' count of links ' . count ( $ parentChilds ) ) ; $ parentLink = $ this -> links [ $ parentUrl ] ; foreach ( $ parentChilds as $ childUrl ) { $ childLink = new Link ( $ childUrl , $ parentLink ) ; $ this -> traverseSingle ( $ childLink , $ depth ) ; } $ count ++ ; } } return $ this ; }
Initiate the crawl
@param UriInterface $url
@return \Arachnid\Crawler
Initiate the crawl