Upgrade action testing

This commit is contained in:
drigato 2014-04-16 17:27:15 -04:00
parent cd6c4f7ede
commit 456ac40fe6
1 changed files with 5 additions and 11 deletions
airtime_mvc/application/controllers

View File

@ -13,9 +13,9 @@ class UpgradeController extends Zend_Controller_Action
return;
}
if (!$this->verifyAirtimeVersion()) {
/*if (!$this->verifyAirtimeVersion()) {
return;
}
}*/
//Begin upgrade
$filename = isset($_SERVER['AIRTIME_CONF']) ? $_SERVER['AIRTIME_CONF'] : "/etc/airtime/airtime.conf";
@ -29,16 +29,10 @@ class UpgradeController extends Zend_Controller_Action
passthru("export PGPASSWORD=$password && psql -h $host -U $username -q -f $dir/upgrade_sql/airtime_$airtime_upgrade_version/upgrade.sql $database 2>&1 | grep -v \"will create implicit index\"");
$musicDir = CcMusicDirsQuery::create()
->filterByType('stor')
->filterByExists(true)
->findOne();
$storPath = $musicDir->getDirectory();
$storDir = isset($_SERVER['AIRTIME_BASE']) ? $_SERVER['AIRTIME_BASE']."srv/airtime/stor" : "/srv/airtime/stor";
$diskUsage = shell_exec("du -s $storDir | awk '{print $1}'");
$freeSpace = disk_free_space($storPath);
$totalSpace = disk_total_space($storPath);
Application_Model_Preference::setDiskUsage($totalSpace - $freeSpace);
Application_Model_Preference::setDiskUsage($diskUsage);
$this->getResponse()
->setHttpResponseCode(200)