Namespaces

  • Latte
    • Loaders
    • Macros
    • Runtime
  • Nette
    • Application
      • Responses
      • Routers
      • UI
    • Bridges
      • ApplicationLatte
      • ApplicationTracy
      • CacheLatte
      • DatabaseDI
      • DatabaseTracy
      • DITracy
      • FormsLatte
      • Framework
      • HttpTracy
      • SecurityTracy
    • Caching
      • Storages
    • ComponentModel
    • Database
      • Drivers
      • Reflection
      • Table
    • DI
      • Config
        • Adapters
      • Extensions
    • Diagnostics
    • Forms
      • Controls
      • Rendering
    • Http
    • Iterators
    • Latte
    • Loaders
    • Localization
    • Mail
    • Neon
    • PhpGenerator
    • Reflection
    • Security
    • Templating
    • Utils
  • NetteModule
  • none
  • Tracy

Classes

  • NetteAccessor
  • NetteExtension
  • TracyBridge
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated
 1: <?php
 2: 
 3: /**
 4:  * This file is part of the Nette Framework (http://nette.org)
 5:  * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
 6:  */
 7: 
 8: namespace Nette\Bridges\Framework;
 9: 
10: use Nette,
11:     Tracy,
12:     Tracy\Helpers,
13:     Tracy\BlueScreen,
14:     Latte;
15: 
16: 
17: /**
18:  * Initializes Tracy
19:  */
20: class TracyBridge
21: {
22: 
23:     public static function initialize()
24:     {
25:         $blueScreen = Tracy\Debugger::getBlueScreen();
26:         if (class_exists('Nette\Framework')) {
27:             $bar = Tracy\Debugger::getBar();
28:             $bar->info[] = $blueScreen->info[] = 'Nette Framework ' . Nette\Framework::VERSION . ' (' . Nette\Framework::REVISION . ')';
29:         }
30: 
31:         $blueScreen->addPanel(function($e) {
32:             if ($e instanceof Latte\CompileException) {
33:                 return array(
34:                     'tab' => 'Template',
35:                     'panel' => '<p>'
36:                         . (is_file($e->sourceName)
37:                             ? '<b>File:</b> ' . Helpers::editorLink($e->sourceName, $e->sourceLine)
38:                             : htmlspecialchars($e->sourceName))
39:                         . '</p>'
40:                         . ($e->sourceCode
41:                             ? '<pre>' . BlueScreen::highlightLine(htmlspecialchars($e->sourceCode), $e->sourceLine) . '</pre>'
42:                             : ''),
43:                 );
44:             } elseif ($e instanceof Nette\Neon\Exception && preg_match('#line (\d+)#', $e->getMessage(), $m)) {
45:                 if ($item = Helpers::findTrace($e->getTrace(), 'Nette\DI\Config\Adapters\NeonAdapter::load')) {
46:                     return array(
47:                         'tab' => 'NEON',
48:                         'panel' => '<p><b>File:</b> ' . Helpers::editorLink($item['args'][0], $m[1]) . '</p>'
49:                             . BlueScreen::highlightFile($item['args'][0], $m[1])
50:                     );
51:                 } elseif ($item = Helpers::findTrace($e->getTrace(), 'Nette\Neon\Decoder::decode')) {
52:                     return array(
53:                         'tab' => 'NEON',
54:                         'panel' => BlueScreen::highlightPhp($item['args'][0], $m[1])
55:                     );
56:                 }
57:             }
58:         });
59:     }
60: 
61: }
62: 
Nette 2.2.6 API API documentation generated by ApiGen 2.8.0