Fix cache's settings object
This commit is contained in:
@@ -289,6 +289,14 @@
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Location for the file cache.";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "55e9def3-f8d4-4201-84b7-3b30cb4f21ab";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "cache";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "syslog";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_name'] = "boolean";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_value'] = "false";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_description'] = "Log cache requests to syslog.";
|
||||
$y++;
|
||||
$apps[$x]['default_settings'][$y]['default_setting_uuid'] = "31b60c5f-e501-4982-893b-b56ef4ef5b56";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_category'] = "log";
|
||||
$apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "enabled";
|
||||
|
||||
@@ -24,23 +24,9 @@ class cache {
|
||||
|
||||
//get the settings
|
||||
$this->settings = $settings;
|
||||
$this->method = $this->setting('method');
|
||||
$this->syslog = $this->setting('syslog');
|
||||
$this->location = $this->setting('location');
|
||||
$this->method = 'file';
|
||||
$this->syslog = 'false';
|
||||
$this->location = '/var/cache/fusionpbx';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a specific cache setting from the settings array.
|
||||
*
|
||||
* @param string $subcategory The subcategory of the cache setting to retrieve.
|
||||
*
|
||||
* @return mixed The value of the specified cache setting, or null if it does not exist.
|
||||
*/
|
||||
private function setting($subcategory) {
|
||||
return $this->settings->get('cache', $subcategory);
|
||||
$this->method = $this->settings->get('cache', 'method', 'file');
|
||||
$this->syslog = $this->settings->get('cache', 'syslog', false);
|
||||
$this->location = $this->settings->get('cache', 'location', '/var/cache/fusionpbx');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -131,7 +117,7 @@ class cache {
|
||||
public function delete($key) {
|
||||
|
||||
//debug information
|
||||
if ($this->syslog === "true") {
|
||||
if ($this->syslog == true) {
|
||||
openlog("fusionpbx", LOG_PID | LOG_PERROR, LOG_USER);
|
||||
syslog(LOG_WARNING, "debug: cache: [key: " . $key . ", script: " . $_SERVER['SCRIPT_NAME'] . ", line: " . __line__ . "]");
|
||||
closelog();
|
||||
@@ -204,7 +190,7 @@ class cache {
|
||||
public function flush() {
|
||||
|
||||
//debug information
|
||||
if ($this->syslog === "true") {
|
||||
if ($this->syslog == true) {
|
||||
openlog("fusionpbx", LOG_PID | LOG_PERROR, LOG_USER);
|
||||
syslog(LOG_WARNING, "debug: cache: [flush: all, script: " . $_SERVER['SCRIPT_NAME'] . ", line: " . __line__ . "]");
|
||||
closelog();
|
||||
|
||||
Reference in New Issue
Block a user