CC-2256 Airtime-upgrade.php does not upgrade the web app
put back in code as it got deleted during a merge a while ago.
This commit is contained in:
parent
91caaf2c0f
commit
073f539f09
|
@ -34,9 +34,15 @@ if(strcmp($version, "1.7.0") < 0) {
|
|||
if(strcmp($version, "1.8.0") < 0) {
|
||||
system("php ".__DIR__."/upgrades/airtime-1.8/airtime-upgrade.php");
|
||||
}
|
||||
if (strcmp($version, "1.9.0") < 0){
|
||||
system("php ".__DIR__."/upgrades/airtime-1.9/airtime-upgrade.php");
|
||||
if(strcmp($version, "1.8.1") < 0) {
|
||||
system("php ".__DIR__."/upgrades/airtime-1.8.1/airtime-upgrade.php");
|
||||
}
|
||||
if(strcmp($version, "1.8.2") < 0) {
|
||||
system("php ".__DIR__."/upgrades/airtime-1.8.2/airtime-upgrade.php");
|
||||
}
|
||||
//if (strcmp($version, "1.9.0") < 0){
|
||||
//system("php ".__DIR__."/upgrades/airtime-1.9/airtime-upgrade.php");
|
||||
//}
|
||||
|
||||
AirtimeInstall::SetAirtimeVersion(AIRTIME_VERSION);
|
||||
|
||||
|
|
|
@ -184,4 +184,39 @@ class AirtimeIni
|
|||
AirtimeIni::UpdateIniValue(AirtimeIni::CONF_FILE_MEDIAMONITOR, 'api_key', "'$api_key'");
|
||||
AirtimeIni::UpdateIniValue(AirtimeInstall::CONF_DIR_WWW.'/build/build.properties', 'project.home', AirtimeInstall::CONF_DIR_WWW);
|
||||
}
|
||||
|
||||
public static function MergeConfigFiles($configFiles, $suffix) {
|
||||
foreach ($configFiles as $conf) {
|
||||
if (file_exists("$conf$suffix.bak")) {
|
||||
|
||||
if($conf === CONF_FILE_AIRTIME) {
|
||||
// Parse with sections
|
||||
$newSettings = parse_ini_file($conf, true);
|
||||
$oldSettings = parse_ini_file("$conf$suffix.bak", true);
|
||||
}
|
||||
else {
|
||||
$newSettings = AirtimeIni::ReadPythonConfig($conf);
|
||||
$oldSettings = AirtimeIni::ReadPythonConfig("$conf$suffix.bak");
|
||||
}
|
||||
|
||||
$settings = array_keys($newSettings);
|
||||
|
||||
foreach($settings as $section) {
|
||||
if(isset($oldSettings[$section])) {
|
||||
if(is_array($oldSettings[$section])) {
|
||||
$sectionKeys = array_keys($newSettings[$section]);
|
||||
foreach($sectionKeys as $sectionKey) {
|
||||
if(isset($oldSettings[$section][$sectionKey])) {
|
||||
AirtimeIni::UpdateIniValue($conf, $sectionKey, $oldSettings[$section][$sectionKey]);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
AirtimeIni::UpdateIniValue($conf, $section, $oldSettings[$section]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
/**
|
||||
* @package Airtime
|
||||
* @subpackage StorageServer
|
||||
* @copyright 2010 Sourcefabric O.P.S.
|
||||
* @license http://www.gnu.org/licenses/gpl.txt
|
||||
*/
|
||||
|
||||
set_include_path(__DIR__.'/../../../airtime_mvc/library' . PATH_SEPARATOR . get_include_path());
|
||||
require_once __DIR__.'/../../../airtime_mvc/application/configs/conf.php';
|
||||
require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php');
|
||||
require_once(dirname(__FILE__).'/../../include/AirtimeIni.php');
|
||||
|
||||
const CONF_FILE_AIRTIME = "/etc/airtime/airtime.conf";
|
||||
const CONF_FILE_PYPO = "/etc/airtime/pypo.cfg";
|
||||
const CONF_FILE_RECORDER = "/etc/airtime/recorder.cfg";
|
||||
const CONF_FILE_LIQUIDSOAP = "/etc/airtime/liquidsoap.cfg";
|
||||
|
||||
$configFiles = array(CONF_FILE_AIRTIME,
|
||||
CONF_FILE_PYPO,
|
||||
CONF_FILE_RECORDER,
|
||||
CONF_FILE_LIQUIDSOAP);
|
||||
|
||||
$suffix = date("Ymdhis");
|
||||
foreach ($configFiles as $conf) {
|
||||
if (file_exists($conf)) {
|
||||
echo "Backing up $conf to $conf$suffix.bak".PHP_EOL;
|
||||
exec("cp $conf $conf$suffix.bak");
|
||||
}
|
||||
}
|
||||
|
||||
AirtimeIni::CreateIniFiles();
|
||||
echo "* Initializing INI files".PHP_EOL;
|
||||
AirtimeIni::MergeConfigFiles($configFiles, $suffix);
|
||||
Config::reload_config();
|
||||
|
||||
AirtimeInstall::InstallPhpCode();
|
||||
AirtimeInstall::InstallBinaries();
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
/**
|
||||
* @package Airtime
|
||||
* @subpackage StorageServer
|
||||
* @copyright 2010 Sourcefabric O.P.S.
|
||||
* @license http://www.gnu.org/licenses/gpl.txt
|
||||
*/
|
||||
|
||||
set_include_path(__DIR__.'/../../../airtime_mvc/library' . PATH_SEPARATOR . get_include_path());
|
||||
require_once __DIR__.'/../../../airtime_mvc/application/configs/conf.php';
|
||||
require_once(dirname(__FILE__).'/../../include/AirtimeInstall.php');
|
||||
require_once(dirname(__FILE__).'/../../include/AirtimeIni.php');
|
||||
|
||||
const CONF_FILE_AIRTIME = "/etc/airtime/airtime.conf";
|
||||
const CONF_FILE_PYPO = "/etc/airtime/pypo.cfg";
|
||||
const CONF_FILE_RECORDER = "/etc/airtime/recorder.cfg";
|
||||
const CONF_FILE_LIQUIDSOAP = "/etc/airtime/liquidsoap.cfg";
|
||||
|
||||
$configFiles = array(CONF_FILE_AIRTIME,
|
||||
CONF_FILE_PYPO,
|
||||
CONF_FILE_RECORDER,
|
||||
CONF_FILE_LIQUIDSOAP);
|
||||
|
||||
$suffix = date("Ymdhis");
|
||||
foreach ($configFiles as $conf) {
|
||||
if (file_exists($conf)) {
|
||||
echo "Backing up $conf to $conf$suffix.bak".PHP_EOL;
|
||||
exec("cp $conf $conf$suffix.bak");
|
||||
}
|
||||
}
|
||||
|
||||
AirtimeIni::CreateIniFiles();
|
||||
echo "* Initializing INI files".PHP_EOL;
|
||||
AirtimeIni::MergeConfigFiles($configFiles, $suffix);
|
||||
Config::reload_config();
|
||||
|
||||
AirtimeInstall::InstallPhpCode();
|
||||
AirtimeInstall::InstallBinaries();
|
Loading…
Reference in New Issue