123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <?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;
- }
- }
|