Lines Matching full:action
23 /** @var int Write action rate limit (more restrictive) */
26 /** @var int Write action time window */
77 * @param string $action Action type
80 private static function getRateFile($identifier, $action) { argument
81 $action = preg_replace('/[^a-z0-9_]/', '', strtolower($action));
82 return self::getRateDir() . "{$identifier}_{$action}.rate";
88 * @param string $action Action being performed
89 * @param bool $isWrite Whether this is a write action
92 public static function check($action, $isWrite = false) { argument
97 $rateFile = self::getRateFile($identifier, $action);
130 self::logRateLimit($identifier, $action, count($data['requests']));
162 * @param string $action Action type
163 * @param bool $isWrite Whether this is a write action
166 public static function getRemaining($action, $isWrite = false) { argument
171 $rateFile = self::getRateFile($identifier, $action);
210 * Reset rate limit for a user/action
212 * @param string $action Action type
215 public static function reset($action, $identifier = null) { argument
220 $rateFile = self::getRateFile($identifier, $action);
254 * @param string $action Action that was limited
257 private static function logRateLimit($identifier, $action, $requests) { argument
259 …error_log("[Calendar RateLimiter] Rate limited: $identifier, action: $action, requests: $requests"…
266 * @param string $action Action type
267 * @param bool $isWrite Whether this is a write action
269 public static function addHeaders($action, $isWrite = false) { argument
270 $info = self::getRemaining($action, $isWrite);