From 1654de64b1510e657119fa9d4525778831108a0f Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Fri, 20 Apr 2012 16:10:19 -0400 Subject: [PATCH] CC-1927: remove-pear-db -fixed install/uninstall messages --- install_minimal/include/AirtimeInstall.php | 10 ++++++++++ install_minimal/include/airtime-uninstall.php | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/install_minimal/include/AirtimeInstall.php b/install_minimal/include/AirtimeInstall.php index 107a002da..9b7038a82 100644 --- a/install_minimal/include/AirtimeInstall.php +++ b/install_minimal/include/AirtimeInstall.php @@ -60,6 +60,16 @@ class AirtimeInstall return null; } + try { + $version = $con->query($sql)->fetchColumn(0); + } catch (PDOException $e){ + // no pref table therefore Airtime is not installed. + //We only get here if airtime database exists, but the table doesn't + //This state sometimes happens if a previous Airtime uninstall couldn't remove + //the database because it was busy, so it just removed the tables instead. + return null; + } + $sql = "SELECT valstr FROM cc_pref WHERE keystr = 'system_version' LIMIT 1"; $version = $con->query($sql)->fetchColumn(0); diff --git a/install_minimal/include/airtime-uninstall.php b/install_minimal/include/airtime-uninstall.php index 0bfc38b63..8bd929851 100644 --- a/install_minimal/include/airtime-uninstall.php +++ b/install_minimal/include/airtime-uninstall.php @@ -18,6 +18,10 @@ if (!file_exists(AirtimeIni::CONF_FILE_AIRTIME)) { require_once(__DIR__.'/airtime-constants.php'); require_once(AirtimeInstall::GetAirtimeSrcDir().'/application/configs/conf.php'); + +require_once 'propel/runtime/lib/Propel.php'; +Propel::init(AirtimeInstall::GetAirtimeSrcDir()."/application/configs/airtime-conf-production.php"); + echo PHP_EOL; echo "* Uninstalling Airtime ".AIRTIME_VERSION.PHP_EOL; //AirtimeInstall::UninstallPhpCode();