kiwa / sitemap
Creates a sitemap.xml by parsing the whole website.
Requires
- php: >=7.2
- ext-curl: *
- ext-dom: *
- ext-libxml: *
- bitandblack/composer-helper: ^0.4.0
- bitandblack/helpers: ^1.0
- jakeasmith/http_build_url: ^1.0
- psr/log: ^1.1
- symfony/console: ^5.0
- symfony/yaml: ^5.0
Requires (Dev)
- ext-json: *
- monolog/monolog: ^2.0
- phpstan/phpstan: ^0.12
- phpunit/phpunit: ^8.0 || ^9.0
- spatie/browsershot: ^3.40
This package is auto-updated.
Last update: 2021-01-10 13:36:55 UTC
README
Kiwa Sitemap
Creates a sitemap.xml
by parsing the whole website including all language versions and all images.
If multiple language versions are found, multiple xml
files will be written.
This library is meant to run along with Kiwa but don't has to.
Installation
This library is made for the use with Composer. Add it to your project by running $ composer require kiwa/sitemap
.
If you are using the Kiwa Console some commands will be available then.
Usage
Set up the sitemap generation like that:
<?php
use Kiwa\Sitemap\Config\YamlConfig;
use Kiwa\Sitemap\SitemapCrawler;
use Kiwa\Sitemap\Writer\FileWriter;
$config = new YamlConfig('/path/to/config.yaml');
$writer = new FileWriter('/path/to/xml/files');
$sitemapCrawler = new SitemapCrawler(
$config,
$writer
);
$sitemapCrawler->createSitemap('http://crawl.me');
The YamlConfig
stores some information which are needed when the process needs to run in multiple steps. Therefore it needs a path where the config file may get stored.
FileWriter
stores the xml
files, so it needs to know a folder for those files.
createSitemap()
starts the crawling. If the time limit has been reached, the process will stop and store its status in the config file. If you call createSitemap()
again it will continue the process. This is helpful for large websites which may take a long time to crawl.
Help
If you have questions about Kiwa feel free to contact us under hello@kiwa.io
.