middlewares/robots

Name: robots

Owner: Middlewares

Description: PSR-15 middleware to enable/disable the robots of the search engines

Created: 2016-10-05 15:06:56.0

Updated: 2018-02-04 18:53:50.0

Pushed: 2018-01-25 22:04:25.0

Homepage:

Size: 24

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

middlewares/robots

Latest Version on Packagist Software License Build Status Quality Score Total Downloads SensioLabs Insight

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
Installation

This package is installable and autoloadable via Composer as middlewares/robots.

oser require middlewares/robots
Example
patcher = new Dispatcher([
new Middlewares\Robots(false)


ponse = $dispatcher->dispatch(new ServerRequest());

 $response->getHeaderLine('X-Robots-Tag'); //noindex, nofollow, noarchive
Options
__construct(bool $allow)

Set true to allow search engines and false to disallow.

sitemap(string $sitemap)

Optional url of a sitemap file.


Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.

The MIT License (MIT). Please see LICENSE for more information.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.