Skip to content

Commit

Permalink
some tracy updates
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Aug 13, 2014
1 parent 249b9bf commit def9653
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 24 deletions.
2 changes: 1 addition & 1 deletion vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInitcd548803417e916a9b8fece56bc99491::getLoader();
return ComposerAutoloaderInit59d31b9205a8126f2a856995d42bb492::getLoader();
4 changes: 4 additions & 0 deletions vendor/composer/ClassLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ public function add($prefix, $paths, $prepend = false)
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-0 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*/
public function addPsr4($prefix, $paths, $prepend = false)
{
Expand Down Expand Up @@ -204,6 +206,8 @@ public function set($prefix, $paths)
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param array|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*/
public function setPsr4($prefix, $paths)
{
Expand Down
10 changes: 5 additions & 5 deletions vendor/composer/autoload_real.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

// autoload_real.php @generated by Composer

class ComposerAutoloaderInitcd548803417e916a9b8fece56bc99491
class ComposerAutoloaderInit59d31b9205a8126f2a856995d42bb492
{
private static $loader;

Expand All @@ -19,9 +19,9 @@ public static function getLoader()
return self::$loader;
}

spl_autoload_register(array('ComposerAutoloaderInitcd548803417e916a9b8fece56bc99491', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit59d31b9205a8126f2a856995d42bb492', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitcd548803417e916a9b8fece56bc99491', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit59d31b9205a8126f2a856995d42bb492', 'loadClassLoader'));

$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
Expand All @@ -42,14 +42,14 @@ public static function getLoader()

$includeFiles = require __DIR__ . '/autoload_files.php';
foreach ($includeFiles as $file) {
composerRequirecd548803417e916a9b8fece56bc99491($file);
composerRequire59d31b9205a8126f2a856995d42bb492($file);
}

return $loader;
}
}

function composerRequirecd548803417e916a9b8fece56bc99491($file)
function composerRequire59d31b9205a8126f2a856995d42bb492($file)
{
require $file;
}
8 changes: 4 additions & 4 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@
"source": {
"type": "git",
"url": "https://github.com/nette/tracy.git",
"reference": "398e58b429a67a2ec826663ab8b3a34c0c73dbc9"
"reference": "1250ac4907947b28ec66d6e00a337dadaddaad4c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/tracy/zipball/398e58b429a67a2ec826663ab8b3a34c0c73dbc9",
"reference": "398e58b429a67a2ec826663ab8b3a34c0c73dbc9",
"url": "https://api.github.com/repos/nette/tracy/zipball/1250ac4907947b28ec66d6e00a337dadaddaad4c",
"reference": "1250ac4907947b28ec66d6e00a337dadaddaad4c",
"shasum": ""
},
"require": {
Expand All @@ -132,7 +132,7 @@
"require-dev": {
"nette/tester": "~1.0"
},
"time": "2014-07-22 09:00:36",
"time": "2014-08-07 17:19:48",
"type": "library",
"extra": {
"branch-alias": {
Expand Down
3 changes: 3 additions & 0 deletions vendor/tracy/tracy/src/Tracy/BlueScreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@ public function render(\Exception $exception)
$title = $exception instanceof \ErrorException
? Helpers::errorTypeToString($exception->getSeverity())
: get_class($exception);
$skipError = $sourceIsUrl && $exception instanceof \ErrorException && !empty($exception->skippable)
? $source . (strpos($source, '?') ? '&' : '?') . '_tracy_skip_error'
: NULL;

require __DIR__ . '/templates/bluescreen.phtml';
}
Expand Down
42 changes: 30 additions & 12 deletions vendor/tracy/tracy/src/Tracy/Debugger.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class Debugger
/** @var bool {@link Debugger::enable()} */
private static $enabled = FALSE;

/** @var bool prevent double rendering */
private static $done;

/********************* errors and exceptions reporting ****************d*g**/

/** @var bool|int determines whether any error will cause immediate death; if integer that it's matched against error severity */
Expand Down Expand Up @@ -59,6 +62,9 @@ class Debugger
/** @var string name of the directory where errors should be logged */
public static $logDirectory;

/** @var int log bluescreen in production mode for this error severity */
public static $logSeverity = 0;

/** @var string|array email(s) to which send error notifications */
public static $email;

Expand Down Expand Up @@ -117,7 +123,6 @@ final public function __construct()
*/
public static function enable($mode = NULL, $logDirectory = NULL, $email = NULL)
{
self::$enabled = TRUE;
self::$time = isset($_SERVER['REQUEST_TIME_FLOAT']) ? $_SERVER['REQUEST_TIME_FLOAT'] : microtime(TRUE);
error_reporting(E_ALL | E_STRICT);

Expand Down Expand Up @@ -159,13 +164,17 @@ public static function enable($mode = NULL, $logDirectory = NULL, $email = NULL)
self::exceptionHandler(new \RuntimeException("Unable to set 'display_errors' because function ini_set() is disabled."));
}

register_shutdown_function(array(__CLASS__, 'shutdownHandler'));
set_exception_handler(array(__CLASS__, 'exceptionHandler'));
set_error_handler(array(__CLASS__, 'errorHandler'));
if (!self::$enabled) {
register_shutdown_function(array(__CLASS__, 'shutdownHandler'));
set_exception_handler(array(__CLASS__, 'exceptionHandler'));
set_error_handler(array(__CLASS__, 'errorHandler'));

foreach (array('Tracy\Bar', 'Tracy\BlueScreen', 'Tracy\DefaultBarPanel', 'Tracy\Dumper',
'Tracy\FireLogger', 'Tracy\Helpers', 'Tracy\Logger', ) as $class) {
class_exists($class);
}

foreach (array('Tracy\Bar', 'Tracy\BlueScreen', 'Tracy\DefaultBarPanel', 'Tracy\Dumper',
'Tracy\FireLogger', 'Tracy\Helpers', 'Tracy\Logger', ) as $class) {
class_exists($class);
self::$enabled = TRUE;
}
}

Expand All @@ -186,7 +195,7 @@ public static function isEnabled()
*/
public static function shutdownHandler()
{
if (!self::$enabled) {
if (self::$done) {
return;
}

Expand All @@ -207,10 +216,10 @@ public static function shutdownHandler()
*/
public static function exceptionHandler(\Exception $exception, $exit = TRUE)
{
if (!self::$enabled) {
if (self::$done) {
return;
}
self::$enabled = FALSE; // prevent double rendering
self::$done = TRUE;

if (!headers_sent()) {
$protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
Expand Down Expand Up @@ -297,9 +306,18 @@ public static function errorHandler($severity, $message, $file, $line, $context)
} elseif (($severity & error_reporting()) !== $severity) {
return FALSE; // calls normal error handler to fill-in error_get_last()

} elseif (!self::$productionMode && (is_bool(self::$strictMode) ? self::$strictMode : ((self::$strictMode & $severity) === $severity))) {
} elseif (($severity & self::$logSeverity) === $severity) {
$e = new ErrorException($message, 0, $severity, $file, $line);
$e->context = $context;
self::log($e, self::ERROR);
return NULL;

} elseif (!self::$productionMode && !isset($_GET['_tracy_skip_error'])
&& (is_bool(self::$strictMode) ? self::$strictMode : ((self::$strictMode & $severity) === $severity))
) {
$e = new ErrorException($message, 0, $severity, $file, $line);
$e->context = $context;
$e->skippable = TRUE;
self::exceptionHandler($e);
}

Expand Down Expand Up @@ -476,7 +494,7 @@ public static function barDump($var, $title = NULL, array $options = NULL)


/**
* Logs message or exception to file .
* Logs message or exception to file.
* @param string|Exception
* @return string logged error filename
*/
Expand Down
2 changes: 1 addition & 1 deletion vendor/tracy/tracy/src/Tracy/templates/bluescreen.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ html {
background: white;
color: #333;
position: absolute;
z-index: 20000;
left: 0;
top: 0;
width: 100%;
Expand Down Expand Up @@ -54,7 +55,6 @@ html {
position: absolute;
right: .5em;
top: .5em;
z-index: 20000;
text-decoration: none;
background: #CD1818;
color: white !important;
Expand Down
4 changes: 3 additions & 1 deletion vendor/tracy/tracy/src/Tracy/templates/bluescreen.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* @param string $title
* @param string $source
* @param bool $sourceIsUrl
* @param string $skipError
* @return void
*/

Expand Down Expand Up @@ -48,7 +49,8 @@ $counter = 0;
<h1><?php echo htmlspecialchars($title), ($exception->getCode() ? ' #' . $exception->getCode() : '') ?></h1>

<p><?php echo htmlspecialchars($exception->getMessage(), ENT_IGNORE) ?>
<a href="https://www.google.com/search?sourceid=tracy&amp;q=<?php echo urlencode($title . ' ' . preg_replace('#\'.*\'|".*"#Us', '', $exception->getMessage())) ?>" rel="noreferrer">search&#x25ba;</a></p>
<a href="https://www.google.com/search?sourceid=tracy&amp;q=<?php echo urlencode($title . ' ' . preg_replace('#\'.*\'|".*"#Us', '', $exception->getMessage())) ?>" rel="noreferrer">search&#x25ba;</a>
<?php if ($skipError): ?><a href="<?php echo htmlSpecialChars($skipError, ENT_IGNORE | ENT_QUOTES) ?>">skip error&#x25ba;</a><?php endif ?></p>
</div>

<?php if ($prev = $exception->getPrevious()): ?>
Expand Down

0 comments on commit def9653

Please sign in to comment.