From d47469be2576fadc1f002815213d51d2f953d24c Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 25 Jan 2013 16:36:57 -0500 Subject: [PATCH] read num bytes used from file instead of calculating manually --- airtime_mvc/application/models/Systemstatus.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/airtime_mvc/application/models/Systemstatus.php b/airtime_mvc/application/models/Systemstatus.php index 8c7e242e6..efebfcbb7 100644 --- a/airtime_mvc/application/models/Systemstatus.php +++ b/airtime_mvc/application/models/Systemstatus.php @@ -217,10 +217,14 @@ class Application_Model_Systemstatus //connect to DB and find how much total space user has allocated. $totalSpace = Application_Model_Preference::GetDiskQuota(); - $storPath = Application_Model_MusicDir::getStorDir()->getDirectory(); - - list($usedSpace,) = preg_split("/[\s]+/", exec("du -bs $storPath")); + $path = $_SERVER['AIRTIME_BASE']."etc/airtime/num_bytes.ini"; + $arr = parse_ini_file($path); + $usedSpace = 0; + if ($arr !== false) { + $usedSpace = $arr['num_bytes']; + } + $partitions[$totalSpace]->totalSpace = $totalSpace; $partitions[$totalSpace]->totalFreeSpace = $totalSpace - $usedSpace; Logging::info($partitions[$totalSpace]->totalFreeSpace);