Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/steeinru/php-robots
Generator robots.txt
https://github.com/steeinru/php-robots
laravel-package php php7 robots robots-generator robots-txt steein-robots
Last synced: 21 days ago
JSON representation
Generator robots.txt
- Host: GitHub
- URL: https://github.com/steeinru/php-robots
- Owner: SteeinRu
- License: mit
- Created: 2017-07-27T16:10:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-08T19:40:55.000Z (over 7 years ago)
- Last Synced: 2024-10-15T01:21:42.163Z (2 months ago)
- Topics: laravel-package, php, php7, robots, robots-generator, robots-txt, steein-robots
- Language: PHP
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Generator robots.txt
Generator of the text file "robots.txt"***The robots.txt*** file is a text file located in the root directory of the site, in which special instructions for search robots are written. These instructions may prohibit some sections or pages on the site from being indexed, indicate the correct "mirroring" of the domain, recommend the search robot to observe a certain time interval between downloading documents from the server, etc.
## Installation
First, install the package via composer:
```
composer require steein/robots
```
Or add the following to your ```composer.json``` in the require section and then run ```composer``` update to install it.```json
{
"require": {
"steein/robots": "1.4"
}
}
```## Usage
### default
```php
use Steein\Robots\Robots;
use Steein\Robots\RobotsInterface;Robots::getInstance()
->host("www.steein.ru")
->userAgent("*")
->allow("one","two")
->disallow("one","two","three")
->each(function (RobotsInterface $robots) {
$robots->userAgent("Google")
->comment("Comment Google")
->spacer()
->allow("testing");
})->each(function (RobotsInterface $robots) {
$robots->userAgent("Bind")
->comment("Comment Bind")
->spacer()
->allow("testing");
})->create(); // or render()```
## Testing
```
$ phpunit
```