From 661ab7f647b631015e21646e81158acc0170df9e Mon Sep 17 00:00:00 2001 From: drigato Date: Wed, 9 Apr 2014 12:32:20 -0400 Subject: [PATCH] CC-5781: Upgrade script for new storage quota implementation Copied upgrade files to public folder. Seeing if we can execute the scripts with a URL --- airtime_mvc/public/DbUpgrade.php | 24 +++++++++++++++++++ airtime_mvc/public/StorageQuotaUpgrade.php | 27 ++++++++++++++++++++++ airtime_mvc/public/airtime-upgrade.php | 16 +++++++++++++ airtime_mvc/public/data/upgrade.sql | 6 +++++ 4 files changed, 73 insertions(+) create mode 100644 airtime_mvc/public/DbUpgrade.php create mode 100644 airtime_mvc/public/StorageQuotaUpgrade.php create mode 100644 airtime_mvc/public/airtime-upgrade.php create mode 100644 airtime_mvc/public/data/upgrade.sql diff --git a/airtime_mvc/public/DbUpgrade.php b/airtime_mvc/public/DbUpgrade.php new file mode 100644 index 000000000..dbfef98c5 --- /dev/null +++ b/airtime_mvc/public/DbUpgrade.php @@ -0,0 +1,24 @@ +&1 | grep -v \"will create implicit index\""); + } +} diff --git a/airtime_mvc/public/StorageQuotaUpgrade.php b/airtime_mvc/public/StorageQuotaUpgrade.php new file mode 100644 index 000000000..595861087 --- /dev/null +++ b/airtime_mvc/public/StorageQuotaUpgrade.php @@ -0,0 +1,27 @@ +filterByType('stor') + ->filterByExists(true) + ->findOne(); + $storPath = $musicDir->getDirectory(); + + $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($size); + } +} diff --git a/airtime_mvc/public/airtime-upgrade.php b/airtime_mvc/public/airtime-upgrade.php new file mode 100644 index 000000000..ef10d54de --- /dev/null +++ b/airtime_mvc/public/airtime-upgrade.php @@ -0,0 +1,16 @@ +