mirror of
https://github.com/manualdousuario/marreta.git
synced 2025-09-02 02:30:20 +00:00
contar apenas arquivos .gz
This commit is contained in:
parent
5da034322c
commit
aee8e584cd
1 changed files with 11 additions and 3 deletions
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
namespace Inc\Cache;
|
namespace Inc\Cache;
|
||||||
|
|
||||||
|
use Redis;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redis-based cache storage implementation
|
* Redis-based cache storage implementation
|
||||||
* Implementação de armazenamento de cache baseado em Redis
|
* Implementação de armazenamento de cache baseado em Redis
|
||||||
|
@ -73,9 +75,15 @@ class RedisStorage implements CacheStorageInterface
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If Redis is not available or key is empty, count files
|
// If Redis is not available or key is empty, count .gz files
|
||||||
// Se Redis não estiver disponível ou chave vazia, conta os arquivos
|
// Se Redis não estiver disponível ou chave vazia, conta arquivos .gz
|
||||||
$fileCount = iterator_count(new \FilesystemIterator($this->cacheDir));
|
$fileCount = 0;
|
||||||
|
$iterator = new \FilesystemIterator($this->cacheDir);
|
||||||
|
foreach ($iterator as $file) {
|
||||||
|
if ($file->isFile() && $file->getExtension() === 'gz') {
|
||||||
|
$fileCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// If Redis is available, save the count
|
// If Redis is available, save the count
|
||||||
// Se Redis estiver disponível, salva a contagem
|
// Se Redis estiver disponível, salva a contagem
|
||||||
|
|
Loading…
Add table
Reference in a new issue