| @@ 421-436 (lines=16) @@ | ||
| 418 | * @return driverStatistic |
|
| 419 | * @throws PDOException |
|
| 420 | */ |
|
| 421 | public function getStats() |
|
| 422 | { |
|
| 423 | $stat = new driverStatistic(); |
|
| 424 | $path = $this->getFilePath(false); |
|
| 425 | ||
| 426 | if (!is_dir($path)) { |
|
| 427 | throw new phpFastCacheDriverException("Can't read PATH:" . $path, 94); |
|
| 428 | } |
|
| 429 | ||
| 430 | $stat->setData(implode(', ', array_keys($this->itemInstances))) |
|
| 431 | ->setRawData([]) |
|
| 432 | ->setSize(Directory::dirSize($path)) |
|
| 433 | ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($path)); |
|
| 434 | ||
| 435 | return $stat; |
|
| 436 | } |
|
| 437 | ||
| 438 | /** |
|
| 439 | * @return array |
|
| @@ 227-242 (lines=16) @@ | ||
| 224 | * @throws \phpFastCache\Exceptions\phpFastCacheCoreException |
|
| 225 | * @throws \phpFastCache\Exceptions\phpFastCacheDriverException |
|
| 226 | */ |
|
| 227 | public function getStats() |
|
| 228 | { |
|
| 229 | $stat = new driverStatistic(); |
|
| 230 | $path = $this->getFilePath(false); |
|
| 231 | ||
| 232 | if (!is_dir($path)) { |
|
| 233 | throw new phpFastCacheDriverException("Can't read PATH:" . $path, 94); |
|
| 234 | } |
|
| 235 | ||
| 236 | $stat->setData(implode(', ', array_keys($this->itemInstances))) |
|
| 237 | ->setRawData([]) |
|
| 238 | ->setSize(Directory::dirSize($path)) |
|
| 239 | ->setInfo('Number of files used to build the cache: ' . Directory::getFileCount($path)); |
|
| 240 | ||
| 241 | return $stat; |
|
| 242 | } |
|
| 243 | } |
|