CC-2279: Upgrade script for converting stor directory to new format
-upgrade script needs access to db
This commit is contained in:
parent
ce81f0c8fb
commit
65250bd2c9
|
@ -77,6 +77,21 @@ function updateAirtimeImportSymLink(){
|
||||||
exec("ln -s $dir /usr/bin/airtime-import");
|
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
|
/* 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
|
* init.d daemon system. Let's remove all the daemontools files
|
||||||
*/
|
*/
|
||||||
|
@ -126,6 +141,7 @@ CopyUtils();
|
||||||
removeOldAirtimeImport();
|
removeOldAirtimeImport();
|
||||||
updateAirtimeImportSymLink();
|
updateAirtimeImportSymLink();
|
||||||
|
|
||||||
|
connectToDatabase();
|
||||||
|
|
||||||
if(AirtimeInstall::DbTableExists('doctrine_migration_versions') === false) {
|
if(AirtimeInstall::DbTableExists('doctrine_migration_versions') === false) {
|
||||||
$migrations = array('20110312121200', '20110331111708', '20110402164819', '20110406182005');
|
$migrations = array('20110312121200', '20110331111708', '20110402164819', '20110406182005');
|
||||||
|
|
Loading…
Reference in New Issue