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


PHP Helpers::editorLink方法代码示例

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


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

示例1: initialize

 public static function initialize()
 {
     $blueScreen = Tracy\Debugger::getBlueScreen();
     if (preg_match('#(.+)/Bridges/Framework$#', strtr(__DIR__, '\\', '/'), $m)) {
         if (preg_match('#(.+)/nette/bootstrap/src$#', $m[1], $m2)) {
             $blueScreen->collapsePaths[] = "{$m2['1']}/nette";
             $blueScreen->collapsePaths[] = "{$m2['1']}/latte";
         } else {
             $blueScreen->collapsePaths[] = $m[1];
         }
     }
     if (class_exists('Nette\\Framework')) {
         $bar = Tracy\Debugger::getBar();
         $bar->info[] = $blueScreen->info[] = 'Nette Framework ' . Nette\Framework::VERSION . ' (' . Nette\Framework::REVISION . ')';
     }
     $blueScreen->addPanel(function ($e) {
         if ($e instanceof Latte\CompileException) {
             return array('tab' => 'Template', 'panel' => '<p>' . (is_file($e->sourceName) ? '<b>File:</b> ' . Helpers::editorLink($e->sourceName, $e->sourceLine) : htmlspecialchars($e->sourceName)) . '</p>' . ($e->sourceCode ? '<pre>' . BlueScreen::highlightLine(htmlspecialchars($e->sourceCode), $e->sourceLine) . '</pre>' : ''));
         } elseif ($e instanceof Nette\Neon\Exception && preg_match('#line (\\d+)#', $e->getMessage(), $m)) {
             if ($item = Helpers::findTrace($e->getTrace(), 'Nette\\DI\\Config\\Adapters\\NeonAdapter::load')) {
                 return array('tab' => 'NEON', 'panel' => '<p><b>File:</b> ' . Helpers::editorLink($item['args'][0], $m[1]) . '</p>' . BlueScreen::highlightFile($item['args'][0], $m[1]));
             } elseif ($item = Helpers::findTrace($e->getTrace(), 'Nette\\Neon\\Decoder::decode')) {
                 return array('tab' => 'NEON', 'panel' => BlueScreen::highlightPhp($item['args'][0], $m[1]));
             }
         }
     });
 }
开发者ID:petrparolek,项目名称:web_cms,代码行数:27,代码来源:TracyBridge.php

示例2: getPanel

    public function getPanel()
    {
        $duplicitesQueries = $this->getDuplicateQueries();
        if (empty($duplicitesQueries)) {
            return '';
        }
        $panel = '
		<div class="tracy-inner nette-DbDuplicatesQueries">
			<table>
				<tr><th>Count</th><th>SQL Query</th><th>Locations</th></tr>';
        foreach ($duplicitesQueries as $query => $dupliciteQuery) {
            $panel .= '<tr>';
            $count = count($dupliciteQuery);
            $panel .= '<td>' . $count . 'x</td>';
            $panel .= '<td>' . $query . '</td>';
            $panel .= '<td>';
            foreach ($dupliciteQuery as $queryInformation) {
                $source = $queryInformation[1];
                if (!$source) {
                    continue;
                }
                $panel .= substr_replace(Tracy\Helpers::editorLink($source[0], $source[1]), ' class="nette-DbConnectionPanel-source"', 2, 0) . '<br />';
            }
            $panel .= '</td>';
            $panel .= '</tr>';
        }
        $panel .= '
			</table>
		</div>';
        return $panel;
    }
开发者ID:RELIGIS,项目名称:DuplicateQueriesPanel,代码行数:31,代码来源:DuplicateQueriesPanel.php

示例3: highlightException

 /**
  * @param \Kdyby\Autowired\Exception $e
  * @return string
  */
 protected static function highlightException(Kdyby\Autowired\Exception $e)
 {
     $refl = $e->getReflector();
     /** @var \Reflector|\Nette\Reflection\Property|\Nette\Reflection\Method $refl */
     $file = $refl->getDeclaringClass()->getFileName();
     $line = $refl instanceof Nette\Reflection\Property ? self::getPropertyLine($refl) : $refl->getStartLine();
     return '<p><b>File:</b> ' . Helpers::editorLink($file, $line) . '</p>' . BlueScreen::highlightFile($file, $line);
 }
开发者ID:kdyby,项目名称:autowired,代码行数:12,代码来源:Panel.php

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

示例5: toHtml

 /**
  * Dumps variable to HTML.
  * @return string
  */
 public static function toHtml($var, array $options = NULL)
 {
     $options = (array) $options + array(self::DEPTH => 4, self::TRUNCATE => 150, self::COLLAPSE => 14, self::COLLAPSE_COUNT => 7, self::OBJECT_EXPORTERS => NULL);
     $loc =& $options[self::LOCATION];
     $loc = $loc === TRUE ? ~0 : (int) $loc;
     $options[self::OBJECT_EXPORTERS] = (array) $options[self::OBJECT_EXPORTERS] + self::$objectExporters;
     $live = !empty($options[self::LIVE]) && $var && (is_array($var) || is_object($var) || is_resource($var));
     list($file, $line, $code) = $loc ? self::findLocation() : NULL;
     $locAttrs = $file && $loc & self::LOCATION_SOURCE ? Helpers::formatHtml(' title="%in file % on line %" data-tracy-href="%"', "{$code}\n", $file, $line, Helpers::editorUri($file, $line)) : NULL;
     return '<pre class="tracy-dump' . ($live && $options[self::COLLAPSE] === TRUE ? ' tracy-collapsed' : '') . '"' . $locAttrs . ($live ? " data-tracy-dump='" . str_replace("'", '&#039;', json_encode(self::toJson($var, $options))) . "'>" : '>') . ($live ? '' : self::dumpVar($var, $options)) . ($file && $loc & self::LOCATION_LINK ? '<small>in ' . Helpers::editorLink($file, $line) . '</small>' : '') . "</pre>\n";
 }
开发者ID:re1la2pse,项目名称:GromesProjekt,代码行数:15,代码来源:Dumper.php

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

示例7: toHtml

	/**
	 * Dumps variable to HTML.
	 * @return string
	 */
	public static function toHtml($var, array $options = NULL)
	{
		$options = (array) $options + array(
			self::DEPTH => 4,
			self::TRUNCATE => 150,
			self::COLLAPSE => FALSE,
			self::COLLAPSE_COUNT => 7,
			self::LOCATION => FALSE,
		);
		list($file, $line, $code) = $options[self::LOCATION] ? self::findLocation() : NULL;
		return '<pre class="tracy-dump"'
			. ($file ? Helpers::createHtml(' title="%in file % on line %" data-tracy-href="%"', "$code\n", $file, $line, Helpers::editorUri($file, $line)) . '>' : '>')
			. self::dumpVar($var, $options)
			. ($file ? '<small>in ' . Helpers::editorLink($file, $line) . '</small>' : '')
			. "</pre>\n";
	}
开发者ID:nakoukal,项目名称:fakturace,代码行数:20,代码来源:Dumper.php

示例8: initialize

 public static function initialize()
 {
     $bar = Tracy\Debugger::getBar();
     $bar->info[] = 'Nette Framework ' . Nette\Framework::VERSION . ' (' . substr(Nette\Framework::REVISION, 8) . ')';
     $blueScreen = Tracy\Debugger::getBlueScreen();
     $blueScreen->collapsePaths[] = dirname(dirname(__DIR__));
     $blueScreen->info[] = 'Nette Framework ' . Nette\Framework::VERSION . ' (revision ' . Nette\Framework::REVISION . ')';
     $blueScreen->addPanel(function ($e) {
         if ($e instanceof Latte\CompileException) {
             return array('tab' => 'Template', 'panel' => '<p>' . (is_file($e->sourceName) ? '<b>File:</b> ' . Helpers::editorLink($e->sourceName, $e->sourceLine) : htmlspecialchars($e->sourceName)) . '</p>' . ($e->sourceCode ? '<pre>' . BlueScreen::highlightLine(htmlspecialchars($e->sourceCode), $e->sourceLine) . '</pre>' : ''));
         } elseif ($e instanceof Nette\Utils\NeonException && preg_match('#line (\\d+)#', $e->getMessage(), $m)) {
             if ($item = Helpers::findTrace($e->getTrace(), 'Nette\\DI\\Config\\Adapters\\NeonAdapter::load')) {
                 return array('tab' => 'NEON', 'panel' => '<p><b>File:</b> ' . Helpers::editorLink($item['args'][0], $m[1]) . '</p>' . BlueScreen::highlightFile($item['args'][0], $m[1]));
             } elseif ($item = Helpers::findTrace($e->getTrace(), 'Nette\\Utils\\Neon::decode')) {
                 return array('tab' => 'NEON', 'panel' => BlueScreen::highlightPhp($item['args'][0], $m[1]));
             }
         }
     });
 }
开发者ID:hrach,项目名称:nette,代码行数:19,代码来源:TracyBridge.php

示例9: initialize

 public static function initialize()
 {
     $blueScreen = Tracy\Debugger::getBlueScreen();
     if (class_exists('Nette\\Framework')) {
         $version = Framework::VERSION . (Framework::REVISION ? ' (' . Framework::REVISION . ')' : '');
         Tracy\Debugger::getBar()->getPanel('Tracy:info')->data['Nette Framework'] = $version;
         $blueScreen->info[] = "Nette Framework {$version}";
     }
     $blueScreen->addPanel(function ($e) {
         if ($e instanceof Latte\CompileException) {
             return ['tab' => 'Template', 'panel' => (@is_file($e->sourceName) ? '<p><b>File:</b> ' . Helpers::editorLink($e->sourceName, $e->sourceLine) . '</p>' : '') . '<pre>' . BlueScreen::highlightLine(htmlspecialchars($e->sourceCode, ENT_IGNORE, 'UTF-8'), $e->sourceLine) . '</pre>'];
         }
     });
     $blueScreen->addPanel(function ($e) {
         if ($e instanceof Nette\Neon\Exception && preg_match('#line (\\d+)#', $e->getMessage(), $m) && ($trace = Helpers::findTrace($e->getTrace(), 'Nette\\Neon\\Decoder::decode'))) {
             return ['tab' => 'NEON', 'panel' => ($trace2 = Helpers::findTrace($e->getTrace(), 'Nette\\DI\\Config\\Adapters\\NeonAdapter::load')) ? '<p><b>File:</b> ' . Helpers::editorLink($trace2['args'][0], $m[1]) . '</p>' . BlueScreen::highlightFile($trace2['args'][0], $m[1]) : BlueScreen::highlightPhp($trace['args'][0], $m[1])];
         }
     });
 }
开发者ID:pt24,项目名称:bootstrap,代码行数:19,代码来源:TracyBridge.php

示例10: editorLink

 /**
  * Returns link to editor.
  * @author David Grudl
  * @return Nette\Utils\Html|string
  */
 private static function editorLink($file, $line, $text = NULL)
 {
     if (Debugger::$editor && is_file($file) && $text !== NULL) {
         return Nette\Utils\Html::el('a')->href(strtr(Debugger::$editor, array('%file' => rawurlencode($file), '%line' => $line)))->title("{$file}:{$line}")->setHtml($text);
     } else {
         return Helpers::editorLink($file, $line);
     }
 }
开发者ID:tomasstrejcek,项目名称:Translation,代码行数:13,代码来源:Panel.php

示例11: getPanel

    /**
     * Returns HTML code for custom panel. (Tracy\IBarPanel)
     * @return mixed
     */
    public function getPanel()
    {
        $totalTime = $s = NULL;
        $h = 'htmlSpecialChars';
        foreach ($this->events as $event) {
            $totalTime += $event->time;
            $explain = NULL;
            // EXPLAIN is called here to work SELECT FOUND_ROWS()
            if ($this->explain && $event->type === Event::SELECT) {
                try {
                    $backup = [$event->connection->onEvent, \dibi::$numOfQueries, \dibi::$totalTime];
                    $event->connection->onEvent = NULL;
                    $cmd = is_string($this->explain) ? $this->explain : ($event->connection->getConfig('driver') === 'oracle' ? 'EXPLAIN PLAN FOR' : 'EXPLAIN');
                    $explain = Helpers::dump(@$event->connection->nativeQuery("{$cmd} {$event->sql}"), TRUE);
                } catch (Dibi\Exception $e) {
                }
                list($event->connection->onEvent, \dibi::$numOfQueries, \dibi::$totalTime) = $backup;
            }
            $s .= '<tr><td>' . sprintf('%0.3f', $event->time * 1000);
            if ($explain) {
                static $counter;
                $counter++;
                $s .= "<br /><a href='#tracy-debug-DibiProfiler-row-{$counter}' class='tracy-toggle tracy-collapsed' rel='#tracy-debug-DibiProfiler-row-{$counter}'>explain</a>";
            }
            $s .= '</td><td class="tracy-DibiProfiler-sql">' . Helpers::dump(strlen($event->sql) > self::$maxLength ? substr($event->sql, 0, self::$maxLength) . '...' : $event->sql, TRUE);
            if ($explain) {
                $s .= "<div id='tracy-debug-DibiProfiler-row-{$counter}' class='tracy-collapsed'>{$explain}</div>";
            }
            if ($event->source) {
                $s .= Tracy\Helpers::editorLink($event->source[0], $event->source[1]);
                //->class('tracy-DibiProfiler-source');
            }
            $s .= "</td><td>{$event->count}</td><td>{$h($event->connection->getConfig('driver') . '/' . $event->connection->getConfig('name'))}</td></tr>";
        }
        return empty($this->events) ? '' : '<style> #tracy-debug td.tracy-DibiProfiler-sql { background: white !important }
			#tracy-debug .tracy-DibiProfiler-source { color: #999 !important }
			#tracy-debug tracy-DibiProfiler tr table { margin: 8px 0; max-height: 150px; overflow:auto } </style>
			<h1>Queries: ' . count($this->events) . ($totalTime === NULL ? '' : sprintf(', time: %0.3f ms', $totalTime * 1000)) . '</h1>
			<div class="tracy-inner tracy-DibiProfiler">
			<table>
				<tr><th>Time&nbsp;ms</th><th>SQL Statement</th><th>Rows</th><th>Connection</th></tr>' . $s . '
			</table>
			</div>';
    }
开发者ID:heximcz,项目名称:routerboard-backup,代码行数:48,代码来源:Panel.php

示例12: editorLink

 /**
  * editor link.
  *
  * @param string|array $source
  *
  * @return string
  */
 public static function editorLink($source)
 {
     $link = null;
     if (is_string($source) === true) {
         $file = $source;
         $line = null;
     } else {
         $file = $source[0];
         $line = $source[1];
     }
     $link = Helpers::editorLink($file, $line);
     // $link = self::updateEditorUri($link);
     return $link;
 }
开发者ID:recca0120,项目名称:laravel-tracy,代码行数:21,代码来源:AbstractPanel.php

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

示例14: renderException

 /**
  * Renders SQL query string to Nette debug bluescreen when available.
  * @param NeevoException $e
  * @return array
  */
 public function renderException($e)
 {
     if (!($e instanceof NeevoException && $e->getSql())) {
         return;
     }
     list($file, $line) = $this->failedQuerySource;
     return array('tab' => 'SQL', 'panel' => Manager::highlightSql($e->getSql()) . '<p><b>File:</b> ' . Helpers::editorLink($file, $line) . " &nbsp; <b>Line:</b> {$line}</p>" . ($line ? BlueScreen::highlightFile($file, $line) : '') . 'Neevo v' . Manager::VERSION);
 }
开发者ID:smasty,项目名称:neevo-nette-ext,代码行数:13,代码来源:DebugPanel.php

示例15: getEditorLink

 public static function getEditorLink($source)
 {
     $link = null;
     if ($source !== null) {
         $file = $source[0];
         $line = $source[1];
         $link = Helpers::editorLink($file, $line);
         // $link = self::updateEditorUri($link);
     }
     return $link;
 }
开发者ID:dasim,项目名称:laravel-tracy,代码行数:11,代码来源:AbstractPanel.php


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