|
5 | 5 | * @package PHPDebugConsole |
6 | 6 | * @author Brad Kent <bkfake-github@yahoo.com> |
7 | 7 | * @license http://opensource.org/licenses/MIT MIT |
8 | | - * @version v1.2 |
| 8 | + * @version v1.2.1 |
9 | 9 | * |
10 | 10 | * @link http://www.github.com/bkdotcom/PHPDebugConsole |
11 | 11 | * @link https://developer.mozilla.org/en-US/docs/Web/API/console |
@@ -170,7 +170,7 @@ public function error() |
170 | 170 | */ |
171 | 171 | public function get($path) |
172 | 172 | { |
173 | | - $path = $this->translateCfgKeys($path); |
| 173 | + $path = $this->utilities->translateCfgKeys($path); |
174 | 174 | $path = preg_split('#[\./]#', $path); |
175 | 175 | if (isset($this->{$path[0]}) && is_object($this->{$path[0]}) && isset($path[1])) { |
176 | 176 | // child class config value |
@@ -359,7 +359,7 @@ public function set($path, $newVal = null) |
359 | 359 | { |
360 | 360 | $ret = null; |
361 | 361 | $new = array(); |
362 | | - $path = $this->translateCfgKeys($path); |
| 362 | + $path = $this->utilities->translateCfgKeys($path); |
363 | 363 | if (is_string($path)) { |
364 | 364 | $ret = $this->get($path); |
365 | 365 | // build $new array from the passed string |
@@ -515,7 +515,7 @@ public function time($label = null) |
515 | 515 | * If label is not passed, timer is removed from no-label tack |
516 | 516 | * |
517 | 517 | * @param string $label unique label |
518 | | - * @param boolean $return = false. If true, only return elapsed time rather than log it |
| 518 | + * @param boolean $return = false. If true, only return time, rather than log it |
519 | 519 | * |
520 | 520 | * @return float |
521 | 521 | */ |
@@ -548,7 +548,7 @@ public function timeEnd($label = null, $return = false) |
548 | 548 | * Get the running time without stopping/pausing the timer |
549 | 549 | * |
550 | 550 | * @param string $label unique label |
551 | | - * @param boolean $return = false. If true, only return elapsed time rather than log it |
| 551 | + * @param boolean $return = false. If true, only return time, rather than log it |
552 | 552 | * @param integer $precision rounding precision (pass null for no rounding) |
553 | 553 | * |
554 | 554 | * @return float |
@@ -702,6 +702,7 @@ protected function appendLog($method, $args) |
702 | 702 | // path if via ErrorHandler : |
703 | 703 | // ErrorHandler::handleUnsuppressed -> call_user_function -> self::onError -> self::warn -> here we are |
704 | 704 | $viaErrorHandler = isset($backtrace[4]) |
| 705 | + && isset($backtrace[4]['class']) |
705 | 706 | && $backtrace[4]['class'] == 'bdk\Debug\ErrorHandler' |
706 | 707 | && $backtrace[4]['function'] == 'handleUnsuppressed' |
707 | 708 | && $backtrace[3]['function'] == 'call_user_func' |
@@ -790,56 +791,4 @@ protected function appendLogFile($args) |
790 | 791 | } |
791 | 792 | return; |
792 | 793 | } |
793 | | - |
794 | | - /** |
795 | | - * translate configuration keys |
796 | | - * |
797 | | - * @param mixed $mixed string key or config array |
798 | | - * |
799 | | - * @return mixed |
800 | | - */ |
801 | | - protected function translateCfgKeys($mixed) |
802 | | - { |
803 | | - $objKeys = array( |
804 | | - 'varDump' => array('addBR'), |
805 | | - 'errorHandler' => array('lastError'), |
806 | | - 'output' => array( |
807 | | - 'css', 'filepathCss', 'filepathScript', 'firephpInc', 'firephpOptions', |
808 | | - 'onOutput', 'outputAs', 'outputCss', 'outputScript', |
809 | | - ), |
810 | | - ); |
811 | | - if (is_string($mixed)) { |
812 | | - $path = preg_split('#[\./]#', $mixed); |
813 | | - foreach ($objKeys as $objKey => $keys) { |
814 | | - if (in_array($path[0], $keys)) { |
815 | | - array_unshift($path, $objKey); |
816 | | - break; |
817 | | - } |
818 | | - } |
819 | | - if (count($path)==1) { |
820 | | - array_unshift($path, 'debug'); |
821 | | - } |
822 | | - $mixed = implode('/', $path); |
823 | | - } elseif (is_array($mixed)) { |
824 | | - foreach ($mixed as $k => $v) { |
825 | | - if (is_array($v)) { |
826 | | - continue; |
827 | | - } |
828 | | - $translated = false; |
829 | | - foreach ($objKeys as $objKey => $keys) { |
830 | | - if (in_array($k, $keys)) { |
831 | | - unset($mixed[$k]); |
832 | | - $mixed[$objKey][$k] = $v; |
833 | | - $translated = true; |
834 | | - break; |
835 | | - } |
836 | | - } |
837 | | - if (!$translated) { |
838 | | - unset($mixed[$k]); |
839 | | - $mixed['debug'][$k] = $v; |
840 | | - } |
841 | | - } |
842 | | - } |
843 | | - return $mixed; |
844 | | - } |
845 | 794 | } |
0 commit comments