Yii 1.1: yii-sitemap-generator

Sitemap Generator (Crawler) for Yii
1 follower

The project brings the sitemap generator based on the website crawler. It is made for Yii 1.1.x. Was not tested and not intended to work on 2.x It is related on PHP Simple HTML DOM Parser (http://simplehtmldom.sourceforge.net/)

Requirements

Yii 1.1.x

Usage

To use the generator simply add the SitemapCommand.php to your protected/components Copy the php-dom folder to protected/vendors (or download the newest version from the project website). Add configuration following in the protected/config/console.php:

'sitemap'=>array(
  'class'=>'SitemapComponent',
    'protocolPattern'=>'https',
    'sitemapPath'=>'/var/www/mypage'
    'excludeRegex'=>array(
      //sample exclude the wp-* folders, if we also host w WordPress blog,
      //and don't want to include this URLS to the sitemaps.
      '/^(.*)wp-(.*)$/',
    ),

Then use in the console command:

Yii::app()->sitemap->generateSitemap();

The parameters are explained in the comments in the code. The sample configuration file and command is attached with the project.

Resources

Be the first person to leave a comment

Please to leave your comment.

Create extension
Downloads
No downloadable files yet