Service/Storage/DoctrineCache.php 1 location
|
@@ 16-25 (lines=10) @@
|
| 13 |
|
$this->client = $client; |
| 14 |
|
} |
| 15 |
|
|
| 16 |
|
public function getRateInfo($key) { |
| 17 |
|
$info = $this->client->fetch($key); |
| 18 |
|
|
| 19 |
|
$rateLimitInfo = new RateLimitInfo(); |
| 20 |
|
$rateLimitInfo->setLimit($info['limit']); |
| 21 |
|
$rateLimitInfo->setCalls($info['calls']); |
| 22 |
|
$rateLimitInfo->setResetTimestamp($info['reset']); |
| 23 |
|
|
| 24 |
|
return $rateLimitInfo; |
| 25 |
|
} |
| 26 |
|
|
| 27 |
|
public function limitRate($key) { |
| 28 |
|
$info = $this->client->fetch($key); |
Service/Storage/Memcache.php 1 location
|
@@ 18-28 (lines=11) @@
|
| 15 |
|
$this->client = $client; |
| 16 |
|
} |
| 17 |
|
|
| 18 |
|
public function getRateInfo($key) |
| 19 |
|
{ |
| 20 |
|
$info = $this->client->get($key); |
| 21 |
|
|
| 22 |
|
$rateLimitInfo = new RateLimitInfo(); |
| 23 |
|
$rateLimitInfo->setLimit($info['limit']); |
| 24 |
|
$rateLimitInfo->setCalls($info['calls']); |
| 25 |
|
$rateLimitInfo->setResetTimestamp($info['reset']); |
| 26 |
|
|
| 27 |
|
return $rateLimitInfo; |
| 28 |
|
} |
| 29 |
|
|
| 30 |
|
public function limitRate($key) |
| 31 |
|
{ |
Service/Storage/SimpleCache.php 1 location
|
@@ 64-72 (lines=9) @@
|
| 61 |
|
return true; |
| 62 |
|
} |
| 63 |
|
|
| 64 |
|
private function createRateInfo(array $info) |
| 65 |
|
{ |
| 66 |
|
$rateLimitInfo = new RateLimitInfo(); |
| 67 |
|
$rateLimitInfo->setLimit($info['limit']); |
| 68 |
|
$rateLimitInfo->setCalls($info['calls']); |
| 69 |
|
$rateLimitInfo->setResetTimestamp($info['reset']); |
| 70 |
|
|
| 71 |
|
return $rateLimitInfo; |
| 72 |
|
} |
| 73 |
|
} |
| 74 |
|
|