Setup API requests limit system.

This commit is contained in:
Pierre HUBERT
2018-08-20 13:45:50 +02:00
parent fba6c796a8
commit 4c74b9c414
5 changed files with 188 additions and 17 deletions

16
helpers/APILimits.php Normal file
View File

@ -0,0 +1,16 @@
<?php
/**
* API Limits helper
*
* @author Pierre HUBERT
*/
/**
* Limit the number of time a query can be performed by a client
*
* @param string $name The name of the action to limit
* @param bool $trigger Count this as an action of the user or not
*/
function api_limit_query(string $name, bool $trigger){
cs()->limit->limit_query($name, $trigger);
}