From ffc1ac43f5091f3930fe0baae886b743717c2d69 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Tue, 10 Oct 2017 14:06:21 -0400 Subject: [PATCH] put back disk space in header, more debug in caching storagea --- web/includes/Storage.php | 2 ++ web/skins/classic/includes/functions.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/web/includes/Storage.php b/web/includes/Storage.php index 45bcfc0c0..252be9309 100644 --- a/web/includes/Storage.php +++ b/web/includes/Storage.php @@ -9,6 +9,7 @@ class Storage { if ( is_integer( $IdOrRow ) or is_numeric( $IdOrRow ) ) { if ( isset( $storage_cache[$IdOrRow] ) ) { +Logger::Debug("Using cached Storage object for $IdOrRow"); return $storage_cache[$IdOrRow]; } else { $row = dbFetchOne( 'SELECT * FROM Storage WHERE Id=?', NULL, array( $IdOrRow ) ); @@ -68,6 +69,7 @@ class Storage { $results = $result->fetchALL(PDO::FETCH_CLASS | PDO::FETCH_PROPS_LATE, 'Storage' ); foreach ( $results as $row => $obj ) { $storage_areas[] = $obj; + $storage_cache[$obj->Id()] = $obj; } return $storage_areas; } diff --git a/web/skins/classic/includes/functions.php b/web/skins/classic/includes/functions.php index 6698e2054..82e668111 100644 --- a/web/skins/classic/includes/functions.php +++ b/web/skins/classic/includes/functions.php @@ -257,7 +257,7 @@ ZoneMinder requires Javascript. Please enable Javascript in your browser for thi array_push( $storage_areas, new Storage() ); } $func = function($S){ return ''.$S->Name() . ': ' . $S->disk_usage_percent().'%' . ''; }; - $func = function($S){ return ''.$S->Name() . ': ' . $S->disk_usage_percent().'%' . ''; }; + #$func = function($S){ return ''.$S->Name() . ': ' . $S->disk_usage_percent().'%' . ''; }; echo implode( ', ', array_map ( $func, $storage_areas ) ); echo ' ' . ZM_PATH_MAP .': '. getDiskPercent(ZM_PATH_MAP).'%'; ?>