This commit is contained in:
frytimo
2025-04-04 11:24:51 -06:00
committed by GitHub
10 changed files with 1314 additions and 393 deletions
+9 -8
View File
@@ -2,8 +2,6 @@
/**
* cache class provides an abstracted cache
*
* @method string glob
*/
class file {
@@ -12,12 +10,17 @@ class file {
*/
public $recursive;
public $files;
private $settings;
/**
* Called when the object is created
* @param settings $settings Settings object
*/
public function __construct() {
//place holder
public function __construct($settings = null) {
if ($settings === null) {
$settings = new settings();
}
$this->settings = $settings;
}
/**
@@ -66,8 +69,8 @@ class file {
if (!isset($voice)) { $voice = 'callie'; }
//set the variables
if (!empty($_SESSION['switch']['sounds']['dir']) && file_exists($_SESSION['switch']['sounds']['dir'])) {
$dir = $_SESSION['switch']['sounds']['dir'].'/'.$language.'/'.$dialect.'/'.$voice;
if (!empty($this->settings->get('switch', 'sounds')) && file_exists($this->settings->get('switch', 'sounds'))) {
$dir = $this->settings->get('switch', 'sounds').'/'.$language.'/'.$dialect.'/'.$voice;
$rate = '8000';
$files = $this->glob($dir.'/*/'.$rate, true);
}
@@ -93,5 +96,3 @@ class file {
$files = $file->sounds();
print_r($files);
*/
?>
+16
View File
@@ -110,6 +110,22 @@ class settings implements clear_cache {
return $this->database;
}
/**
* Returns the domain_uuid that was used to load the settings
* @return string domain_uuid or an empty string
*/
public function domain_uuid(): string {
return $this->domain_uuid;
}
/**
* Returns the user_uuid that was used to load the settings
* @return string user_uuid or an empty string
*/
public function user_uuid(): string {
return $this->user_uuid;
}
/**
* Reloads the settings from the database
*/