From bfb52d24ac950787373e3a11a068b824ecef6f00 Mon Sep 17 00:00:00 2001 From: M_Viper Date: Sun, 10 Mar 2024 15:25:31 +0000 Subject: [PATCH] Dateien nach "includes/PHPExcel/Classes/PHPExcel/CalcEngine" hochladen --- .../CalcEngine/CyclicReferenceStack.php | 98 +++++++++++ .../Classes/PHPExcel/CalcEngine/Logger.php | 153 ++++++++++++++++++ 2 files changed, 251 insertions(+) create mode 100644 includes/PHPExcel/Classes/PHPExcel/CalcEngine/CyclicReferenceStack.php create mode 100644 includes/PHPExcel/Classes/PHPExcel/CalcEngine/Logger.php diff --git a/includes/PHPExcel/Classes/PHPExcel/CalcEngine/CyclicReferenceStack.php b/includes/PHPExcel/Classes/PHPExcel/CalcEngine/CyclicReferenceStack.php new file mode 100644 index 0000000..5cd0b90 --- /dev/null +++ b/includes/PHPExcel/Classes/PHPExcel/CalcEngine/CyclicReferenceStack.php @@ -0,0 +1,98 @@ +_stack); + } + + /** + * Push a new entry onto the stack + * + * @param mixed $value + */ + public function push($value) { + $this->_stack[$value] = $value; + } + + /** + * Pop the last entry from the stack + * + * @return mixed + */ + public function pop() { + return array_pop($this->_stack); + } + + /** + * Test to see if a specified entry exists on the stack + * + * @param mixed $value The value to test + */ + public function onStack($value) { + return isset($this->_stack[$value]); + } + + /** + * Clear the stack + */ + public function clear() { + $this->_stack = array(); + } + + /** + * Return an array of all entries on the stack + * + * @return mixed[] + */ + public function showStack() { + return $this->_stack; + } + +} diff --git a/includes/PHPExcel/Classes/PHPExcel/CalcEngine/Logger.php b/includes/PHPExcel/Classes/PHPExcel/CalcEngine/Logger.php new file mode 100644 index 0000000..fe43ae4 --- /dev/null +++ b/includes/PHPExcel/Classes/PHPExcel/CalcEngine/Logger.php @@ -0,0 +1,153 @@ +_cellStack = $stack; + } + + /** + * Enable/Disable Calculation engine logging + * + * @param boolean $pValue + */ + public function setWriteDebugLog($pValue = FALSE) { + $this->_writeDebugLog = $pValue; + } + + /** + * Return whether calculation engine logging is enabled or disabled + * + * @return boolean + */ + public function getWriteDebugLog() { + return $this->_writeDebugLog; + } + + /** + * Enable/Disable echoing of debug log information + * + * @param boolean $pValue + */ + public function setEchoDebugLog($pValue = FALSE) { + $this->_echoDebugLog = $pValue; + } + + /** + * Return whether echoing of debug log information is enabled or disabled + * + * @return boolean + */ + public function getEchoDebugLog() { + return $this->_echoDebugLog; + } + + /** + * Write an entry to the calculation engine debug log + */ + public function writeDebugLog() { + // Only write the debug log if logging is enabled + if ($this->_writeDebugLog) { + $message = implode(func_get_args()); + $cellReference = implode(' -> ', $this->_cellStack->showStack()); + if ($this->_echoDebugLog) { + echo $cellReference, + ($this->_cellStack->count() > 0 ? ' => ' : ''), + $message, + PHP_EOL; + } + $this->_debugLog[] = $cellReference . + ($this->_cellStack->count() > 0 ? ' => ' : '') . + $message; + } + } // function _writeDebug() + + /** + * Clear the calculation engine debug log + */ + public function clearLog() { + $this->_debugLog = array(); + } // function flushLogger() + + /** + * Return the calculation engine debug log + * + * @return string[] + */ + public function getLog() { + return $this->_debugLog; + } // function flushLogger() + +} // class PHPExcel_CalcEngine_Logger +