Skip to content

Commit 6c1151a

Browse files
author
SteeinSource
committed
Initial commit
1 parent bad019c commit 6c1151a

File tree

2 files changed

+94
-1
lines changed

2 files changed

+94
-1
lines changed

.gitignore

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### JetBrains template
3+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
4+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
5+
6+
# User-specific stuff:
7+
.idea/**/workspace.xml
8+
.idea/**/tasks.xml
9+
.idea/dictionaries
10+
11+
# Sensitive or high-churn files:
12+
.idea/**/dataSources/
13+
.idea/**/dataSources.ids
14+
.idea/**/dataSources.xml
15+
.idea/**/dataSources.local.xml
16+
.idea/**/sqlDataSources.xml
17+
.idea/**/dynamic.xml
18+
.idea/**/uiDesigner.xml
19+
20+
# Gradle:
21+
.idea/**/gradle.xml
22+
.idea/**/libraries
23+
24+
# Mongo Explorer plugin:
25+
.idea/**/mongoSettings.xml
26+
27+
## File-based project format:
28+
*.iws
29+
30+
## Plugin-specific files:
31+
32+
# IntelliJ
33+
/out/
34+
35+
# mpeltonen/sbt-idea plugin
36+
.idea_modules/
37+
38+
# JIRA plugin
39+
atlassian-ide-plugin.xml
40+
41+
# Crashlytics plugin (for Android Studio and IntelliJ)
42+
com_crashlytics_export_strings.xml
43+
crashlytics.properties
44+
crashlytics-build.properties
45+
fabric.properties
46+

README.md

+48-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,49 @@
1-
# php-robots
1+
# Generator robots.txt
22
Generator robots.txt
3+
4+
5+
## Installation
6+
First, install the package via composer:
7+
```
8+
composer require steein/robots
9+
```
10+
Or add the following to your ```composer.json``` in the require section and then run ```composer``` update to install it.
11+
12+
```json
13+
{
14+
"require": {
15+
"steein/robots": "dev-master"
16+
}
17+
}
18+
```
19+
20+
## Usage
21+
22+
```php
23+
use Steein\Robots\Robots;
24+
use Steein\Robots\RobotsInterface;
25+
26+
Robots::getInstance()
27+
->host("www.steein.ru")
28+
->userAgent("*")
29+
->allow("one","two")
30+
->disallow("one","two","three")
31+
->each(function (RobotsInterface $robots) {
32+
$robots->userAgent("Google")
33+
->comment("Comment Google")
34+
->spacer()
35+
->allow("testing");
36+
})->each(function (RobotsInterface $robots) {
37+
$robots->userAgent("Bind")
38+
->comment("Comment Bind")
39+
->spacer()
40+
->allow("testing");
41+
})->create(); // or render()
42+
43+
44+
45+
## Testing
46+
47+
```
48+
$ phpunit
49+
```

0 commit comments

Comments
 (0)