-Allow etc and stor directories to be configurable
This commit is contained in:
parent
ac50c279f7
commit
a55b47efff
|
@ -8,7 +8,9 @@
|
|||
* that the user can customize these.
|
||||
*/
|
||||
|
||||
$ini = parse_ini_file('/etc/airtime/airtime.conf', true);
|
||||
|
||||
$configFile = isset($_SERVER['AIRTIME_CONF']) ? $_SERVER['AIRTIME_CONF'] : "/etc/airtime/airtime.conf";
|
||||
$ini = parse_ini_file($configFile, true);
|
||||
|
||||
$dbhost = $ini['database']['host'];
|
||||
$dbname = $ini['database']['dbname'];
|
||||
|
|
|
@ -23,7 +23,9 @@ $CC_CONFIG = array(
|
|||
'phingPath' => dirname(__FILE__).'/../../library/phing'
|
||||
);
|
||||
|
||||
Config::loadConfig("/etc/airtime/airtime.conf");
|
||||
|
||||
$configFile = isset($_SERVER['AIRTIME_CONF']) ? $_SERVER['AIRTIME_CONF'] : "/etc/airtime/airtime.conf";
|
||||
Config::loadConfig($configFile);
|
||||
|
||||
// Add database table names
|
||||
$CC_CONFIG['playListTable'] = $CC_CONFIG['tblNamePrefix'].'playlist';
|
||||
|
|
|
@ -7,7 +7,9 @@ class RabbitMqPlugin extends Zend_Controller_Plugin_Abstract
|
|||
if (Application_Model_RabbitMq::$doPush) {
|
||||
$md = array('schedule' => Application_Model_Schedule::GetScheduledPlaylists());
|
||||
Application_Model_RabbitMq::SendMessageToPypo("update_schedule", $md);
|
||||
Application_Model_RabbitMq::SendMessageToShowRecorder("update_schedule");
|
||||
if (!isset($_SERVER['AIRTIME_SRV'])){
|
||||
Application_Model_RabbitMq::SendMessageToShowRecorder("update_schedule");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -409,11 +409,13 @@ class Application_Model_StoredFile {
|
|||
* @return string
|
||||
*/
|
||||
public function getFilePath()
|
||||
{
|
||||
{
|
||||
$music_dir = Application_Model_MusicDir::getDirByPK($this->_file->getDbDirectory());
|
||||
$directory = $music_dir->getDirectory();
|
||||
|
||||
$filepath = $this->_file->getDbFilepath();
|
||||
|
||||
return $music_dir->getDirectory().$filepath;
|
||||
return $directory.$filepath;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -877,8 +879,13 @@ class Application_Model_StoredFile {
|
|||
|
||||
$audio_stor = $stor . DIRECTORY_SEPARATOR . $fileName;
|
||||
|
||||
$r = @copy($audio_file, $audio_stor);
|
||||
$r = @unlink($audio_file);
|
||||
Logging::log("copyFileToStor: moving file $audio_file to $audio_stor");
|
||||
|
||||
//Martin K.: changed to rename: Much less load + quicker since this is an atomic operation
|
||||
$r = @rename($audio_file, $audio_stor);
|
||||
|
||||
//$r = @copy($audio_file, $audio_stor);
|
||||
//$r = @unlink($audio_file);
|
||||
}
|
||||
|
||||
public static function getFileCount()
|
||||
|
|
Loading…
Reference in New Issue