mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 19:53:56 +00:00
Update settings class
This commit is contained in:
@@ -114,6 +114,8 @@ class settings implements clear_cache {
|
|||||||
* Reloads the settings from the database
|
* Reloads the settings from the database
|
||||||
*/
|
*/
|
||||||
public function reload() {
|
public function reload() {
|
||||||
|
|
||||||
|
//clear settings
|
||||||
$this->settings = [];
|
$this->settings = [];
|
||||||
|
|
||||||
//set the default settings
|
//set the default settings
|
||||||
@@ -121,6 +123,8 @@ class settings implements clear_cache {
|
|||||||
|
|
||||||
//set the domain settings
|
//set the domain settings
|
||||||
if (!empty($this->domain_uuid)) {
|
if (!empty($this->domain_uuid)) {
|
||||||
|
|
||||||
|
//get the domain settings
|
||||||
$this->domain_settings();
|
$this->domain_settings();
|
||||||
|
|
||||||
//set the user settings only when the domain_uuid was set
|
//set the user settings only when the domain_uuid was set
|
||||||
@@ -295,8 +299,21 @@ class settings implements clear_cache {
|
|||||||
* Update the internal settings array with the domain settings from the database
|
* Update the internal settings array with the domain settings from the database
|
||||||
* @access private
|
* @access private
|
||||||
*/
|
*/
|
||||||
private function domain_settings() {
|
private function domain_settings($domain_uuid = '', $i = 0) {
|
||||||
$key = 'settings_domain_'.$this->domain_uuid;
|
if (empty($domain_uuid)) {
|
||||||
|
$domain_uuid = $this->domain_uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
$uuid = '';
|
||||||
|
if (class_exists('domain')) {
|
||||||
|
$uuid = domain::get_uuid($this->database, $domain_uuid);
|
||||||
|
}
|
||||||
|
if (!empty($uuid) && $i < 3) {
|
||||||
|
$this->domain_settings($uuid, $i++);
|
||||||
|
}
|
||||||
|
|
||||||
|
$key = 'settings_domain_'.$domain_uuid;
|
||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
//if the apcu extension is loaded get the cached database result
|
//if the apcu extension is loaded get the cached database result
|
||||||
if ($this->apcu_enabled && apcu_exists($key)) {
|
if ($this->apcu_enabled && apcu_exists($key)) {
|
||||||
@@ -305,7 +322,7 @@ class settings implements clear_cache {
|
|||||||
$sql = "select * from v_domain_settings ";
|
$sql = "select * from v_domain_settings ";
|
||||||
$sql .= "where domain_uuid = :domain_uuid ";
|
$sql .= "where domain_uuid = :domain_uuid ";
|
||||||
$sql .= "and domain_setting_enabled = true ";
|
$sql .= "and domain_setting_enabled = true ";
|
||||||
$parameters['domain_uuid'] = $this->domain_uuid;
|
$parameters['domain_uuid'] = $domain_uuid;
|
||||||
$result = $this->database->select($sql, $parameters, 'all');
|
$result = $this->database->select($sql, $parameters, 'all');
|
||||||
//if the apcu extension is loaded store the result
|
//if the apcu extension is loaded store the result
|
||||||
if ($this->apcu_enabled) {
|
if ($this->apcu_enabled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user