Pass the debug to ChromePHP

@return void
970069
public function putChromePHP() {
		$ChromePHP = X\THEDEBUG::getChromePHP();
		$ChromePHP->backtrace = $this->file.': '.$this->line;
		$this->_improveVar();
		$args = array();

		if (!empty($this->name)) {
			$args[] = $this->name.':';
		}
		$args[] = $this->variable;

		call_user_func_array(
			array(
				$ChromePHP,
				$this->_getMethod()
			),
			$args
		);
	}
597732
public function setDebug($debugMode)
  {
    $this->_debug = $debugMode;
    if (isset($this->_connectionSwitcher)) {
      $this->_connectionSwitcher->setDebug($debugMode);
    }
  }
47751
public function setDebugLog()
	{
		$logConsole  = \Log::singleton( 'console', '', 'console',
			array(
				'lineFormat' => '%{timestamp} [%{priority}] %{message}',
				'timeFormat' => '%Y-%m-%d %H:%M:%S',
			)
		);

		$logError = \Log::singleton( 'error_log', PEAR_LOG_TYPE_SYSTEM, 'error_log',
			array(
				'lineFormat' => '[%{priority}] %{message}',
			)
		);

		$logComposite = Log::singleton( 'composite' );
		$logComposite->addChild( $logConsole );
		$logComposite->addChild( $logError );

		$this->setLog( $logComposite );
	}
973863
public static function create_debug_view(HTTPRequest $request = null)
    {
        $service = static::supportsHTML($request)
            ? DebugView::class
            : CliDebugView::class;
        return Injector::inst()->get($service);
    }
992103
public static function traceBegin()
    {
        $dbg = debug_backtrace();
        $str = '=> ';
        if (!empty ($dbg[1]['class'])) {
            $str .= $dbg[1]['class'] . '::';
        }
        $str .= $dbg[1]['function'] . '(';
        if (is_array($dbg[1]['args'])) {
            foreach ($dbg[1]['args'] as $index => $arg) {
                if ($index != 0) {
                    $str .= ', ';
                }
                if (is_object($arg)) {
                    $str .= get_class($arg);
                } else {
                    $str .= str_replace(array("\r\n", "\n", "\r"), "", var_export($arg, true));
                }
            }
        }
        if (isset($dbg[1]['file'])) {
            $file = basename($dbg[1]['file']);
        } else {
            $file = 'unknown_file';
        }
        if (isset($dbg[1]['line'])) {
            $line = $dbg[1]['line'];
        } else {
            $line = 'unknown_line';
        }
        $str .= ') [' . $file . ':' . $line . ']';
        phpCAS :: log($str);
        if (!isset(self::$_PHPCAS_DEBUG['indent'])) {
            self::$_PHPCAS_DEBUG['indent'] = 0;
        } else {
            self::$_PHPCAS_DEBUG['indent']++;
        }
    }
481706
protected function debug($query)
    {
        if ($this->options['debug_mode']) {
            if (($len = strlen($query)) > self::DEBUG_LINE_LENGTH) {
                $diff  = $len - self::DEBUG_LINE_LENGTH;
                $query = substr($query, 0, self::DEBUG_LINE_LENGTH)
                    . "... [truncated $diff bytes]";
            }
            rcube::write_log('sql', '[' . (++$this->db_index) . '] ' . $query . ';');
        }
    }
137084
private function debugDB(PDO $pdo): void
    {
        $debugDB = new TraceablePDO($pdo);
        Container::$app->get('debugbar')->addCollector(new PDOCollector($debugDB));
    }
1146064
function debug ( $_top = '' )
		{
			//	Prepare Template Content
			if (!$_top)
			{
				$_top  =  $this->data;
			}
			if (@include_once("class.smarttemplatedebugger.php"))
			{
				$this->debugger = new SmartTemplateDebugger($this->template_dir . $this->tpl_file);
				$this->debugger->start($_top);
			}
			else
			{
				exit( "SmartTemplate Error: Cannot find class.smarttemplatedebugger.php; check SmartTemplate installation");
			}
		}
171495
function (debug) {
  this.debug = debug;
  this.files = {};
  this.resolvers = [this.httpResolver, this.nullResolver];
  this.contentRetrievers = {
    'http': this.xhrRetriever,
    'https': this.xhrRetriever,
    'chrome-extension': this.xhrRetriever,
    'resource': this.xhrRetriever,
    'chrome': this.xhrRetriever,
    'app': this.xhrRetriever,
    'gopher': this.xhrRetriever,  // For Cordova; see http://crbug.com/513352 .
    'manifest': this.manifestRetriever
  };
}
1038200
public static function debug(array $args)
    {
        $label = '<div ondblclick="this.remove()" title="Double click to remove" style="cursor:pointer; position: relative; z-index: 999999; margin-top: 10px; box-shadow: 1px 1px 5px #ccc; font-family: Arial; background-color: rgba(255, 255, 0, 0.9); border: 1px dotted orange; padding: 5px 10px">';
        $label .= '<div style="border-bottom: 1px solid #eeeeee;  padding-bottom: 5px; margin-bottom: 5px; color: #666; font-size: 12px">Debug called from file: <strong>' . self::getCallingFileName(
            ) . '</strong> at line <strong>' . self::getCallingFileLine() . '</strong></div>';

        foreach ($args as $value) {
            if (is_bool($value)) {
                if (!$value) {
                    $value = '<span style="color: blue">FALSE</span>';
                } else {
                    $value = '<span style="color: blue">TRUE</span>';
                }
            }

            if (is_null($value)) {
                $value = '<span style="color: blue">NULL</span>';
            }

            if (is_string($value)) {
                if (!$value) {
                    $value = '<span style="color: blue">(empty string))</span>';
                }
            }

            $label .= '<pre>' . print_r($value, true) . '</pre>';
        }
        $label .= '</div>';

        return $label;
    }
1259834
public function ___debugInfo()
    {
        $nodeName = 'unknown';

        if ($this->functionLikeNode instanceof Function_) {
            $nodeName = $this->functionLikeNode->name->toString();
        }

        return ['name' => $nodeName];
    }
924810
public static function sessionlock_debugging() {
        global $CFG, $PERF;

        if (!empty($CFG->debugsessionlock)) {
            if (isset($PERF->sessionlock['held']) && $PERF->sessionlock['held'] > $CFG->debugsessionlock) {
                debugging("Script ".me()." locked the session for ".number_format($PERF->sessionlock['held'], 3)
                ." seconds, it should close the session using \core\session\manager::write_close().", DEBUG_NORMAL);
            }

            if (isset($PERF->sessionlock['wait']) && $PERF->sessionlock['wait'] > $CFG->debugsessionlock) {
                $output = self::display_blocking_page();
                debugging($output, DEBUG_DEVELOPER);
            }
        }
    }
1216776
public function stopAndShowDebugInfo()
    {
        if (Request::isAjax()) {
            if (Config::get('dump_use_php_console')) {
                self::$sql && \Cml\dumpUsePHPConsole(self::$sql, 'sql');
                \Cml\dumpUsePHPConsole(self::$tipInfo, 'tipInfo');
                \Cml\dumpUsePHPConsole(self::$includeFile, 'includeFile');
            } else {
                $deBugLogData = [
                    'tipInfo' => self::$tipInfo
                ];
                self::$sql && $deBugLogData['sql'] = self::$sql;
                if (!empty($deBugLogData)) {
                    Cml::requireFile(CML_CORE_PATH . DIRECTORY_SEPARATOR . 'ConsoleLog.php', ['deBugLogData' => $deBugLogData]);
                }
            }
        } else {
            View::getEngine('html')
                ->assign('includeLib', Debug::getIncludeLib())
                ->assign('includeFile', Debug::getIncludeFiles())
                ->assign('tipInfo', Debug::getTipInfo())
                ->assign('sqls', Debug::getSqls())
                ->assign('usetime', Debug::getUseTime())
                ->assign('usememory', Debug::getUseMemory());
            Cml::showSystemTemplate(Config::get('debug_page'));
        }
    }
6296
private function buildDebugSql()
    {
        $bindParams = $this->bindParams;
        foreach ($bindParams as $key => $val) {
            $bindParams[$key] = str_replace('\\\\', '\\', addslashes($val));
        }
        return vsprintf(str_replace('%s', "'%s'", $this->currentSql), $bindParams);
    }
1192601
public function debug($subject = null, $body = null, $request = true, $server = true) {
        // initialize email
        $email = (new Email('debug'))
            ->setTemplate('Unimatrix/Cake.debug')
            ->setLayout('Unimatrix/Cake.debug');

        // get controller and method
        $location = [];
        foreach(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS) as $one) {
            // ignore current function
            if($one['function'] == __FUNCTION__)
                continue;

            // check if private or protected
            $check = new \ReflectionMethod($one['class'], $one['function']);
            if($check->isPrivate() || $check->isProtected()) {
                // @codeCoverageIgnoreStart
                $location[3] = $one['function'];
                continue;
                // @codeCoverageIgnoreEnd
            }

            // set class and function
            $location[1] = str_replace(['Controller', 'App\\\\', 'TestCase\\\\'], null, $one['class']);
            $location[2] = $one['function'];
            break;
        }

        // sort before using
        ksort($location);

        // overwrite locations
        if(isset($location[1])) {
            if($location[1] == 'Unimatrix\Cake\Console\EmailConsoleErrorHandler') $location = ['EmailConsoleErrorHandler'];
            elseif($location[1] == 'Unimatrix\Cake\Error\EmailErrorHandler') $location = ['EmailErrorHandler'];
            elseif($location[1] == 'Unimatrix\Cake\Error\Middleware\EmailErrorHandlerMiddleware') $location = ['EmailErrorHandlerMiddleware'];
            elseif($location[1] == 'Unimatrix\Cake\Test\Component\EmailComponentTest') $location = ['EmailComponentTest'];
        }

        // get brand
        $from = $email->getFrom();
        $brand = reset($from);

        // set subject
        $email->setSubject($brand . ' report: [' . implode('->', $location) . '] ' . $subject);
        $email->setViewVars(['subject' => $email->getSubject()]);

        // body start
        $body = $body == strip_tags($body) ? nl2br($body) : $body;

        // show request
        if($request) {
            if(isset($_POST) && !empty($_POST))
                $body .= Misc::dump($_POST, '$_POST', true);

            if(isset($_GET) && !empty($_GET))
                $body .= Misc::dump($_GET, '$_GET', true);

            if(isset($_COOKIE) && !empty($_COOKIE))
                $body .= Misc::dump($_COOKIE, '$_COOKIE', true);

            if(isset($_SESSION) && !empty($_SESSION))
                $body .= Misc::dump($_SESSION, '$_SESSION', true);
        }

        // show server
        if($server)
            $body .= Misc::dump($_SERVER, '$_SERVER', true);

        // send email
        return $email->send($body);
    }
1039973
public function debug()
    {
        if (!is_array($this->required)) {
            return false;
        }

        $result = "<ul>";
        foreach ($this->required as $name) {
            $result .= "<li>$name</li>";
        }

        $result .= "</ul>";
        return $result;
    }
1219511
private function getClientDebugLink()
    {
        //====================================================================//
        // Compute target client debug url
        $url = $this->getClientUrl();
        $params = '?node='.$this->id;

        return '<a href="'.$url.$params.'" target="_blank" >'.$url.'</a>';
    }