Download the PHP package fof/sitemap without Composer

On this page you can find all versions of the php package fof/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

Sitemap by FriendsOfFlarum

MIT license Latest Stable Version Total Downloads OpenCollective

This extension simply adds a sitemap to your forum.

It uses default entries like Discussions and Users, but is also smart enough to conditionally add further entries based on the availability of extensions. This currently applies to flarum/tags and fof/pages. Other extensions can easily inject their own Resource information, check Extending below.

Modes

There are two modes to use the sitemap.

Runtime mode

After enabling the extension the sitemap will automatically be available and generated on the fly. It contains all Users, Discussions, Tags and Pages guests have access to.

Applicable to small forums, most likely on shared hosting environments, with discussions, users, tags and pages summed up being less than 10.000 items. This is not a hard limit, but performance will be degraded as the number of items increase.

Cached multi-file mode

For larger forums you can set up a cron job that generates a sitemap index and compressed sitemap files. A first sitemap will be automatically generated after the setting is changed, but subsequent updates will have to be triggered either manually or through the scheduler (see below).

A rebuild can be manually triggered at any time by using:

Best for larger forums, starting at 10.000 items.

Risky Performance Improvements

This setting is meant for large enterprise customers.

The optional "Enable risky performance improvements" option modifies the discussion and user SQL queries to limit the number of columns returned. By removing those columns, it significantly reduces the size of the database response but might break custom visibility scopes or slug drivers added by extensions.

This setting only brings noticeable improvements if you have millions of discussions or users. We recommend not enabling it unless the CRON job takes more than an hour to run or that the SQL connection gets saturated by the amount of data.

Scheduling

Consider setting up the Flarum scheduler, which removes the requirement to setup a cron job as advised above. Read more information about this here

The frequency setting for the scheduler can be customized via the extension settings page.

Installation

This extension requires PHP 8.0 or greater.

Install manually with composer:

Updating

Nginx issues

If you are using nginx and accessing /sitemap.xml results in an nginx 404 page, you can add the following rule to your configuration file, underneath your existing location rule:

This rule makes sure that Flarum will answer the request for /sitemap.xml when no file exists with that name.

Extending

Register a new Resource

In order to register your own resource, create a class that implements FoF\Sitemap\Resources\Resource. Make sure to implement all abstract methods, check other implementations for examples. After this, register your

That's it.

Remove a Resource

In a very similar way, you can also remove resources from the sitemap:

Register a static URL

Some pages of your forum might not be covered by the default resources. To add those urls to the sitemap there is a pseudo resource called StaticUrls. You can use the RegisterStaticUrl extender to add your own urls. The extender takes a route name as parameter, which will be resolved to a url using the Flarum\Http\UrlGenerator class.

Force cache mode

If you wish to force the use of cache mode, for example in complex hosted environments, this can be done by calling the extender:

Commissioned

The initial version of this extension was sponsored by profesionalreview.com.

Links


All versions of sitemap with dependencies

PHP Build Version
Package Version
Requires php Version 8.*
flarum/core Version ^1.3.1
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 fof/sitemap contains the following files

Loading the files please wait ....