当前位置: 首页>>代码示例>>PHP>>正文


PHP Debugger::showLocation方法代码示例

本文整理汇总了PHP中Tracy\Debugger::showLocation方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugger::showLocation方法的具体用法?PHP Debugger::showLocation怎么用?PHP Debugger::showLocation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tracy\Debugger的用法示例。


在下文中一共展示了Debugger::showLocation方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($options = [], Application $app = null, RepositoryContract $config = null, Dispatcher $dispatcher = null)
 {
     static::$options = $config !== null ? array_merge($options, $config->get('tracy')) : $options;
     TracyDebugger::$time = array_get($_SERVER, 'REQUEST_TIME_FLOAT', microtime(true));
     TracyDebugger::$maxDepth = array_get(static::$options, 'maxDepth');
     TracyDebugger::$maxLen = array_get(static::$options, 'maxLen');
     TracyDebugger::$showLocation = array_get(static::$options, 'showLocation');
     TracyDebugger::$strictMode = array_get(static::$options, 'strictMode');
     TracyDebugger::$editor = array_get(static::$options, 'editor');
     $bar = TracyDebugger::getBar();
     foreach (array_get(static::$options, 'panels') as $key => $enabled) {
         if ($enabled === true) {
             $class = '\\' . __NAMESPACE__ . '\\Panels\\' . ucfirst($key) . 'Panel';
             if (class_exists($class) === false) {
                 $class = $key;
             }
             $this->panels[$key] = new $class($app, static::$options);
             $bar->addPanel($this->panels[$key], $class);
         }
     }
     if ($dispatcher !== null) {
         $dispatcher->listen('kernel.handled', function ($request, $response) {
             return static::appendDebugbar($request, $response);
         });
     } else {
         TracyDebugger::enable();
     }
 }
开发者ID:dasim,项目名称:laravel-tracy,代码行数:28,代码来源:Debugger.php

示例2: dumpHtml

/**
 * Dump rendered Html element or code and intended output generated by tidy and optional also Html element structure
 *
 * @param Html|string $htmlElement        Html element or string
 * @param bool        $onlyReturn         output in string and don't send it to output?
 * @param int         $maxDepth           for Debugger::Dump output - to see how is the Html element built
 * @param bool        $includePrettyPrint along javascript code for prettyPrint activation?
 * @return string     Html output
 */
function dumpHtml($htmlElement, $onlyReturn = false, $maxDepth = 0, $includePrettyPrint = false)
{
    $maxDepthBackup = Debugger::$maxDepth;
    $maxLenBackup = Debugger::$maxLen;
    $showLocationBackup = Debugger::$showLocation;
    Debugger::$maxDepth = $maxDepth;
    Debugger::$maxLen = 200000;
    Debugger::$showLocation = false;
    // convert to string only once - important for Scaffolding Renderer output
    $renderedElement = (string) $htmlElement;
    $output = '<div class="rendered-element">' . $renderedElement . '</div>';
    $output .= '<pre class="prettyprint linenums pre-scrollable">' . htmlspecialchars(tidyFormatString($renderedElement)) . '</pre>';
    if ($includePrettyPrint) {
        $output .= '<script>prettyPrint();</script>';
    }
    if ($maxDepth > 0 && $htmlElement instanceof \Latte\Runtime\Html) {
        Debugger::dump($renderedElement);
        Debugger::dump($htmlElement);
    }
    Debugger::$maxDepth = $maxDepthBackup;
    Debugger::$maxLen = $maxLenBackup;
    Debugger::$showLocation = $showLocationBackup;
    if (!$onlyReturn) {
        echo $output;
    }
    return $output;
}
开发者ID:leonardoca,项目名称:tools,代码行数:36,代码来源:smartDump.php

示例3: initializeTracyDebuger

 /**
  * initializeTracyDebuger.
  *
  * @method initializeTracyDebuger
  *
  * @param array $config
  */
 protected function initializeTracyDebuger($config)
 {
     Debugger::$editor = Arr::get($config, 'editor', Debugger::$editor);
     Debugger::$maxDepth = Arr::get($config, 'maxDepth', Debugger::$maxDepth);
     Debugger::$maxLength = Arr::get($config, 'maxLength', Debugger::$maxLength);
     Debugger::$scream = Arr::get($config, 'scream', true);
     Debugger::$showLocation = Arr::get($config, 'showLocation', true);
     Debugger::$strictMode = Arr::get($config, 'strictMode', true);
     Debugger::$time = Arr::get($_SERVER, 'REQUEST_TIME_FLOAT', microtime(true));
     Debugger::$editorMapping = Arr::get($config, 'editorMapping', []);
 }
开发者ID:recca0120,项目名称:laravel-tracy,代码行数:18,代码来源:Debugbar.php

示例4: registerDebugger

 protected function registerDebugger()
 {
     $config = $this->app['config']['tracy'];
     Debugger::$time = array_get($_SERVER, 'REQUEST_TIME_FLOAT', microtime(true));
     Debugger::$maxDepth = array_get($config, 'maxDepth');
     Debugger::$maxLen = array_get($config, 'maxLen');
     Debugger::$showLocation = array_get($config, 'showLocation');
     Debugger::$strictMode = array_get($config, 'strictMode');
     Debugger::$editor = array_get($config, 'editor');
     $bar = Debugger::getBar();
     foreach ($config['panels'] as $key => $enabled) {
         if ($enabled === true or $enabled === '1') {
             $class = '\\' . __NAMESPACE__ . '\\Panels\\' . ucfirst($key) . 'Panel';
             $bar->addPanel(new $class($config, $this->app), $class);
         } elseif (is_string($enabled) === true) {
             $class = $enabled;
             $bar->addPanel(new $class($config, $this->app), $class);
         }
     }
 }
开发者ID:oscar3x39,项目名称:laravel-tracy,代码行数:20,代码来源:ServiceProvider.php

示例5: register

 /**
  * @param Container $app
  *
  * @return mixed
  *
  * @throws DependencyInstanceNotFound
  */
 public function register(Container $app)
 {
     /** @var Application $app */
     $config = $this->config;
     // this service provider will quietly fail if Tracy is not installed.
     if (class_exists('\\Tracy\\Debugger') and $config->get('logging.tracy.enabled')) {
         // use the environment to configure the Debugger
         $env = env('APP_ENV') === 'PRODUCTION' ? Debugger::PRODUCTION : Debugger::DEVELOPMENT;
         Debugger::$maxDepth = $config->get('logging.tracy.maxDepth', 6);
         Debugger::enable($env, rtrim($config->get('logging.logPath', LOGS), '/'));
         Debugger::$showLocation = env('DEBUG') and $config->get('logging.tracy.showLocation', FALSE);
         Debugger::$strictMode = $config->get('logging.tracy.strictMode', FALSE);
         Debugger::$showBar = FALSE;
         # env('DEBUG');
         // use the Tracy Debugger for logging.
         $app['tracy'] = Debugger::getLogger();
         $app['nine.logger'] = function ($app) {
             return $app['tracy'];
         };
     }
 }
开发者ID:formula9,项目名称:framework,代码行数:28,代码来源:TracyServiceProvider.php

示例6: elapsed_time_since_request

<?php

/**
 * @package Og
 * @version 0.1.0
 * @author  Greg Truesdell <odd.greg@gmail.com>
 */
use Og\Forge;
use Og\Support\Util;
use Tracy\Debugger;
use Tracy\FireLogger;
Debugger::$maxDepth = 6;
Debugger::enable(Debugger::DEVELOPMENT, LOCAL_LOGS);
Debugger::$showLocation = TRUE;
$logger = Debugger::getLogger();
Forge::getInstance()->instance(['logger', FireLogger::class], $logger);
/**
 * @param bool $raw
 *
 * @return string
 */
function elapsed_time_since_request($raw = FALSE)
{
    return !$raw ? sprintf("%8.1f ms", (microtime(TRUE) - $_SERVER['REQUEST_TIME_FLOAT']) * 1000) : (microtime(TRUE) - $_SERVER['REQUEST_TIME_FLOAT']) * 1000;
}
/**
 * @param $index
 *
 * @return string
 */
function location_from_backtrace($index = 2)
开发者ID:anctemarry27,项目名称:cogs,代码行数:31,代码来源:debug.php

示例7:

<?php

require __DIR__ . '/../vendor/autoload.php';
use Tracy\Debugger;
Tester\Environment::setup();
date_default_timezone_set('Europe/Prague');
header("Content-Type: text/html; charset=UTF-8");
header("Content-Type: text/html; charset=UTF-8");
if (php_sapi_name() != 'cgi-fcgi') {
    Debugger::enable();
    Debugger::$strictMode = true;
    Debugger::$showLocation = true;
}
开发者ID:xxdavid,项目名称:bakalarigradesapi,代码行数:13,代码来源:bootstrap.php


注:本文中的Tracy\Debugger::showLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。