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
|
CREDITS
|
||||||
=======
|
=======
|
||||||
|
|
||||||
Version 2.5.1
|
Version 2.5.3
|
||||||
|
|
||||||
Albert Santoni (albert.santoni@sourcefabric.org)
|
Albert Santoni (albert.santoni@sourcefabric.org)
|
||||||
Role: Developer Team Lead
|
Role: Developer Team Lead
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1,2 +1,2 @@
|
||||||
PRODUCT_ID=Airtime
|
PRODUCT_ID=Airtime
|
||||||
PRODUCT_RELEASE=2.5.0
|
PRODUCT_RELEASE=2.5.3
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
<?php
|
<?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");
|
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.5.1/airtime-upgrade.php");
|
||||||
pause();
|
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;
|
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
|
<?php
|
||||||
|
|
||||||
require_once 'DbUpgrade.php';
|
require_once 'DbUpgrade.php';
|
||||||
|
require_once 'StorageQuotaUpgrade.php';
|
||||||
|
|
||||||
$filename = "/etc/airtime/airtime.conf";
|
$filename = "/etc/airtime/airtime.conf";
|
||||||
$values = parse_ini_file($filename, true);
|
$values = parse_ini_file($filename, true);
|
||||||
|
|
||||||
AirtimeDatabaseUpgrade::start($values);
|
AirtimeDatabaseUpgrade::start($values);
|
||||||
|
StorageQuotaUpgrade::startUpgrade();
|
||||||
|
|
Loading…
Reference in New Issue