added configuration for PHP Coding Standards Fixer, including its fixes, resolving #47
This commit is contained in:
@@ -119,7 +119,7 @@ abstract class AbstractPersistence
|
||||
protected static function _store($filename, $data)
|
||||
{
|
||||
self::_initialize();
|
||||
$file = self::$_path . DIRECTORY_SEPARATOR . $filename;
|
||||
$file = self::$_path . DIRECTORY_SEPARATOR . $filename;
|
||||
$writtenBytes = @file_put_contents($file, $data, LOCK_EX);
|
||||
if ($writtenBytes === false || $writtenBytes < strlen($data)) {
|
||||
throw new Exception('unable to write to file ' . $file, 13);
|
||||
|
||||
@@ -72,8 +72,8 @@ class PurgeLimiter extends AbstractPersistence
|
||||
return true;
|
||||
}
|
||||
|
||||
$file = 'purge_limiter.php';
|
||||
$now = time();
|
||||
$file = 'purge_limiter.php';
|
||||
$now = time();
|
||||
$content = '<?php' . PHP_EOL . '$GLOBALS[\'purge_limiter\'] = ' . $now . ';' . PHP_EOL;
|
||||
if (!self::_exists($file)) {
|
||||
self::_store($file, $content);
|
||||
|
||||
@@ -114,7 +114,7 @@ class TrafficLimiter extends AbstractPersistence
|
||||
$path = self::getPath($file);
|
||||
require $path;
|
||||
$now = time();
|
||||
$tl = $GLOBALS['traffic_limiter'];
|
||||
$tl = $GLOBALS['traffic_limiter'];
|
||||
|
||||
// purge file of expired hashes to keep it small
|
||||
foreach ($tl as $key => $time) {
|
||||
@@ -129,7 +129,7 @@ class TrafficLimiter extends AbstractPersistence
|
||||
$result = false;
|
||||
} else {
|
||||
$tl[$hash] = time();
|
||||
$result = true;
|
||||
$result = true;
|
||||
}
|
||||
self::_store(
|
||||
$file,
|
||||
|
||||
Reference in New Issue
Block a user