src/Net/Site/MapCreator.php
public function createSitemap( $url, $sitemapUri, $errorsLogUri = NULL, $urlListUri = NULL, $verbose = FALSE )
	{
		$crawler	= new Net_Site_Crawler( $url, $this->depth );
		$crawler->crawl( $url, FALSE, $verbose );
		$this->errors	= $crawler->getErrors();
		$this->links	= $crawler->getLinks();
		$list	= array();
		foreach( $this->links as $link )
			$list[]	= $link['url'];
		$writtenBytes	= Net_Site_MapWriter::save( $sitemapUri, $list );
		if( $errorsLogUri )
		{
			@unlink( $errorsLogUri );
			if( count( $this->errors ) )
				$this->saveErrors( $errorsLogUri );
		}
		if( $urlListUri )
			$this->saveUrls( $urlListUri );
		return $writtenBytes;
	}
public function createSitemap( $url, $sitemapUri, $errorsLogUri = NULL, $urlListUri = NULL, $verbose = FALSE )
	{
		$crawler	= new Net_Site_Crawler( $url, $this->depth );
		$crawler->crawl( $url, FALSE, $verbose );
		$this->errors	= $crawler->getErrors();
		$this->links	= $crawler->getLinks();
		$list	= array();
		foreach( $this->links as $link )
			$list[]	= $link['url'];
		$writtenBytes	= Net_Site_MapWriter::save( $sitemapUri, $list );
		if( $errorsLogUri )
		{
			@unlink( $errorsLogUri );
			if( count( $this->errors ) )
				$this->saveErrors( $errorsLogUri );
		}
		if( $urlListUri )
			$this->saveUrls( $urlListUri );
		return $writtenBytes;
	}
public function createSitemap ( $ url , $ sitemapUri , $ errorsLogUri = NULL , $ urlListUri = NULL , $ verbose = FALSE ) { $ crawler = new Net_Site_Crawler ( $ url , $ this -> depth ) ; $ crawler -> crawl ( $ url , FALSE , $ verbose ) ; $ this -> errors = $ crawler -> getErrors ( ) ; $ this -> links = $ crawler -> getLinks ( ) ; $ list = array ( ) ; foreach ( $ this -> links as $ link ) $ list [ ] = $ link [ 'url' ] ; $ writtenBytes = Net_Site_MapWriter :: save ( $ sitemapUri , $ list ) ; if ( $ errorsLogUri ) { @ unlink ( $ errorsLogUri ) ; if ( count ( $ this -> errors ) ) $ this -> saveErrors ( $ errorsLogUri ) ; } if ( $ urlListUri ) $ this -> saveUrls ( $ urlListUri ) ; return $ writtenBytes ; }
Crawls a Web Site, writes Sitemap XML File, logs Errors and URLs and returns Number of written Bytes.
@access		public
@param		string		$url			URL of Web Site
@param		string		$sitemapUri		File Name of Sitemap XML File
@param		string		$errorsLogUri	File Name of Error Log File
@param		string		$urlLogUri		File Name of URL Log File
@param		boolean		$verbose		Flag: show crawled URLs
@return		int
Crawls a Web Site writes Sitemap XML File logs Errors and URLs and returns Number of written Bytes .