Merge branch 'cc-5709-airtime-analyzer' of github.com:sourcefabric/Airtime into cc-5709-airtime-analyzer
This commit is contained in:
commit
312cf57154
2
CREDITS
2
CREDITS
|
@ -2,7 +2,7 @@
|
|||
CREDITS
|
||||
=======
|
||||
|
||||
Version 2.5.1
|
||||
Version 2.5.3
|
||||
|
||||
Albert Santoni (albert.santoni@sourcefabric.org)
|
||||
Role: Developer Team Lead
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
<?php
|
||||
|
||||
define('AIRTIME_VERSION', '2.5.1');
|
||||
define('AIRTIME_VERSION', '2.5.3');
|
||||
|
|
|
@ -102,4 +102,8 @@ if (strcmp($version, "2.5.1") < 0) {
|
|||
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.5.1/airtime-upgrade.php");
|
||||
pause();
|
||||
}
|
||||
if (strcmp($version, "2.5.3") < 0) {
|
||||
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.5.3/airtime-upgrade.php");
|
||||
pause();
|
||||
}
|
||||
echo "******************************* Upgrade Complete *******************************".PHP_EOL;
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
|
||||
// Define path to application directory
|
||||
defined('APPLICATION_PATH')
|
||||
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../../install_minimal/../airtime_mvc/application'));
|
||||
|
||||
// Ensure library/ is on include_path
|
||||
set_include_path(implode(PATH_SEPARATOR, array(
|
||||
get_include_path(),
|
||||
realpath(APPLICATION_PATH . '/../library')
|
||||
)));
|
||||
|
||||
/*set_include_path(implode(PATH_SEPARATOR, array(
|
||||
get_include_path(),
|
||||
realpath(APPLICATION_PATH . '/../library/propel/runtime/lib')
|
||||
)));*/
|
||||
|
||||
//Propel classes.
|
||||
set_include_path(APPLICATION_PATH . '/models' . PATH_SEPARATOR . get_include_path());
|
||||
set_include_path(APPLICATION_PATH . '/models/airtime' . PATH_SEPARATOR . get_include_path());
|
||||
set_include_path(APPLICATION_PATH . '/models/om' . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
require_once 'propel/runtime/lib/Propel.php';
|
||||
require_once 'CcMusicDirsQuery.php';
|
||||
#require_once 'BaseCcMusicDirsQuery.php';
|
||||
|
||||
class StorageQuotaUpgrade
|
||||
{
|
||||
public static function startUpgrade()
|
||||
{
|
||||
echo "* Updating storage usage for new quota tracking".PHP_EOL;
|
||||
self::setStorageUsage();
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
|
@ -1,8 +1,10 @@
|
|||
<?php
|
||||
|
||||
require_once 'DbUpgrade.php';
|
||||
require_once 'StorageQuotaUpgrade.php';
|
||||
|
||||
$filename = "/etc/airtime/airtime.conf";
|
||||
$values = parse_ini_file($filename, true);
|
||||
|
||||
AirtimeDatabaseUpgrade::start($values);
|
||||
StorageQuotaUpgrade::startUpgrade();
|
||||
|
|
Loading…
Reference in New Issue