Merge branch '2.1.x' into devel
This commit is contained in:
commit
f029124447
13 changed files with 231 additions and 143 deletions
|
@ -1,3 +1,3 @@
|
|||
<?php
|
||||
|
||||
define('AIRTIME_VERSION', '2.1.1');
|
||||
define('AIRTIME_VERSION', '2.1.2');
|
||||
|
|
|
@ -108,5 +108,9 @@ if (strcmp($version, "2.1.1") < 0){
|
|||
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.1/airtime-upgrade.php");
|
||||
pause();
|
||||
}
|
||||
if (strcmp($version, "2.1.2") < 0){
|
||||
passthru("php --php-ini $SCRIPTPATH/../airtime-php.ini $SCRIPTPATH/../upgrades/airtime-2.1.2/airtime-upgrade.php");
|
||||
pause();
|
||||
}
|
||||
|
||||
echo "******************************* Upgrade Complete *******************************".PHP_EOL;
|
||||
|
|
|
@ -7,11 +7,11 @@ class AirtimeDatabaseUpgrade{
|
|||
|
||||
public static function start($p_dbValues){
|
||||
echo "* Updating Database".PHP_EOL;
|
||||
self::task0($p_dbValues);
|
||||
self::runUpgradeScript($p_dbValues);
|
||||
echo " * Complete".PHP_EOL;
|
||||
}
|
||||
|
||||
private static function task0($p_dbValues){
|
||||
private static function runUpgradeScript($p_dbValues){
|
||||
|
||||
$username = $p_dbValues['database']['dbuser'];
|
||||
$password = $p_dbValues['database']['dbpass'];
|
||||
|
|
24
install_minimal/upgrades/airtime-2.1.2/DbUpgrade.php
Normal file
24
install_minimal/upgrades/airtime-2.1.2/DbUpgrade.php
Normal file
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
|
||||
/* All functions other than start() should be marked as
|
||||
* private.
|
||||
*/
|
||||
class AirtimeDatabaseUpgrade{
|
||||
|
||||
public static function start($p_dbValues){
|
||||
echo "* Updating Database".PHP_EOL;
|
||||
self::task0($p_dbValues);
|
||||
echo " * Complete".PHP_EOL;
|
||||
}
|
||||
|
||||
private static function task0($p_dbValues){
|
||||
|
||||
$username = $p_dbValues['database']['dbuser'];
|
||||
$password = $p_dbValues['database']['dbpass'];
|
||||
$host = $p_dbValues['database']['host'];
|
||||
$database = $p_dbValues['database']['dbname'];
|
||||
$dir = __DIR__;
|
||||
|
||||
passthru("export PGPASSWORD=$password && psql -h $host -U $username -q -f $dir/data/upgrade.sql $database 2>&1 | grep -v \"will create implicit index\"");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
require_once 'DbUpgrade.php';
|
||||
|
||||
$filename = "/etc/airtime/airtime.conf";
|
||||
$values = parse_ini_file($filename, true);
|
||||
|
||||
AirtimeDatabaseUpgrade::start($values);
|
2
install_minimal/upgrades/airtime-2.1.2/data/upgrade.sql
Normal file
2
install_minimal/upgrades/airtime-2.1.2/data/upgrade.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
DELETE FROM cc_pref WHERE keystr = 'system_version';
|
||||
INSERT INTO cc_pref (keystr, valstr) VALUES ('system_version', '2.1.2');
|
Loading…
Add table
Add a link
Reference in a new issue