承接 jazzman/php-robots 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jazzman/php-robots

最新稳定版本:2.0.1

Composer 安装命令:

composer require jazzman/php-robots

包简介

Generator robots.txt

关键字:

README 文档

README

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 jazzman/php-robots

Or add the following to your composer.json in the require section and then run composer update to install it.

{
    "require": {
        "jazzman/php-robots": "2.0"
    }
}

Usage

default

use JazzMan\Robots\Robots;
use JazzMan\Robots\RobotsInterface;

Robots::getInstance()
    ->host("www.site.com")
    ->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

统计信息

  • 总下载量: 391
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-08-22