mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-08-03 01:25:21 +02:00
refactor: logger (#3678)
This commit is contained in:
parent
360f953be8
commit
7329b83cc0
30 changed files with 297 additions and 338 deletions
|
@ -4,10 +4,14 @@ declare(strict_types=1);
|
|||
|
||||
class FileCache implements CacheInterface
|
||||
{
|
||||
private Logger $logger;
|
||||
private array $config;
|
||||
|
||||
public function __construct(array $config = [])
|
||||
{
|
||||
public function __construct(
|
||||
Logger $logger,
|
||||
array $config = []
|
||||
) {
|
||||
$this->logger = $logger;
|
||||
$default = [
|
||||
'path' => null,
|
||||
'enable_purge' => true,
|
||||
|
@ -28,7 +32,7 @@ class FileCache implements CacheInterface
|
|||
}
|
||||
$item = unserialize(file_get_contents($cacheFile));
|
||||
if ($item === false) {
|
||||
Logger::warning(sprintf('Failed to unserialize: %s', $cacheFile));
|
||||
$this->logger->warning(sprintf('Failed to unserialize: %s', $cacheFile));
|
||||
$this->delete($key);
|
||||
return $default;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue