CC-5781: Upgrade script for new storage quota implementation
This commit is contained in:
parent
770a51dccd
commit
6abe613a73
install_minimal/upgrades/airtime-2.5.3
|
@ -9,6 +9,15 @@ class StorageQuotaUpgrade
|
|||
|
||||
private static function setStorageUsage()
|
||||
{
|
||||
|
||||
$musicDir = CcMusicDirsQuery::create()
|
||||
->filterByDbType('stor')
|
||||
->filterByDbExists(true)
|
||||
->findOne();
|
||||
$storPath = $musicDir->getDbDirectory();
|
||||
|
||||
$freeSpace = disk_free_space($storPath);
|
||||
$totalSpace = disk_total_space($storPath);
|
||||
|
||||
Application_Model_Preference::setDiskUsage($totalSpace - $freeSpace);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue