2017 © Pedro PelĂĄez
 

library robots

Robots.txt generator

image

arcanedev/robots

Robots.txt generator

  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Robots.txt Generator ![Packagist License][badge_license] For PHP

Travis Status ![HHVM Status][badge_hhvm] Coverage Status ![Scrutinizer Code Quality][badge_quality] SensioLabs Insight ![Github Issues][badge_issues], (*1)

Packagist ![Packagist Release][badge_release] Packagist Downloads, (*2)

By ARCANEDEV©, (*3)

Features

  • Framework agnostic package.
  • Well documented & IDE Friendly.
  • Well tested with maximum code quality.
  • Laravel 4.2 supported.
  • Laravel 5 supported.
  • Made with :heart: & :coffee:.

Requirements

- PHP >= 5.5.9

INSTALLATION

Composer

You can install this package via Composer. Add this to your composer.json :, (*4)

{
    "require": {
        "arcanedev/robots": "~2.0"
    }
}

Then install it via composer install or composer update., (*5)

Laravel

Setup

Once the package is installed, you can register the service provider in config/app.php in the providers array:, (*6)

'providers' => [
    ...
    Arcanedev\Robots\RobotsServiceProvider::class,
],

And the facade in the aliases array:, (*7)

'aliases' => [
    ...
    'Robots' => Arcanedev\Robots\Facades\Robots::class,
],

USAGE

Laravel

The quickest way to use Robots is to just setup a callback-style route for robots.txt in your app/routes.php file., (*8)

Route::get('robots.txt', function() {

    // If on the live server, serve a nice, welcoming robots.txt.
    if (App::environment() == 'production') {
        Robots::addUserAgent('*');
        Robots::addSitemap('sitemap.xml');
    }
    else {
        // If you're on any other server, tell everyone to go away.
        Robots::addDisallow('*');
    }

    return Response::make(Robots::generate(), 200, ['Content-Type' => 'text/plain']);
});

Hard Coded

Add a rule in your .htaccess for robots.txt that points to a new script (or something else) that generate the robots file., (*9)

The code would look something like:, (*10)

require_once __DIR__ . '/../vendor/autoload.php';

use Arcanedev\Robots\Robots;

$robots = new Robots;

$robots->addUserAgent('Google');
$robots->addDisallow(['/admin/', '/login/', '/secret/']);
$robots->addSpacer();
$robots->addSitemap('sitemap.xml');

header('HTTP/1.1 200 OK');
echo $robots->generate();

TODOS

  • [ ] Documentation

DONE

  • [x] Framework agnostic package.
  • [x] Examples
  • [x] Laravel v4.2 Support.
  • [x] Laravel v5.0 Support.
  • [x] Laravel v5.1 Support.

Contribution

Any ideas are welcome. Feel free to submit any issues or pull requests, please check the contribution guidelines., (*11)

The Versions

23/10 2015

dev-master

9999999-dev https://github.com/ARCANEDEV/Robots

Robots.txt generator

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel arcanedev robots

23/10 2015

2.0.0

2.0.0.0 https://github.com/ARCANEDEV/Robots

Robots.txt generator

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel arcanedev robots

23/10 2015

dev-laravel-4.2

dev-laravel-4.2 https://github.com/ARCANEDEV/Robots

Robots.txt generator

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel arcanedev robots

23/10 2015

1.0.1

1.0.1.0 https://github.com/ARCANEDEV/Robots

Robots.txt generator

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel arcanedev robots

14/05 2015

1.0.0

1.0.0.0

Robots.txt generator

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel robots