123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- <?php
- class PHPExcel_CalcEngine_Logger {
-
- private $_writeDebugLog = FALSE;
-
- private $_echoDebugLog = FALSE;
-
- private $_debugLog = array();
-
- private $_cellStack;
-
-
- public function __construct(PHPExcel_CalcEngine_CyclicReferenceStack $stack) {
- $this->_cellStack = $stack;
- }
-
- public function setWriteDebugLog($pValue = FALSE) {
- $this->_writeDebugLog = $pValue;
- }
-
- public function getWriteDebugLog() {
- return $this->_writeDebugLog;
- }
-
- public function setEchoDebugLog($pValue = FALSE) {
- $this->_echoDebugLog = $pValue;
- }
-
- public function getEchoDebugLog() {
- return $this->_echoDebugLog;
- }
-
- public function writeDebugLog() {
-
- 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;
- }
- }
-
- public function clearLog() {
- $this->_debugLog = array();
- }
-
- public function getLog() {
- return $this->_debugLog;
- }
- }
|