CC-5781: Upgrade script for new storage quota implementation

Upgrade script for saas only
This commit is contained in:
drigato 2014-04-08 12:12:42 -04:00
parent bbc81be1d3
commit 65b7c7ee05
1 changed files with 6 additions and 3 deletions
install_minimal/upgrades/airtime-2.5.3

View File

@ -16,9 +16,12 @@ class StorageQuotaUpgrade
->findOne();
$storPath = $musicDir->getDirectory();
$freeSpace = disk_free_space($storPath);
$totalSpace = disk_total_space($storPath);
$f = $storPath;
$io = popen('/usr/bin/du -bs ' . $f, 'r');
$size = fgets($io, 4096);
$size = substr($size, 0, strpos($size, "\t"));
pclose($io);
Application_Model_Preference::setDiskUsage($totalSpace - $freeSpace);
Application_Model_Preference::setDiskUsage($size);
}
}