limiter Limiter

  1. Documentation
  2. Change Log

This extension can set a limiter to user action. 为用户的某种操作设一个一个时间限制。

Documentation

Requirements
  • Yii 1.0 or above
Installation
  • Extract the release file under protected/components
  • Add componet 'limiter' in main.php
  • Create table [code] CREATE TABLE IF NOT EXISTS si_limit ( id int(11) unsigned NOT NULL AUTO_INCREMENT, action varchar(200) NOT NULL, hash varchar(32) NOT NULL, create_time int(10) unsigned NOT NULL, period int(10) unsigned NOT NULL, total_times smallint(5) unsigned NOT NULL, remain_times smallint(5) unsigned NOT NULL, PRIMARY KEY (id), UNIQUE KEY hash (hash) ) ; [/code]
Usage

See the following code example: ~~~ [code] Yii::app()->Limiter->check(actionName, $params, $period, $total_times); [/code]

[php] Yii::app()->Limiter->spend('actionName', $params); [/php]

Change Log

March 3, 2010
  • Initial release.
1 0
2 followers
587 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Others
Tags:
Developed by: dongbeta
Created on: Mar 3, 2010
Last updated: 14 years ago

Downloads

show all