megaads-vn/anti-crawl

反爬虫模块

dev-master 2018-01-10 04:13 UTC

This package is not auto-updated.

Last update: 2024-09-18 23:16:32 UTC


README

需要redis 此包使用 https://github.com/nicolasff/phpredis PHP 扩展,请在继续之前确保已安装。 ## 安装

composer require megaads-vn/anti-crawl

### 或者 在 composer.json 文件中添加

"require": {
	"megaads-vn/anti-crawl":"dev-master"
}

为 yii1 的配置

    'components' => array(
        "antiCrawl"=>array(
            "class" => "application.vendor.megaads-vn.anti-crawl.src.RequestLimits",
	    "hostname" => "127.0.0.1",
            "port" => 6379,
            "database" => 1,
            "prefix" => "Yii.redis."
        )
    )

为 yii1 使用

$isOk = Yii::app()->antiCrawl->check();