Simplify configuration file structure
This removes most of the legacy upstream config madness by not using weird config files spread all over the place. This isn't the solution to other config reading fragility issues, but it does move the whole config back to the central airtime.conf file.
This commit is contained in:
parent
320b128ad8
commit
fa2018a2c5
14 changed files with 46 additions and 106 deletions
|
@ -26,7 +26,6 @@ class MediaSetup extends Setup {
|
|||
|
||||
const MEDIA_FOLDER = "mediaFolder";
|
||||
const LIBRETIME_CONF_FILE_NAME = "airtime.conf";
|
||||
const RMQ_INI_FILE_NAME = "rabbitmq-analyzer.ini";
|
||||
|
||||
static $path;
|
||||
static $message = null;
|
||||
|
@ -66,10 +65,6 @@ class MediaSetup extends Setup {
|
|||
self::$message = "Error moving airtime.conf or deleting /tmp/airtime.conf.temp!";
|
||||
self::$errors[] = "ERR";
|
||||
}
|
||||
if (!$this->moveRmqConfig()) {
|
||||
self::$message = "Error moving rabbitmq-analyzer.ini or deleting /tmp/rabbitmq.ini.tmp!";
|
||||
self::$errors[] = "ERR";
|
||||
}
|
||||
|
||||
/*
|
||||
* If we're upgrading from an old Airtime instance (pre-2.5.2) we rename their old
|
||||
|
@ -102,16 +97,6 @@ class MediaSetup extends Setup {
|
|||
&& unlink(AIRTIME_CONF_TEMP_PATH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Moves /tmp/airtime.conf.temp to /etc/airtime.conf and then removes it to complete setup
|
||||
* @return boolean false if either of the copy or removal operations fail
|
||||
*/
|
||||
function moveRmqConfig() {
|
||||
return copy(RMQ_INI_TEMP_PATH, LIBRETIME_CONF_DIR . '/' . self::RMQ_INI_FILE_NAME)
|
||||
&& copy(RMQ_INI_TEMP_PATH, LIBRETIME_CONF_DIR . '/production/' . self::RMQ_INI_FILE_NAME)
|
||||
&& unlink(RMQ_INI_TEMP_PATH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the given directory to cc_music_dirs
|
||||
* TODO Should we check for an existing entry in cc_music_dirs?
|
||||
|
@ -156,4 +141,4 @@ class MediaSetup extends Setup {
|
|||
return isset($entry) && $entry;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue