本文整理汇总了PHP中Tracy\Debugger::getBlueScreen方法的典型用法代码示例。如果您正苦于以下问题:PHP Debugger::getBlueScreen方法的具体用法?PHP Debugger::getBlueScreen怎么用?PHP Debugger::getBlueScreen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tracy\Debugger
的用法示例。
在下文中一共展示了Debugger::getBlueScreen方法的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]));
}
}
});
}
示例2: __construct
public function __construct($slackUrl, IMessageFactory $messageFactory, $timeout)
{
parent::__construct(Debugger::$logDirectory, Debugger::$email, Debugger::getBlueScreen());
$this->slackUrl = $slackUrl;
$this->messageFactory = $messageFactory;
$this->timeout = $timeout;
}
示例3: render
/**
* render.
*
* @method render
*
* @param \Exception $exception
*
* @return string
*/
public function render(Exception $exception)
{
$exception = $this->fixStack($exception, error_get_last());
ob_start();
Helpers::improveException($exception);
Debugger::getBlueScreen()->render($exception);
return ob_get_clean();
}
示例4: getBlueScreen
public static function getBlueScreen($e)
{
ob_start();
TracyDebugger::getBlueScreen()->render($e);
$content = ob_get_clean();
$content = static::updateEditorUri($content);
return $content;
}
示例5: __construct
public function __construct($slackUrl, $logUrl, $channel = NULL, $username = NULL, $icon = NULL, $pretext = NULL)
{
parent::__construct(Debugger::$logDirectory, Debugger::$email, Debugger::getBlueScreen());
$this->slackUrl = $slackUrl;
$this->logUrl = $logUrl;
$this->channel = $channel;
$this->username = $username;
$this->icon = $icon;
$this->pretext = $pretext;
}
示例6: 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()),
);
});
}
示例7: __construct
public function __construct(Monolog\Logger $monolog)
{
$this->monolog = $monolog;
// BC with Nette
if (interface_exists('Tracy\\ILogger') && method_exists($this, 'logException')) {
parent::__construct(Debugger::$logDirectory, Debugger::$email, Debugger::getBlueScreen());
}
$this->directory =& Debugger::$logDirectory;
$this->email =& Debugger::$email;
}
示例8: __construct
/**
* @param string $apiToken
* @param string $room
*/
public function __construct($apiToken, $room, $filters = [], $linkToLogFileFactory = NULL)
{
$reflection = new \ReflectionClass('Tracy\\Logger');
if ($reflection->getConstructor()) {
parent::__construct(Tracy\Debugger::$logDirectory, Tracy\Debugger::$email, Tracy\Debugger::getBlueScreen());
} else {
$this->directory = Tracy\Debugger::$logDirectory;
$this->email = Tracy\Debugger::$email;
}
$this->linkToLogFileFactory = $linkToLogFileFactory;
$this->logger = new Vysinsky\HipChat\Logger($apiToken, $room, $filters);
}
示例9: getBlueScreen
/**
* @return BlueScreen
*/
public static function getBlueScreen()
{
if (!self::$blueScreen || !parent::getBlueScreen() instanceof BlueScreen) {
if (!self::$blueScreen) {
self::$blueScreen = new BlueScreen();
self::$blueScreen->info = ['PHP ' . PHP_VERSION, isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : NULL, 'Tracy ' . self::VERSION];
}
$reflection = new \ReflectionClass(static::class);
$tracyDebugger = $reflection->getParentClass();
$tracyDebuggerBlueScreen = $tracyDebugger->getProperty('blueScreen');
$tracyDebuggerBlueScreen->setAccessible(TRUE);
$tracyDebuggerBlueScreen->setValue(NULL, self::$blueScreen);
}
return self::$blueScreen;
}
示例10: beforeCompile
public function beforeCompile()
{
$config = $this->getConfig();
if (count($config) !== 1 || !isset($config[0])) {
throw new ConfigVersionExtension("Version number not set in config.local.neon. Add this root key: 'version: [1]' to your local config.");
}
$old = $config[0];
$raw = file_get_contents($this->getContainerBuilder()->expand(static::$samplePath));
$sample = Neon::decode($raw);
if (!isset($sample['version'][0]) || count($sample['version']) !== 1) {
throw new ConfigVersionExtension("Version number not set in sample config. Add this root key: 'version: [1]' to your sample config.");
}
$new = $sample['version'][0];
if ($old !== $new) {
Debugger::getBlueScreen()->addPanel($this->getBlueScreenPanelCallback());
throw new ConfigVersionExtension('Sample config neon is not compatible with your current local config. Update your local config according to the diff below.');
}
}
示例11: __construct
/**
* SentryLogger constructor.
* @param $dsn
* @param bool $inDebug
* @param null $directory
* @param null $email
* @param bool $autoWire
* @param array $options
*/
public function __construct($dsn, $inDebug = false, $directory = null, $email = null, $autoWire = true, $options = [])
{
// Compability with nette 2.2.0, Tracy\Logger has no __construct in 2.2.0
if ((new \ReflectionClass('Tracy\\Logger'))->getConstructor()) {
parent::__construct($directory, $email, Debugger::getBlueScreen());
}
//Check for production mode, you will want to fllod sentry only in production... right ?
$this->enabled = Debugger::$productionMode || $inDebug;
$this->raven = new \Raven_Client($dsn, $options);
if ($autoWire) {
//Add sentryNetteLogger to tracy
$that = $this;
Debugger::$onFatalError[] = function ($e) use($that) {
$that->onFatalError($e);
};
// Add logger to tracy
Debugger::setLogger($this);
}
}
示例12: 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]));
}
}
});
}
示例13: 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])];
}
});
}
示例14: __construct
public function __construct($slackUrl, $logUrl)
{
parent::__construct(Debugger::$logDirectory, Debugger::$email, Debugger::getBlueScreen());
$this->slackUrl = $slackUrl;
$this->logUrl = $logUrl;
}
示例15: registerBluescreen
public static function registerBluescreen()
{
Debugger::getBlueScreen()->addPanel(['Librette\\Solarium\\Diagnostics\\Panel', 'renderException']);
}