Update app_defaults.php

This commit is contained in:
Alex 2025-03-14 13:23:12 -07:00 committed by GitHub
parent d965cf629a
commit 950b545ad6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 8 deletions

View File

@ -28,9 +28,9 @@ if ($domains_processed == 1) {
//create phrases folder and add include line in xml for each language found
/*
if (!empty($setting->get('switch','languages'))) {
if (is_readable($setting->get('switch','languages'))) {
$conf_lang_folders = glob($setting->get('switch','languages')."/*");
if (!empty($settings->get('switch','languages'))) {
if (is_readable($settings->get('switch','languages'))) {
$conf_lang_folders = glob($settings->get('switch','languages')."/*");
foreach ($conf_lang_folders as $conf_lang_folder) {
//create phrases folder, if necessary
if (!file_exists($conf_lang_folder."/phrases/")) {
@ -65,7 +65,7 @@ if ($domains_processed == 1) {
*/
//if base64, convert existing incompatible phrases
if (!empty($setting->get('recordings','storage_type')) && $setting->get('recordings','storage_type') == 'base64') {
if (!empty($settings->get('recordings','storage_type')) && $settings->get('recordings','storage_type') == 'base64') {
$sql = "select phrase_detail_uuid, phrase_detail_data ";
$sql .= "from v_phrase_details where phrase_detail_function = 'play-file' ";
$result = $database->select($sql, null, 'all');
@ -73,8 +73,8 @@ if ($domains_processed == 1) {
foreach ($result as $index => $row) {
$phrase_detail_uuid = $row['phrase_detail_uuid'];
$phrase_detail_data = $row['phrase_detail_data'];
if (substr_count($phrase_detail_data, $setting->get('switch','recordings').'/'.$domain_name) > 0) {
$phrase_detail_data = str_replace($setting->get('switch','recordings').'/'.$domain_name.'/', '', $phrase_detail_data);
if (substr_count($phrase_detail_data, $settings->get('switch','recordings').'/'.$domain_name) > 0) {
$phrase_detail_data = str_replace($settings->get('switch','recordings').'/'.$domain_name.'/', '', $phrase_detail_data);
}
//update function and data to be base64 compatible
$phrase_detail_data = "lua(streamfile.lua ".$phrase_detail_data.")";
@ -98,7 +98,7 @@ if ($domains_processed == 1) {
}
//if not base64, revert base64 phrases to standard method
else if (!empty($setting->get('recordings','storage_type')) && $setting->get('recordings','storage_type') != 'base64') {
else if (!empty($settings->get('recordings','storage_type')) && $settings->get('recordings','storage_type') != 'base64') {
$sql = "select phrase_detail_uuid, phrase_detail_data ";
$sql .= "from v_phrase_details where ";
$sql .= "phrase_detail_function = 'execute' ";
@ -112,7 +112,7 @@ if ($domains_processed == 1) {
$phrase_detail_data = str_replace('lua(streamfile.lua ', '', $phrase_detail_data);
$phrase_detail_data = str_replace(')', '', $phrase_detail_data);
if (substr_count($phrase_detail_data, '/') === 0) {
$phrase_detail_data = $setting->get('switch','recordings').'/'.$domain_name.'/'.$phrase_detail_data;
$phrase_detail_data = $settings->get('switch','recordings').'/'.$domain_name.'/'.$phrase_detail_data;
}
$array['phrase_details'][$index]['phrase_detail_uuid'] = $phrase_detail_uuid;
$array['phrase_details'][$index]['phrase_detail_function'] = 'play-file';