Download the PHP package flagrow/sitemap without Composer

On this page you can find all versions of the php package flagrow/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, both now serving content from the main domain for search engine compliance.

Runtime mode

After enabling the extension the sitemap will automatically be available at /sitemap.xml and generated on the fly. Individual sitemap files are served at /sitemap-1.xml, /sitemap-2.xml, etc. 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, sitemaps are automatically generated and updated via the Flarum scheduler. Sitemaps are stored on your configured storage (local disk, S3, CDN) but always served from your main domain to ensure search engine compliance. Individual sitemaps are accessible at /sitemap-1.xml, /sitemap-2.xml, etc.

A first sitemap will be automatically generated after the setting is changed. Subsequent updates are handled automatically by the scheduler (see Scheduling section 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.

Search Engine Compliance

This extension automatically ensures search engine compliance by:

This means you can use S3 or CDN storage for performance while maintaining full Google Search Console compatibility.

Scheduling

The extension automatically registers with the Flarum scheduler to update cached sitemaps. This removes the need for manual intervention once configured. Read more information about setting up the Flarum scheduler 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 or individual sitemap files (e.g., /sitemap-1.xml) results in an nginx 404 page, you can add the following rules to your configuration file:

These rules ensure that Flarum will handle sitemap requests when no physical files exist.

Extending

Using the Unified Sitemap Extender (Recommended)

The recommended way to extend the sitemap is using the unified Sitemap extender, which allows method chaining and follows Flarum's common extender patterns:

Available Methods

Register a New Resource

Create a class that extends FoF\Sitemap\Resources\Resource and implement all abstract methods:

Then register it using the unified extender:

Dynamic Priority and Frequency (Optional)

Your custom resource can optionally implement dynamic priority and frequency values based on the actual model data:

If these methods return null or are not implemented, the static frequency() and priority() methods will be used instead. This ensures full backward compatibility with existing extensions.

Remove a Resource

Remove existing resources from the sitemap:

Replace a Resource

Replace an existing resource with a custom implementation. This is useful when you want to modify the behavior of a built-in resource:

Example Use Cases for replaceResource:

  1. Custom User Resource: Replace the default user resource to change URL structure or filtering logic
  2. Enhanced Discussion Resource: Replace the discussion resource to add custom metadata or different priority calculations
  3. Modified Tag Resource: Replace the tag resource to change how tags are included or prioritized

Register Static URLs

Add static URLs to the sitemap by specifying route names:

Force Cache Mode

Force the use of cache mode for managed hosting environments:

Legacy Extenders (Deprecated)

The following extenders are still supported for backwards compatibility but are deprecated and will be removed in Flarum 2.0. Please migrate to the unified Sitemap extender.

Register a Resource (Legacy)

Remove a Resource (Legacy)

Register Static URL (Legacy)

Force Cached Mode (Legacy)

Optional Sitemap Elements

The extension allows you to control whether <priority> and <changefreq> elements are included in your sitemap:

Admin Settings

Both settings are enabled by default for backward compatibility.

Dynamic Values

When enabled, the extension uses intelligent frequency calculation based on actual content activity:

This provides more meaningful information to search engines compared to static values.

Troubleshooting

Regenerating Sitemaps

If you've updated the extension or changed storage settings, you may need to regenerate your sitemaps:

Debug Logging

When Flarum is in debug mode, the extension provides detailed logging showing:

Check your Flarum logs (storage/logs/) for detailed information about sitemap operations.

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.0
flarum/core Version ^1.3.1
guzzlehttp/guzzle Version *
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 flagrow/sitemap contains the following files

Loading the files please wait ....