Download the PHP package middlewares/robots without Composer
On this page you can find all versions of the php package middlewares/robots. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download middlewares/robots
More information about middlewares/robots
Files in middlewares/robots
Package robots
Short Description Middleware to enable/disable the robots of the search engines
License MIT
Homepage https://github.com/middlewares/robots
Informations about the package robots
middlewares/robots
Middleware to enable/disable the robots of the search engines for non-production environment. Adds automatically the header X-Robots-Tag
in all responses and returns a default body for /robots.txt
request.
Requirements
- PHP >= 7.2
- A PSR-7 http library
- A PSR-15 middleware dispatcher
Installation
This package is installable and autoloadable via Composer as middlewares/robots.
Example
Usage
The constructor's first argument configure whether block or not search engines.
Optionally, you can provide a Psr\Http\Message\ResponseFactoryInterface
as the second argument to create the response of the requests to /robots.txt
. If it's not defined, Middleware\Utils\Factory will be used to detect it automatically.
sitemap
If your site has a sitemap, use this option to add the url to robots.txt
responses.
Please see CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.
All versions of robots with dependencies
middlewares/utils Version ^3.0
psr/http-server-middleware Version ^1.0