mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
Add last calculated cache size to Dashboard Storage chart (#1580)
issue #1580 Add last calculated cache size to Dashboard Storage chart Size of cached files with all derivatives and representatives may be as large as all image files, actually doubling the needed storage size. So it may be nice to see it represented in the storage chart, if one remembers to occasionally recalculate it under Tools -> Maintenance.. Also make it possible to deactivate this setting.
This commit is contained in:
@@ -443,6 +443,19 @@ if (isset($result[0]['SUM(filesize)']))
|
||||
$data_storage['Formats'] = $result[0]['SUM(filesize)'];
|
||||
}
|
||||
|
||||
// Add cache size if requested and known.
|
||||
if ($conf['add_cache_to_storage_chart'] && isset($conf['cache_sizes']))
|
||||
{
|
||||
$cache_sizes = unserialize($conf['cache_sizes']);
|
||||
if (isset($cache_sizes))
|
||||
{
|
||||
if (isset($cache_sizes[0]) && isset($cache_sizes[0]['value']))
|
||||
{
|
||||
$data_storage['Cache'] = $cache_sizes[0]['value']/1024;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Calculate total storage
|
||||
$total_storage = 0;
|
||||
foreach ($data_storage as $value)
|
||||
|
||||
Reference in New Issue
Block a user