Merge branch 'devel' of dev.sourcefabric.org:airtime into devel
This commit is contained in:
commit
0e6ac15bae
2 changed files with 30 additions and 6 deletions
|
@ -63,10 +63,6 @@ if (isset($version) && ($version != false) && ($version == AIRTIME_VERSION) && !
|
|||
if (isset($version) && ($version != false) && ($version < AIRTIME_VERSION) && !isset($opts->r)) {
|
||||
echo "Airtime version $version found.".PHP_EOL;
|
||||
|
||||
echo "It appears you already have a version of Airtime installed.\n";
|
||||
echo "Upgrading is currently disabled for Airtime 1.9.0-beta1.\n";
|
||||
exit(2);
|
||||
|
||||
require_once("airtime-upgrade.php");
|
||||
|
||||
//Make sure to exit with non-zero error code so that airtime-install
|
||||
|
|
|
@ -77,6 +77,21 @@ function updateAirtimeImportSymLink(){
|
|||
exec("ln -s $dir /usr/bin/airtime-import");
|
||||
}
|
||||
|
||||
function connectToDatabase(){
|
||||
global $CC_DBC, $CC_CONFIG;
|
||||
|
||||
$values = parse_ini_file('/etc/airtime/airtime.conf', true);
|
||||
|
||||
// Database config
|
||||
$CC_CONFIG['dsn']['username'] = $values['database']['dbuser'];
|
||||
$CC_CONFIG['dsn']['password'] = $values['database']['dbpass'];
|
||||
$CC_CONFIG['dsn']['hostspec'] = $values['database']['host'];
|
||||
$CC_CONFIG['dsn']['phptype'] = 'pgsql';
|
||||
$CC_CONFIG['dsn']['database'] = $values['database']['dbname'];
|
||||
|
||||
$CC_DBC = DB::connect($CC_CONFIG['dsn'], FALSE);
|
||||
}
|
||||
|
||||
/* In version 1.9.0 we have have switched from daemontools to more traditional
|
||||
* init.d daemon system. Let's remove all the daemontools files
|
||||
*/
|
||||
|
@ -121,12 +136,25 @@ InstallAirtimePhpServerCode($phpDir);
|
|||
UninstallBinaries();
|
||||
CopyUtils();
|
||||
|
||||
//James's made a new airtime-import script, lets remove the old airtime-import php script,
|
||||
//install the new airtime-import.py script and update the /usr/bin/symlink.
|
||||
removeOldAirtimeImport();
|
||||
updateAirtimeImportSymLink();
|
||||
|
||||
connectToDatabase();
|
||||
|
||||
if(AirtimeInstall::DbTableExists('doctrine_migration_versions') === false) {
|
||||
$migrations = array('20110312121200', '20110331111708', '20110402164819', '20110406182005');
|
||||
foreach($migrations as $migration) {
|
||||
AirtimeInstall::BypassMigrations(__DIR__, $migration);
|
||||
}
|
||||
}
|
||||
//alter cc_files, add a new column named "directory" of type "int".
|
||||
AirtimeInstall::MigrateTablesToVersion(__DIR__, '20110629143017');
|
||||
|
||||
//create cron file for phone home stat
|
||||
AirtimeInstall::CreateCronFile();
|
||||
|
||||
|
||||
//need to change database because old format had full path while new database has partial paths
|
||||
//also need to add new column
|
||||
//old database had a "fullpath" column that stored the absolute path of each track. We have to
|
||||
//change it so that the "fullpath" column has
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue