vedebel / sitemap
There is no license information available for the latest version (v1.1.3) of this package.
Sitemap generator
v1.1.3
2016-02-27 11:45 UTC
Requires
- codeception/codeception: 2.*
- guzzlehttp/guzzle: ~6.0
- imangazaliev/didom: ^1.3
- mashape/unirest-php: ^2.6
- symfony/dom-crawler: 2.7.3
README
This is the small library, which can help you to generate the XML sitemap.
Usage is very simple. Here is the example:
$client = new GuzzleHttp\Client(); $parser = new Symfony\Component\DomCrawler\Crawler(); $storage = new vedebel\sitemap\BasicLinksStorage(); $generator = new vedebel\sitemap\Sitemap($parser, $storage, $url, ['limit' => 200, 'debug' => 1]); $generator->setLoader($client); $generator->crawl(); $generator->saveXml('sitemap.xml');
If you want to monitor process while site is crawling, you can add callback, which will be called every n scanned links. Default is 10.
$generator->setCallback(function(array $scanned, array $added, array $queue) { echo "This is message form callback.\nScanned: " . count($scanned) . "\nAdded: " . count($added) . "\nQueue: " . count($queue) . "\n"; }, 10);