From 767937260d34af7e834bd67b480a5d35df35aba2 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 8 Jul 2022 14:21:29 -0600 Subject: [PATCH] Limit this to run only with the web server. --- resources/classes/cache.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/resources/classes/cache.php b/resources/classes/cache.php index 9f5b402fc7..22867809d6 100644 --- a/resources/classes/cache.php +++ b/resources/classes/cache.php @@ -107,9 +107,11 @@ class cache { public function delete($key) { //debug information - openlog("fusionpbx", LOG_PID | LOG_PERROR, LOG_LOCAL0); - syslog(LOG_WARNING, "debug: cache: [key: ".$key.", script: ".$_SERVER['SCRIPT_NAME'].", line: ".__line__."]"); - closelog(); + if (!defined('STDIN')) { + openlog("fusionpbx", LOG_PID | LOG_PERROR, LOG_LOCAL0); + syslog(LOG_WARNING, "debug: cache: [key: ".$key.", script: ".$_SERVER['SCRIPT_NAME'].", line: ".__line__."]"); + closelog(); + } //cache method memcache if ($_SESSION['cache']['method']['text'] == "memcache") { @@ -173,9 +175,11 @@ class cache { public function flush() { //debug information - openlog("fusionpbx", LOG_PID | LOG_PERROR, LOG_LOCAL0); - syslog(LOG_WARNING, "debug: cache: [flush: all, script: ".$_SERVER['SCRIPT_NAME'].", line: ".__line__."]"); - closelog(); + if (!defined('STDIN')) { + openlog("fusionpbx", LOG_PID | LOG_PERROR, LOG_LOCAL0); + syslog(LOG_WARNING, "debug: cache: [flush: all, script: ".$_SERVER['SCRIPT_NAME'].", line: ".__line__."]"); + closelog(); + } //cache method memcache if ($_SESSION['cache']['method']['text'] == "memcache") {