devhamidreza/ratelimitredis

There is no license information available for the latest version (dev-main) of this package.

simple rate limit use Redis

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/devhamidreza/ratelimitredis

dev-main 2024-09-06 13:47 UTC

This package is auto-updated.

Last update: 2025-10-06 16:10:06 UTC


README

simple RateLimit Class use Redis

<?php

use RateLimit\RateLimit;
use RateLimit\SpamDetector;

require_once 'vendor/autoload.php';

$rateLimit = new RateLimit();
$spamDetector = new SpamDetector();

$isLimited = $rateLimit->isLimited('index');

if($isLimited){
    die('You are blocked');
}

$id = '12';
$isSpam = $spamDetector->isSpam($id);

if ($isSpam) {
    die('Please do not spam' );
}

echo "welcome";