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


PHP Dumper::toHtml方法代码示例

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


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

示例1: sdump

 /**
  * Dumps information about a variable in readable format.
  *
  * @param  mixed $var to dump
  * @param null   $title
  * @return void
  */
 public static function sdump($var, $title = null)
 {
     if (!Debugger::$productionMode) {
         self::initialize();
         $trace = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT);
         $item = Helpers::findTrace($trace, 'sdump', $index) ?: Helpers::findTrace($trace, __CLASS__ . '::sdump', $index);
         if (isset($item['file'], $item['line']) && is_file($item['file'])) {
             $lines = file($item['file']);
             preg_match('#sdump\\((.*)\\)#', $lines[$item['line'] - 1], $matches);
             $params = isset($matches[1]) ? htmlspecialchars($matches[1]) : false;
             if ($params) {
                 preg_match('#array\\((.*)\\)#', $params, $matches2);
                 $params = isset($matches2[1]) ? $matches2[1] : $params;
                 $params = explode(',', $params);
             }
             $dumpParams = isset($matches[0]) ? "{$matches['0']};" : '';
             $location = Debugger::$showLocation ? "<br>" . Helpers::editorLink($item['file'], $item['line']) : false;
         }
         $tiMethod = $trace[$index + 1];
         $dumpTitle = isset($tiMethod['class']) ? $tiMethod['class'] . $tiMethod['type'] . $tiMethod['function'] . '(); ' : $tiMethod['function'] . $title;
         $dumpObject = self::$dumpObject && isset($tiMethod['object']) ? Dumper::toHtml($tiMethod['object']) : '';
         $dump = (isset($dumpParams) ? "<b>{$dumpParams}</b> " : '') . (isset($location) ? $location : '') . $dumpObject;
         if (self::$traceMode) {
             for ($i = 0; $i <= $index; $i++) {
                 array_shift($trace);
             }
             $dump .= "<br/>" . self::showTraceSimple($trace);
         }
         $dump .= Dumper::toHtml($var);
         self::$dumps = array('title' => $dumpTitle, 'dump' => $dump);
         self::addToDumpPanel($dump, $dumpTitle);
     }
 }
开发者ID:leonardoca,项目名称:tools,代码行数:40,代码来源:SmartDump.php

示例2: getInfo

 /**
  * e.g. SQL explain
  *
  * @return NULL|Html|string
  */
 public function getInfo()
 {
     $info = $this->response;
     unset($info['hits']['hits']);
     $html = Dumper::toHtml($info, [Dumper::COLLAPSE => TRUE, Dumper::TRUNCATE => 50]);
     return Html::el()->setHtml($html);
 }
开发者ID:mikulas,项目名称:nette-panel-queries,代码行数:12,代码来源:ElasticSearchQuery.php

示例3: renderHtml

 private function renderHtml()
 {
     $res = '<style>code, pre {white-space:nowrap} a {text-decoration:none} pre {color:gray;display:inline} big {color:red}</style><code>';
     foreach ($this->list as $item) {
         $res .= Helpers::editorLink($item[0], $item[1]) . ' ' . str_replace(self::BOM, '<big>BOM</big>', Dumper::toHtml($item[2])) . "<br>\n";
     }
     return $res . '</code>';
 }
开发者ID:petrparolek,项目名称:web_cms,代码行数:8,代码来源:OutputDebugger.php

示例4: render

 /**
  * @internal
  * @param \Exception|NULL $e
  * @return string[]|NULL
  */
 public static function render(\Exception $e = NULL)
 {
     if (!$e instanceof \Nella\Tracy\DebugInfoException) {
         return NULL;
         // skip
     }
     return ['tab' => 'Exception Debug Info', 'panel' => \Tracy\Dumper::toHtml($e->__debugInfo())];
 }
开发者ID:nella,项目名称:tracy-debug-info,代码行数:13,代码来源:DebugInfoPanel.php

示例5: processQuery

 /**
  * @param array
  * @return string
  */
 protected function processQuery(array $query)
 {
     $s = '';
     list($sql, $params, $time) = $query;
     $s .= '<tr><td>' . sprintf('%0.3f', $time * 1000);
     $s .= '</td><td class="nette-Doctrine2Panel-sql">' . Helpers::dumpSql($sql);
     $s .= '</td><td>' . Dumper::toHtml($params) . '</tr>';
     return $s;
 }
开发者ID:pipaslot,项目名称:doctrine,代码行数:13,代码来源:QueryPanel.php

示例6: getResult

 /**
  * @return Html|string
  */
 public function getResult()
 {
     $data = iterator_to_array($this->result);
     foreach ($data as &$row) {
         $row = $this->rowToArray($row);
     }
     $html = Dumper::toHtml($data, [Dumper::COLLAPSE => TRUE]);
     return Html::el()->setHtml($html);
 }
开发者ID:mikulas,项目名称:nette-panel-queries,代码行数:12,代码来源:Neo4jQuery.php

示例7: initializePanel

	public static function initializePanel(Nette\Application\Application $application)
	{
		Tracy\Debugger::getBlueScreen()->addPanel(function ($e) use ($application) {
			return $e ? NULL : array(
				'tab' => 'Nette Application',
				'panel' => '<h3>Requests</h3>' . Tracy\Dumper::toHtml($application->getRequests())
					. '<h3>Presenter</h3>' . Tracy\Dumper::toHtml($application->getPresenter()),
			);
		});
	}
开发者ID:nakoukal,项目名称:fakturace,代码行数:10,代码来源:RoutingPanel.php

示例8: getPanel

 /**
  * @return string
  */
 public function getPanel()
 {
     if (empty($this->evaluatedFeatures)) {
         return NULL;
     }
     $evaluatedFeatures = $this->evaluatedFeatures;
     $click = class_exists('\\Tracy\\Dumper') ? function ($o, $c = TRUE, $d = 4) {
         return \Tracy\Dumper::toHtml($o, array('collapse' => $c, 'depth' => $d));
     } : callback('\\Tracy\\Helpers::clickableDump');
     ob_start();
     require __DIR__ . '/panel.phtml';
     return ob_get_clean();
 }
开发者ID:bazo,项目名称:nette-features-extension,代码行数:16,代码来源:Panel.php

示例9: getPanel

 /**
  * Renders HTML code for custom panel.
  * @return string
  */
 function getPanel()
 {
     if (!$this->messages) {
         return NULL;
     }
     ob_start();
     $esc = callback('Nette\\Templating\\Helpers::escapeHtml');
     $click = class_exists('\\Tracy\\Dumper') ? function ($o, $c = FALSE) {
         return \Tracy\Dumper::toHtml($o, array('collapse' => $c));
     } : callback('\\Tracy\\Helpers::clickableDump');
     require __DIR__ . '/panel.phtml';
     return ob_get_clean();
 }
开发者ID:trejjam,项目名称:validation,代码行数:17,代码来源:ValidationPanel.php

示例10: renderHtml

 private function renderHtml()
 {
     $res = '<style>code, pre {white-space:nowrap} a {text-decoration:none} pre {color:gray;display:inline} big {color:red}</style><code>';
     foreach ($this->list as $item) {
         $stack = array();
         foreach (array_slice($item[3], 1) as $t) {
             $t += array('class' => '', 'type' => '', 'function' => '');
             $stack[] = "{$t['class']}{$t['type']}{$t['function']}()" . (isset($t['file'], $t['line']) ? ' in ' . basename($t['file']) . ":{$t['line']}" : '');
         }
         $res .= Helpers::editorLink($item[0], $item[1]) . ' ' . '<span title="' . htmlspecialchars(implode("\n", $stack), ENT_IGNORE | ENT_QUOTES, 'UTF-8') . '">' . str_replace(self::BOM, '<big>BOM</big>', Dumper::toHtml($item[2])) . "</span><br>\n";
     }
     return $res . '</code>';
 }
开发者ID:re1la2pse,项目名称:GromesProjekt,代码行数:13,代码来源:OutputDebugger.php

示例11: getPanel

 /**
  * Renders HTML code for custom panel.
  * @return string
  */
 public function getPanel()
 {
     if (!$this->resources) {
         return null;
     }
     $esc = \Nette\Utils\Callback::closure('Latte\\Runtime\\Filters::escapeHtml');
     $click = function ($o, $c = false) {
         return \Tracy\Dumper::toHtml($o, ['collapse' => $c]);
     };
     ob_start();
     include __DIR__ . '/panel.phtml';
     return ob_get_clean();
 }
开发者ID:FreezyBee,项目名称:MailChimp,代码行数:17,代码来源:Panel.php

示例12: allResponses

 /**
  * @param \Kdyby\Curl\Response $response
  *
  * @return string
  */
 public static function allResponses($response)
 {
     if (!$response instanceof Curl\Response) {
         return NULL;
     }
     $click = function ($o, $c = TRUE) {
         return Dumper::toHtml($o, array('collapse' => $c));
     };
     $responses = array($click($response, TRUE));
     while ($response = $response->getPrevious()) {
         $responses[] = $click($response, TRUE);
     }
     return implode('', $responses);
 }
开发者ID:noikiy,项目名称:Curl,代码行数:19,代码来源:Panel.php

示例13: getPanel

 /**
  * @return string
  */
 public function getPanel()
 {
     if (!$this->calls) {
         return NULL;
     }
     ob_start();
     $esc = array('Nette\\Templating\\Helpers', 'escapeHtml');
     $click = class_exists('\\Tracy\\Dumper') ? function ($o, $c = FALSE) {
         return \Tracy\Dumper::toHtml($o, array('collapse' => $c));
     } : array('\\Tracy\\Helpers', 'clickableDump');
     $totalTime = $this->totalTime ? sprintf('%0.3f', $this->totalTime * 1000) . ' ms' : 'none';
     require __DIR__ . '/panel.phtml';
     return ob_get_clean();
 }
开发者ID:kdyby,项目名称:google,代码行数:17,代码来源:Panel.php

示例14: getPanel

 /**
  * @return string
  */
 public function getPanel()
 {
     if (!$this->calls) {
         return NULL;
     }
     ob_start();
     $esc = function ($s) {
         return htmlSpecialChars($s, ENT_QUOTES, 'UTF-8');
     };
     $click = class_exists('\\Tracy\\Dumper') ? function ($o, $c = FALSE) {
         return \Tracy\Dumper::toHtml($o, array('collapse' => $c));
     } : Callback::closure('\\Tracy\\Helpers::clickableDump');
     $totalTime = $this->totalTime ? sprintf('%0.3f', $this->totalTime * 1000) . ' ms' : 'none';
     require __DIR__ . '/panel.phtml';
     return ob_get_clean();
 }
开发者ID:runt18,项目名称:Github-1,代码行数:19,代码来源:Panel.php

示例15: getPanel

 /**
  * @return string
  */
 public function getPanel()
 {
     if (!$this->calls) {
         return NULL;
     }
     ob_start();
     if (class_exists('Latte\\Runtime\\Filters')) {
         $esc = Nette\Utils\Callback::closure('Latte\\Runtime\\Filters::escapeHtml');
     } else {
         $esc = 'Nette\\Templating\\Helpers::escapeHtml';
     }
     $click = class_exists('\\Tracy\\Dumper') ? function ($o, $c = FALSE) {
         return \Tracy\Dumper::toHtml($o, array('collapse' => $c));
     } : '\\Tracy\\Helpers::clickableDump';
     $totalTime = $this->totalTime ? sprintf('%0.3f', $this->totalTime * 1000) . ' ms' : 'none';
     require __DIR__ . '/panel.phtml';
     return ob_get_clean();
 }
开发者ID:kdyby,项目名称:facebook,代码行数:21,代码来源:Panel.php


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