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


PHP Debugger::maxDepth方法代码示例

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


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

示例1: init

 public function init()
 {
     $grav = Grav::instance();
     /** @var Config $config */
     $config = $grav['config'];
     $mode = $config->get('system.debugger.mode');
     TracyDebugger::$logDirectory = $config->get('system.debugger.log.enabled') ? LOG_DIR : null;
     TracyDebugger::$maxDepth = $config->get('system.debugger.max_depth');
     // Switch debugger into development mode if configured
     if ($config->get('system.debugger.enabled')) {
         if ($config->get('system.debugger.strict')) {
             TracyDebugger::$strictMode = true;
         }
         if (function_exists('ini_set')) {
             ini_set('display_errors', true);
         }
         if ($mode == strtolower('detect')) {
             TracyDebugger::$productionMode = self::DETECT;
         } elseif ($mode == strtolower('production')) {
             TracyDebugger::$productionMode = self::PRODUCTION;
         } else {
             TracyDebugger::$productionMode = self::DEVELOPMENT;
         }
     }
 }
开发者ID:miguelramos,项目名称:grav,代码行数:25,代码来源:Debugger.php

示例2: __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

示例3: onBootstrap

 /**
  * {@inheritDoc}
  */
 public function onBootstrap(EventInterface $event)
 {
     /**
      * @var ModuleOptions $moduleOptions
      */
     $moduleOptions = $event->getTarget()->getServiceManager()->get('LemoTracy\\Options\\ModuleOptions');
     if (true === $moduleOptions->getEnabled()) {
         if (null !== $moduleOptions->getMode()) {
             Debugger::enable($moduleOptions->getMode());
         }
         if (null !== $moduleOptions->getLogDirectory()) {
             Debugger::$logDirectory = $moduleOptions->getLogDirectory();
         }
         if (null !== $moduleOptions->getLogSeverity()) {
             Debugger::$logSeverity = $moduleOptions->getLogSeverity();
         }
         if (null !== $moduleOptions->getMaxDepth()) {
             Debugger::$maxDepth = $moduleOptions->getMaxDepth();
         }
         if (null !== $moduleOptions->getMaxLen()) {
             Debugger::$maxLen = $moduleOptions->getMaxLen();
         }
         if (null !== $moduleOptions->getShowBar()) {
             Debugger::$showBar = $moduleOptions->getShowBar();
         }
         if (null !== $moduleOptions->getStrict()) {
             Debugger::$strictMode = $moduleOptions->getStrict();
         }
     }
 }
开发者ID:MatyCZ,项目名称:LemoTracy,代码行数:33,代码来源:Module.php

示例4: pmd

/**
 * LeonardoCA\Tools\ProcessMonitor detail dump
 *
 * @param string $msg
 * @param null   $data
 * @param null   $dataDescription
 * @param int    $maxDepth
 * @return void
 */
function pmd($msg = 'Detail Info', $data = null, $dataDescription = null, $maxDepth = 2)
{
    $backupDepth = Debugger::$maxDepth;
    Debugger::$maxDepth = $maxDepth;
    ProcessMonitor::dump("<em style='color:#339'>{$msg}</em>", $data, null, ProcessMonitor::SHOW_DETAIL, $dataDescription);
    Debugger::$maxDepth = $backupDepth;
}
开发者ID:leonardoca,项目名称:tools,代码行数:16,代码来源:processMonitor.php

示例5: 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

示例6: og_dump

/**
 * @param     $var
 * @param int $depth
 *
 * @return mixed
 */
function og_dump($var = NULL, $depth = 12)
{
    \Tracy\Debugger::$maxDepth = $depth;
    $args = func_get_args();
    Util::array_forget(func_num_args() - 1, $args);
    $dumper = defined('PHPUNIT_TESTS__') ? 'Tracy\\Dumper::toTerminal' : 'Tracy\\Debugger::dump';
    array_map($dumper, $args);
    return $var;
}
开发者ID:anctemarry27,项目名称:cogs,代码行数:15,代码来源:debug.php

示例7: 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

示例8: onBootstrap

 /**
  * Setup Tracy\Debugger with options
  *
  * @param MvcEvent $e
  * @return void
  */
 public function onBootstrap(MvcEvent $e)
 {
     $app = $e->getApplication();
     $config = $app->getConfig();
     if (empty($config['tracy_debug']) || empty($config['tracy_debug']['enabled'])) {
         return;
     }
     array_key_exists('mode', $config['tracy_debug']) or $config['tracy_debug']['mode'] = NULL;
     array_key_exists('log', $config['tracy_debug']) or $config['tracy_debug']['log'] = NULL;
     array_key_exists('email', $config['tracy_debug']) or $config['tracy_debug']['email'] = NULL;
     Debugger::enable($config['tracy_debug']['mode'], $config['tracy_debug']['log'], $config['tracy_debug']['email']);
     !array_key_exists('strict', $config['tracy_debug']) or Debugger::$strictMode = $config['tracy_debug']['strict'];
     !array_key_exists('max_depth', $config['tracy_debug']) or Debugger::$maxDepth = $config['tracy_debug']['max_depth'];
     !array_key_exists('max_len', $config['tracy_debug']) or Debugger::$maxLen = $config['tracy_debug']['max_len'];
 }
开发者ID:jorgesierra,项目名称:zf2tracy,代码行数:21,代码来源:Module.php

示例9: 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

示例10: 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

示例11: 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

示例12: NeonFile

 * Edde is self-hosted; it is proof-of-concept or it can be used as tutorial. Many experimental features
 * are implemented here.
 */
use Edde\Api\Application\IApplication;
use Edde\Ext\Neon\NeonFile;
use Edde\Runtime\Bootstrap\BootstrapManager;
use Edde\Runtime\Bootstrap\Event\ConfigurationEvent;
use Edde\Runtime\Bootstrap\Event\SetupEvent;
use Edde\Runtime\Bootstrap\Event\StartupEvent;
use Tracy\Debugger;
require_once __DIR__ . '/../lib/tracy.phar';
require_once __DIR__ . '/../../src/loader.php';
BootstrapManager::bootstrap(function (ConfigurationEvent $configurationEvent) {
    $configurationEvent->getConfiguration()->addResource(new NeonFile(__DIR__ . '/../config/config.neon'))->addResource(new NeonFile(__DIR__ . '/../config/config.local.neon'), false);
}, function (SetupEvent $setupEvent) {
    $configuration = $setupEvent->getConfiguration();
    if ($configuration->isDevelMode()) {
        Debugger::enable(Debugger::DEVELOPMENT, $configuration->getDir('log'));
        Debugger::$strictMode = true;
        Debugger::$maxDepth = 12;
        Debugger::$maxLen = 8196;
    }
}, function (StartupEvent $startupEvent) {
    /**
     * optional - create (by default Edde's implementation) IApplication and run it; it holds whole life-cycle
     */
    $startupEvent->getContext()->create(IApplication::class)->run();
});
/**
 * and thats all; look around, there is many things to explore :)
 */
开发者ID:edde-framework,项目名称:edde,代码行数:31,代码来源:index.php

示例13: init

 /**
  * Inicialização do Framework.
  * Método chamado para inicializar os atributos da classe Manager e registrar os AutoloadPaths.
  * @param string $configFile Arquivo de configuração do Maestro
  * @param string $basePath Diretório onde o Maestro está instalado
  * @param string $app Aplicação a ser executada.
  */
 public static function init()
 {
     $debug = self::getConf('maestro.debug.enabled');
     if ($debug) {
         $mode = self::getConf('maestro.options.mode') == 'DEV' ? Tracy\Debugger::DEVELOPMENT : Tracy\Debugger::PRODUCTION;
         Tracy\Debugger::enable($mode, self::$maestroPath . DIRECTORY_SEPARATOR . 'log');
         Tracy\Debugger::$logSeverity = self::getConf('maestro.debug.severity');
         Tracy\Debugger::$strictMode = self::getConf('maestro.debug.strictMode');
         Tracy\Debugger::$maxDepth = self::getConf('maestro.debug.maxDepth');
         // default: 3
         Tracy\Debugger::$maxLen = self::getConf('maestro.debug.maxLen');
         // default: 150
     }
     error_reporting(self::getConf('maestro.debug.severity'));
     // Maestro 1.0 compatibility
     // self::addAutoloadClass('mlogin', self::$classPath . '/Security/MLoginMaestro1.php');
     // Session
     self::$session = new MSession();
     self::$session->init($_REQUEST['sid'] === '0' ? 0 : mrequest('sid'));
     self::$baseURL = self::$request->getBaseURL(false);
     Manager::logMessage('[RESET_LOG_MESSAGES]');
     /*
             if (self::$java = ($_SERVER["SERVER_SOFTWARE"] == "JavaBridge")) {
        require_once (self::$home . "/java/Java.inc");
        self::$javaContext = java_context();
        self::$javaServletContext = java_context()->getServletContext();
             }
     * 
     */
     self::getLogin();
     self::$msg = new MMessages(self::getSession()->lang ?: self::getOptions('language'));
     self::$msg->loadMessages();
     self::$mode = self::getOptions("mode");
     date_default_timezone_set(self::getOptions("timezone"));
     setlocale(LC_ALL, self::getOptions("locale"));
     //self::$mad = self::getConf('maestro.mad.module');
     self::$app = self::getConf('maestro.app');
     register_shutdown_function("shutdown");
 }
开发者ID:elymatos,项目名称:expressive,代码行数:46,代码来源:Manager.php

示例14: showTraceSimple

 /**
  * Simple trace info
  *
  * @param array $stack
  * @return string
  */
 public static function showTraceSimple($stack)
 {
     $maxDepth = Debugger::$maxDepth;
     Debugger::$maxDepth = 1;
     $counter = 0;
     ob_start();
     foreach ($stack as $row) {
         try {
             $r = isset($row['class']) ? new \ReflectionMethod($row['class'], $row['function']) : new \ReflectionFunction($row['function']);
             $params = $r->getParameters();
         } catch (\Exception $e) {
             $params = array();
         }
         $args = array();
         if (array_key_exists('args', $row)) {
             $argList = new \ArrayIterator($row['args']);
             while ($argList->valid()) {
                 $key = $argList->key();
                 $args[] = !isset($params[$key]) ?: '$' . $params[$key]->name;
                 $argList->next();
             }
         }
         echo ++$counter . '. <b>' . (isset($row['class']) ? htmlspecialchars($row['class'] . $row['type']) : '') . htmlspecialchars($row['function']) . '(' . implode(', ', $args) . ');</b> ' . '<br>' . (isset($row['file']) && is_file($row['file']) ? Helpers::editorLink($row['file'], $row['line']) : '<i>inner-code</i>' . isset($row['line']) ?: $row['line']) . '<br>';
         if ($counter == self::$traceMode) {
             break;
         }
     }
     Debugger::$maxDepth = $maxDepth;
     return ob_get_clean();
 }
开发者ID:leonardoca,项目名称:tools,代码行数:36,代码来源:SmartDump.php


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