Merge pull request #410 from dicobaja/patch/MR-cache-file

update path of monthly registered cache file
This commit is contained in:
iBNu Maksum 2025-03-19 14:18:44 +07:00 committed by GitHub
commit aa4dbc0cea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -6,7 +6,11 @@ class graph_monthly_registered_customers
{
global $CACHE_PATH,$ui;
$cacheMRfile = File::pathFixer('/monthlyRegistered.temp');
$cacheMRfile = $CACHE_PATH . File::pathFixer('/monthlyRegistered.temp');
//Compatibility for old path
if (file_exists($oldCacheMRfile = str_replace($CACHE_PATH, '', $cacheMRfile))) {
rename($oldCacheMRfile, $cacheMRfile);
}
//Cache for 1 hour
if (file_exists($cacheMRfile) && time() - filemtime($cacheMRfile) < 3600) {
$monthlyRegistered = json_decode(file_get_contents($cacheMRfile), true);