diff --git a/airtime_mvc/public/setup/database-setup.php b/airtime_mvc/public/setup/database-setup.php index f09b3a7ed..c26878687 100644 --- a/airtime_mvc/public/setup/database-setup.php +++ b/airtime_mvc/public/setup/database-setup.php @@ -7,9 +7,9 @@ * Wrapper class for validating and installing the Airtime database during the installation process */ class DatabaseSetup extends Setup { - + // airtime.conf section header - protected static $_settings = "[database]"; + protected static $_section = "[database]"; // Constant form field names for passing errors back to the front-end const DB_USER = "dbUser", @@ -51,6 +51,7 @@ class DatabaseSetup extends Setup { * @throws AirtimeDatabaseException */ public function runSetup() { + $this->writeToTemp(); try { $this->setNewDatabaseConnection("postgres"); if ($this->checkDatabaseExists()) { @@ -61,14 +62,11 @@ class DatabaseSetup extends Setup { $this->installDatabaseTables(); } } catch (PDOException $e) { - throw new AirtimeDatabaseException("Couldn't establish a connection to the database! " - . "Please check your credentials and try again. " + throw new AirtimeDatabaseException("Couldn't establish a connection to the database! ". + "Please check your credentials and try again. " . "PDO Exception: " . $e->getMessage(), array(self::DB_NAME, self::DB_USER, self::DB_PASS)); } - - $this->writeToTemp(); - self::$dbh = null; return array( "message" => "Airtime database was created successfully!", @@ -178,4 +176,4 @@ class DatabaseSetup extends Setup { } } -} \ No newline at end of file +} diff --git a/airtime_mvc/public/setup/media-setup.php b/airtime_mvc/public/setup/media-setup.php index 8fce8ba53..5e91341db 100644 --- a/airtime_mvc/public/setup/media-setup.php +++ b/airtime_mvc/public/setup/media-setup.php @@ -104,7 +104,7 @@ class MediaSetup extends Setup { function setupMusicDirectory() { try { $_SERVER['AIRTIME_CONF'] = AIRTIME_CONF_TEMP_PATH; - Propel::init(CONFIG_PATH . "airtime-conf-production.php"); + Propel::init(AIRTIME_CONF_TEMP_PATH); $con = Propel::getConnection(); } catch(Exception $e) { self::$message = "Failed to insert media folder; database isn't configured properly!"; diff --git a/airtime_mvc/public/setup/setup-functions.php b/airtime_mvc/public/setup/setup-functions.php index 0851bdd06..37c179693 100644 --- a/airtime_mvc/public/setup/setup-functions.php +++ b/airtime_mvc/public/setup/setup-functions.php @@ -1,6 +1,6 @@ _write(AIRTIME_CONF_TEMP_PATH); }