Download the PHP package yii2tech/sitemap without Composer

On this page you can find all versions of the php package yii2tech/sitemap. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sitemap

Site Map Extension for Yii 2


This extension provides support for site map and site map index files generating.

For license information check the LICENSE-file.

Latest Stable Version Total Downloads Build Status

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the require section of your composer.json.

Usage

This extension provides support for site map and site map index files generation. You can use \yii2tech\sitemap\File for site map file composition:

In case you put sitemap generation into a console command, you will need to manually configure URL manager parameters for it. For example:

Creating site map index files

There is a limitation on the site map maximum size. Such file can not contain more then 50000 entries and its actual size can not exceed 50MB. If you web application has more then 50000 pages and you need to generate site map for it, you'll have to split it between several files and then generate a site map index file. It is up to you how you split your URLs between different site map files, however you can use \yii2tech\sitemap\File::getEntriesCount() or \yii2tech\sitemap\File::getIsEntriesLimitReached() method to check count of already written entries.

For example: assume we have an 'item' table, which holds several millions of records, each of which has a detail view page at the web application. In this case generating site map files for such pages may look like following:

Once all site map files are generated, you can compose index file, using the following code:

Note: by default site map files are stored under the path '@app/web/sitemap'. If you need a different file path you should adjust fileBasePath field accordingly.

Rendering on-the-fly

Saving sitemap to the physical file may be not a best option to keep it up-to-date. Such file should be manually re-created, once some changes among site pages appear. You may setup a web controller, which will render 'sitemap.xml' file on demand, once it is been requested. This controller may apply caching and its busting logic. First of all, you'll have to set up a route for the controller action rendering the sitemap in your URL manager. For example:

Then you'll need to create an action, which will render sitemap file content and emit it to the web client. You can use PHP 'in memory' stream as a file name for the sitemap file during its composition. The final implementation may look like following:

Customizing file envelope

You can customize entries envelope for the particular file using following options:

For example:

Rendering non-standard tags

While there is a standard, which defines sitemap content, particular search engines may accept extra tags and options. The most widely used are image and video descriptions. Method \yii2tech\sitemap\File::writeUrl() supports rendering image and video information.

For adding images to the sitemap entry use 'images' option. For example:

For adding videos to the sitemap entry use 'videos' option. For example:

You can also add any custom content to the URL tag using 3rd argument of the \yii2tech\sitemap\File::writeUrl() method. For example:

Heads up! Remember that you'll have to add corresponding XML namespaces to the sitemap file, using \yii2tech\sitemap\BaseFile::$rootTag, in order to non-standard tags being recognized by the search engines.


All versions of sitemap with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
yiisoft/yii2 Version ~2.0.13
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package yii2tech/sitemap contains the following files

Loading the files please wait ....