From d58468185cc1172012f24b919de3aca1d5dcda6c Mon Sep 17 00:00:00 2001 From: Robb Ebright Date: Mon, 13 Nov 2017 11:39:11 -0500 Subject: [PATCH 1/2] Made rabbitmq settings write to tempfile upon check to fix install bug --- airtime_mvc/build/airtime-setup/forms/rabbitmq-settings.php | 2 +- airtime_mvc/public/setup/rabbitmq-setup.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/build/airtime-setup/forms/rabbitmq-settings.php b/airtime_mvc/build/airtime-setup/forms/rabbitmq-settings.php index 052956b0f..3fba10baf 100644 --- a/airtime_mvc/build/airtime-setup/forms/rabbitmq-settings.php +++ b/airtime_mvc/build/airtime-setup/forms/rabbitmq-settings.php @@ -10,7 +10,7 @@

RabbitMQ Settings

- RabbitMQ is an AMQP-based messaging system used by Airtime. You should only edit these settings + RabbitMQ is an AMQP-based messaging system used by Libretime. You should only edit these settings if you have changed the defaults since running the installer, or if you've opted to install RabbitMQ manually.

diff --git a/airtime_mvc/public/setup/rabbitmq-setup.php b/airtime_mvc/public/setup/rabbitmq-setup.php index 53a09d787..21c26d28d 100644 --- a/airtime_mvc/public/setup/rabbitmq-setup.php +++ b/airtime_mvc/public/setup/rabbitmq-setup.php @@ -50,7 +50,6 @@ class RabbitMQSetup extends Setup { } catch(Exception $e) { $this->identifyRMQConnectionError(); } - return array( "message" => self::$message, "errors" => self::$errors @@ -63,6 +62,7 @@ class RabbitMQSetup extends Setup { self::$_properties["user"], self::$_properties["password"], self::$_properties["vhost"]); + $this->writeToTemp(); return isset($conn); } From b89f159fe80c65dc201a58ff58032d686cb17a95 Mon Sep 17 00:00:00 2001 From: Robb Ebright Date: Mon, 13 Nov 2017 15:03:15 -0500 Subject: [PATCH 2/2] modified the database code to allow custom pgsql password --- airtime_mvc/public/setup/database-setup.php | 14 ++++++-------- airtime_mvc/public/setup/media-setup.php | 2 +- airtime_mvc/public/setup/setup-functions.php | 4 ++-- 3 files changed, 9 insertions(+), 11 deletions(-) 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); }