diff --git a/dev/ComposerScripts.php b/dev/ComposerScripts.php index 010d1528..8f9e1b63 100644 --- a/dev/ComposerScripts.php +++ b/dev/ComposerScripts.php @@ -87,7 +87,28 @@ private static function installDependencies() $info = array( 'haveSlevomat' => false, ); - $isCi = \filter_var(\getenv('CI'), FILTER_VALIDATE_BOOLEAN); + self::installUnitTestDependencies(); + if (\filter_var(\getenv('CI'), FILTER_VALIDATE_BOOLEAN)) { + return $info; + } + if (PHP_VERSION_ID >= 80000) { + \exec($composer . ' require vimeo/psalm ^5.22.2 --dev --with-all-dependencies --no-scripts'); + } + if (PHP_VERSION_ID >= 70200) { + \exec($composer . ' require slevomat/coding-standard ^8.9.0 --dev --no-scripts'); + $info['haveSlevomat'] = true; + } + return $info; + } + + /** + * Install dependencies needed for unit tests + * + * @return void + */ + private static function installUnitTestDependencies() + { + $composer = $GLOBALS['argv'][0]; PHP_VERSION_ID >= 80000 // need a newer version to avoid ReturnTypeWillChange fatal // v 2.0 requires php 7.0 @@ -100,17 +121,6 @@ private static function installDependencies() if (PHP_VERSION_ID >= 50500) { \exec($composer . ' require guzzlehttp/guzzle --dev --no-scripts'); } - if ($isCi) { - return $info; - } - if (PHP_VERSION_ID >= 80000) { - \exec($composer . ' require vimeo/psalm ^5.22.2 --dev --with-all-dependencies --no-scripts'); - } - if (PHP_VERSION_ID >= 70200) { - \exec($composer . ' require slevomat/coding-standard ^8.9.0 --dev --no-scripts'); - $info['haveSlevomat'] = true; - } - return $info; } /** diff --git a/src/Debug/AbstractDebug.php b/src/Debug/AbstractDebug.php index 3456b4b3..492a2c64 100644 --- a/src/Debug/AbstractDebug.php +++ b/src/Debug/AbstractDebug.php @@ -180,11 +180,8 @@ public function onConfig(Event $event) return; } $valActions = \array_intersect_key(array( - 'logServerKeys' => function ($val) { - // don't append, replace - $this->cfg['logServerKeys'] = array(); - return $val; - }, + 'channelIcon' => [$this, 'onCfgChannelIcon'], + 'logServerKeys' => [$this, 'onCfgLogServerKeys'], 'serviceProvider' => [$this, 'onCfgServiceProvider'], ), $cfg); foreach ($valActions as $key => $callable) { @@ -192,19 +189,7 @@ public function onConfig(Event $event) $cfg[$key] = $callable($cfg[$key]); } $this->cfg = $this->arrayUtil->mergeDeep($this->cfg, $cfg); - /* - propagate updated vals to child channels - */ - $channels = $this->getChannels(false, true); - if (empty($channels)) { - return; - } - $event['debug'] = $cfg; - $cfg = $this->rootInstance->getPlugin('channel')->getPropagateValues($event->getValues()); - unset($cfg['currentSubject'], $cfg['isTarget']); - foreach ($channels as $channel) { - $channel->config->set($cfg); - } + $this->onConfigPropagate($event, $cfg); } /** @@ -402,4 +387,55 @@ private function bootstrapSetInstances($cfg) $this->rootInstance = $this->parentInstance->rootInstance; } } + + /** + * Handle "channelIcon" config update + * + * @param string|null $val config value + * + * @return string|null + */ + private function onCfgChannelIcon($val) + { + if (\preg_match('/^:(.+):$/', (string) $val, $matches)) { + $val = $this->getCfg('icons.' . $matches[1], Debug::CONFIG_DEBUG); + } + return $val; + } + + /** + * Handle "channelIcon" config update + * + * @param string|null $val config value + * + * @return string|null + */ + private function onCfgLogServerKeys($val) + { + // don't append, replace + $this->cfg['logServerKeys'] = array(); + return $val; + } + + /** + * Propagate updated vals to child channels + * + * @param Event $event Debug::EVENT_CONFIG Event instance + * @param array $cfg Debug config values + * + * @return void + */ + private function onConfigPropagate(Event $event, array $cfg) + { + $channels = $this->getChannels(false, true); + if (empty($channels)) { + return; + } + $event['debug'] = $cfg; + $cfg = $this->rootInstance->getPlugin('channel')->getPropagateValues($event->getValues()); + unset($cfg['currentSubject'], $cfg['isTarget']); + foreach ($channels as $channel) { + $channel->config->set($cfg); + } + } } diff --git a/src/Debug/Collector/AbstractAsyncMiddleware.php b/src/Debug/Collector/AbstractAsyncMiddleware.php index c46d5048..08ab4cfa 100644 --- a/src/Debug/Collector/AbstractAsyncMiddleware.php +++ b/src/Debug/Collector/AbstractAsyncMiddleware.php @@ -29,8 +29,8 @@ class AbstractAsyncMiddleware extends AbstractComponent { protected $cfg = array( 'asyncResponseWithRequest' => true, - 'icon' => 'fa fa-exchange', - 'iconAsync' => 'fa fa-random', + 'icon' => ':send-receive:', + 'iconAsync' => ':asynchronous:', 'idPrefix' => '', 'inclRequestBody' => false, 'inclResponseBody' => false, diff --git a/src/Debug/Collector/DatabaseTrait.php b/src/Debug/Collector/DatabaseTrait.php index 98bcffbe..8c6b8504 100644 --- a/src/Debug/Collector/DatabaseTrait.php +++ b/src/Debug/Collector/DatabaseTrait.php @@ -25,7 +25,7 @@ trait DatabaseTrait protected $loggedStatements = array(); /** @var string */ - protected $icon = 'fa fa-database'; + protected $icon = ':database:'; /** * Logs StatementInfo diff --git a/src/Debug/Collector/DoctrineMiddleware.php b/src/Debug/Collector/DoctrineMiddleware.php index b552041f..e752a644 100644 --- a/src/Debug/Collector/DoctrineMiddleware.php +++ b/src/Debug/Collector/DoctrineMiddleware.php @@ -31,7 +31,7 @@ class DoctrineMiddleware implements MiddlewareInterface protected $debug; /** @var string */ - protected $icon = 'fa fa-database'; + protected $icon = ':database:'; /** * Constructor diff --git a/src/Debug/Collector/OAuth.php b/src/Debug/Collector/OAuth.php index d9af914e..c3680acf 100644 --- a/src/Debug/Collector/OAuth.php +++ b/src/Debug/Collector/OAuth.php @@ -27,7 +27,7 @@ class OAuth extends OAuthBase protected $debugger; /** @var string */ - protected $icon = 'fa fa-handshake-o'; + protected $icon = ':authorize:'; /** @var float */ private $elapsed; @@ -198,15 +198,15 @@ private function logRequest($url) // values available in the headers or elsewhere $this->debugger->log('OAuth Parameters', $this->oauthParams(), $this->debugger->meta('cfg', 'abstracter.stringMinLen.encoded', -1)); $this->debugger->log('additional info', $this->additionalInfo($url)); - $this->debugger->log('request headers', $this->debugger->redactHeaders($debugInfo['headers_sent']), $this->debugger->meta('icon', 'fa fa-arrow-right')); + $this->debugger->log('request headers', $this->debugger->redactHeaders($debugInfo['headers_sent']), $this->debugger->meta('icon', ':send:')); if (isset($debugInfo['body_sent'])) { $this->debugger->log('request body', $debugInfo['body_sent'], $this->debugger->meta(array( - 'icon' => 'fa fa-arrow-right', + 'icon' => ':send:', 'redact' => true, ))); } - $this->debugger->log('response headers', $debugInfo['headers_recv'], $this->debugger->meta('icon', 'fa fa-arrow-left')); - $this->debugger->log('response body', $debugInfo['body_recv'], $this->debugger->meta('icon', 'fa fa-arrow-left')); + $this->debugger->log('response headers', $debugInfo['headers_recv'], $this->debugger->meta('icon', ':receive:')); + $this->debugger->log('response body', $debugInfo['body_recv'], $this->debugger->meta('icon', ':receive:')); if ($this->exception) { $this->debugger->warn(\get_class($this->exception), $this->exception->getMessage()); } diff --git a/src/Debug/Collector/PhpCurlClass.php b/src/Debug/Collector/PhpCurlClass.php index cabc04aa..fed918d1 100644 --- a/src/Debug/Collector/PhpCurlClass.php +++ b/src/Debug/Collector/PhpCurlClass.php @@ -32,7 +32,7 @@ class PhpCurlClass extends Curl private $debug; /** @var string */ - private $icon = 'fa fa-exchange'; + private $icon = ':send-receive:'; /** @var array */ private $debugOptions = array( diff --git a/src/Debug/Collector/SimpleCache.php b/src/Debug/Collector/SimpleCache.php index 8ff1e649..4154e87e 100644 --- a/src/Debug/Collector/SimpleCache.php +++ b/src/Debug/Collector/SimpleCache.php @@ -36,7 +36,7 @@ class SimpleCache implements CacheInterface protected $cache; /** @var string */ - protected $icon = 'fa fa-cube'; + protected $icon = ':cache:'; /** @var list */ protected $loggedActions = array(); diff --git a/src/Debug/Collector/SoapClient.php b/src/Debug/Collector/SoapClient.php index 9a4ef0dd..4f20254a 100644 --- a/src/Debug/Collector/SoapClient.php +++ b/src/Debug/Collector/SoapClient.php @@ -32,7 +32,7 @@ class SoapClient extends SoapClientBase private $debug; /** @var string */ - protected $icon = 'fa fa-exchange'; + protected $icon = ':send-receive:'; /** @var \DOMDocument */ private $dom; diff --git a/src/Debug/Collector/SwiftMailerLogger.php b/src/Debug/Collector/SwiftMailerLogger.php index 8decba76..d2f5ef20 100644 --- a/src/Debug/Collector/SwiftMailerLogger.php +++ b/src/Debug/Collector/SwiftMailerLogger.php @@ -43,7 +43,7 @@ class SwiftMailerLogger implements protected $messages = array(); /** @var string */ - protected $icon = 'fa fa-envelope-o'; + protected $icon = ':email:'; /** @var string */ protected $iconMeta; diff --git a/src/Debug/Collector/TwigExtension.php b/src/Debug/Collector/TwigExtension.php index 73928506..8c668a97 100644 --- a/src/Debug/Collector/TwigExtension.php +++ b/src/Debug/Collector/TwigExtension.php @@ -22,7 +22,7 @@ class TwigExtension extends ProfilerExtension { /** @var string */ - protected $icon = 'fa fa-file-text-o'; + protected $icon = ':template:'; /** @var Debug */ private $debug; diff --git a/src/Debug/Debug.php b/src/Debug/Debug.php index b252a225..988be8e8 100644 --- a/src/Debug/Debug.php +++ b/src/Debug/Debug.php @@ -123,7 +123,7 @@ class Debug extends AbstractDebug /** @var array */ protected $cfg = array( - 'channelIcon' => 'fa fa-list-ul', + 'channelIcon' => ':log:', 'channelName' => 'general', // channel or tab name 'channels' => array( /* @@ -156,6 +156,30 @@ class Debug extends AbstractDebug 'extensionsCheck' => ['curl', 'mbString'], 'headerMaxAll' => 250000, 'headerMaxPer' => null, + 'icons' => array( + 'asynchronous' => 'fa fa-random', + 'authorize' => 'fa fa-handshake-o', + 'cache' => 'fa fa-cube', + 'component' => 'fa fa-puzzle-piece', + 'config' => 'fa fa-cogs', + 'database' => 'fa fa-database', + 'email' => 'fa fa-envelope-o', + 'event' => 'fa fa-bell-o', + 'files' => 'fa fa-files-o', + 'github' => 'fa fa-github fa-lg', + 'loading' => 'fa fa-spinner fa-pulse fa-2x fa-fw', + 'log' => 'fa fa-list-ul', + 'models' => 'fa fa-cubes', + 'php' => '🐘', + 'receive' => 'fa fa-arrow-left', + 'security' => 'fa fa-shield', + 'send' => 'fa fa-arrow-right', + 'send-receive' => 'fa fa-exchange', + 'session' => 'fa fa-suitcase', + 'shutdown' => 'fa fa-power-off', + 'template' => 'fa fa-file-text-o', + 'user' => 'fa fa-user-o', + ), 'key' => null, 'logEnvInfo' => array( // may be set by passing a list 'errorReporting' => true, @@ -181,78 +205,30 @@ class Debug extends AbstractDebug 'output' => false, // output the log? 'outputHeaders' => true, // ie, ChromeLogger and/or firePHP headers 'plugins' => array( - 'channel' => array( - 'class' => 'bdk\Debug\Plugin\Channel', - ), - 'configEvents' => array( - 'class' => 'bdk\Debug\Plugin\ConfigEvents', - ), - 'internalEvents' => array( - 'class' => 'bdk\Debug\Plugin\InternalEvents', - ), - 'logEnv' => array( - 'class' => 'bdk\Debug\Plugin\LogEnv', - ), - 'logFiles' => array( - 'class' => 'bdk\Debug\Plugin\LogFiles', - ), - 'logPhp' => array( - 'class' => 'bdk\Debug\Plugin\LogPhp', - ), - 'logRequest' => array( - 'class' => 'bdk\Debug\Plugin\LogRequest', - ), - 'logResponse' => array( - 'class' => 'bdk\Debug\Plugin\LogResponse', - ), - 'methodAlert' => array( - 'class' => 'bdk\Debug\Plugin\Method\Alert', - ), - 'methodBasic' => array( - 'class' => 'bdk\Debug\Plugin\Method\Basic', - ), - 'methodClear' => array( - 'class' => 'bdk\Debug\Plugin\Method\Clear', - ), - 'methodCount' => array( - 'class' => 'bdk\Debug\Plugin\Method\Count', - ), - 'methodGeneral' => array( - 'class' => 'bdk\Debug\Plugin\Method\General', - ), - 'methodGroup' => array( - 'class' => 'bdk\Debug\Plugin\Method\Group', - ), - 'methodOutput' => array( - 'class' => 'bdk\Debug\Plugin\Method\Output', - ), - 'methodProfile' => array( - 'class' => 'bdk\Debug\Plugin\Method\Profile', - ), - 'methodReqRes' => array( - 'class' => 'bdk\Debug\Plugin\Method\ReqRes', - ), - 'methodTable' => array( - 'class' => 'bdk\Debug\Plugin\Method\Table', - ), - 'methodTime' => array( - 'class' => 'bdk\Debug\Plugin\Method\Time', - ), - 'methodTrace' => array( - 'class' => 'bdk\Debug\Plugin\Method\Trace', - ), - 'prettify' => array( - 'class' => 'bdk\Debug\Plugin\Prettify', - ), - 'redaction' => array( - 'class' => 'bdk\Debug\Plugin\Redaction', - ), - 'route' => array( - 'class' => 'bdk\Debug\Plugin\Route', - ), - 'runtime' => array( - 'class' => 'bdk\Debug\Plugin\Runtime', - ), + 'channel' => array( 'class' => 'bdk\Debug\Plugin\Channel' ), + 'configEvents' => array( 'class' => 'bdk\Debug\Plugin\ConfigEvents' ), + 'internalEvents' => array( 'class' => 'bdk\Debug\Plugin\InternalEvents' ), + 'logEnv' => array( 'class' => 'bdk\Debug\Plugin\LogEnv' ), + 'logFiles' => array( 'class' => 'bdk\Debug\Plugin\LogFiles' ), + 'logPhp' => array( 'class' => 'bdk\Debug\Plugin\LogPhp' ), + 'logRequest' => array( 'class' => 'bdk\Debug\Plugin\LogRequest' ), + 'logResponse' => array( 'class' => 'bdk\Debug\Plugin\LogResponse' ), + 'methodAlert' => array( 'class' => 'bdk\Debug\Plugin\Method\Alert' ), + 'methodBasic' => array( 'class' => 'bdk\Debug\Plugin\Method\Basic' ), + 'methodClear' => array( 'class' => 'bdk\Debug\Plugin\Method\Clear' ), + 'methodCount' => array( 'class' => 'bdk\Debug\Plugin\Method\Count' ), + 'methodGeneral' => array( 'class' => 'bdk\Debug\Plugin\Method\General' ), + 'methodGroup' => array( 'class' => 'bdk\Debug\Plugin\Method\Group' ), + 'methodOutput' => array( 'class' => 'bdk\Debug\Plugin\Method\Output' ), + 'methodProfile' => array( 'class' => 'bdk\Debug\Plugin\Method\Profile' ), + 'methodReqRes' => array( 'class' => 'bdk\Debug\Plugin\Method\ReqRes' ), + 'methodTable' => array( 'class' => 'bdk\Debug\Plugin\Method\Table' ), + 'methodTime' => array( 'class' => 'bdk\Debug\Plugin\Method\Time' ), + 'methodTrace' => array( 'class' => 'bdk\Debug\Plugin\Method\Trace' ), + 'prettify' => array( 'class' => 'bdk\Debug\Plugin\Prettify' ), + 'redaction' => array( 'class' => 'bdk\Debug\Plugin\Redaction' ), + 'route' => array( 'class' => 'bdk\Debug\Plugin\Route' ), + 'runtime' => array( 'class' => 'bdk\Debug\Plugin\Runtime' ), ), 'redactKeys' => [ // case-insensitive 'password', diff --git a/src/Debug/Framework/Cake4.php b/src/Debug/Framework/Cake4.php index 87a92630..ea07c645 100644 --- a/src/Debug/Framework/Cake4.php +++ b/src/Debug/Framework/Cake4.php @@ -164,7 +164,7 @@ public function onMiddleware(Event $event) protected function logEvents() { $debug = $this->debug->getChannel('Events', array( - 'channelIcon' => 'fa fa-bell-o', + 'channelIcon' => ':event:', 'nested' => false, )); diff --git a/src/Debug/Framework/Laravel/CacheEventsSubscriber.php b/src/Debug/Framework/Laravel/CacheEventsSubscriber.php index 501ced1a..f48475e9 100644 --- a/src/Debug/Framework/Laravel/CacheEventsSubscriber.php +++ b/src/Debug/Framework/Laravel/CacheEventsSubscriber.php @@ -39,7 +39,7 @@ class CacheEventsSubscriber /** @var array */ protected $options = array( 'collectValues' => true, - 'icon' => 'fa fa-cube', + 'icon' => ':cache:', ); /** diff --git a/src/Debug/Framework/Laravel/EventsSubscriber.php b/src/Debug/Framework/Laravel/EventsSubscriber.php index 473620b6..02dbd5f9 100644 --- a/src/Debug/Framework/Laravel/EventsSubscriber.php +++ b/src/Debug/Framework/Laravel/EventsSubscriber.php @@ -28,7 +28,7 @@ class EventsSubscriber protected $eventDispatcher; /** @var string */ - protected $icon = 'fa fa-bell-o'; + protected $icon = ':event:'; /** * Constructor diff --git a/src/Debug/Framework/Laravel/LogDb.php b/src/Debug/Framework/Laravel/LogDb.php index 8e633a5f..1d1fecf5 100644 --- a/src/Debug/Framework/Laravel/LogDb.php +++ b/src/Debug/Framework/Laravel/LogDb.php @@ -58,7 +58,7 @@ public function log() $dbManager = $this->app['db']; $dbChannel = $this->debug->getChannel('Db', array( - 'channelIcon' => 'fa fa-database', + 'channelIcon' => ':database:', )); try { diff --git a/src/Debug/Framework/Laravel/LogViews.php b/src/Debug/Framework/Laravel/LogViews.php index f40a1b40..a0218535 100644 --- a/src/Debug/Framework/Laravel/LogViews.php +++ b/src/Debug/Framework/Laravel/LogViews.php @@ -52,7 +52,7 @@ public function log() return; } $this->viewChannel = $this->debug->getChannel('Views', array( - 'channelIcon' => 'fa fa-file-text-o', + 'channelIcon' => ':template:', )); $this->app['events']->listen( 'composing:*', diff --git a/src/Debug/Framework/Laravel/Middleware.php b/src/Debug/Framework/Laravel/Middleware.php index d9048140..d1cc0e02 100644 --- a/src/Debug/Framework/Laravel/Middleware.php +++ b/src/Debug/Framework/Laravel/Middleware.php @@ -203,7 +203,7 @@ protected function logAuth() $debug = $this->debug->rootInstance->getChannel( 'User', array( - 'channelIcon' => 'fa fa-user-o', + 'channelIcon' => ':user:', 'nested' => false, ) ); @@ -331,7 +331,7 @@ protected function logSession() $debug = $this->debug->rootInstance->getChannel( 'Session', array( - 'channelIcon' => 'fa fa-suitcase', + 'channelIcon' => ':session:', 'nested' => false, ) ); diff --git a/src/Debug/Framework/Laravel/ServiceProvider.php b/src/Debug/Framework/Laravel/ServiceProvider.php index c29084a3..f1425173 100644 --- a/src/Debug/Framework/Laravel/ServiceProvider.php +++ b/src/Debug/Framework/Laravel/ServiceProvider.php @@ -101,7 +101,7 @@ public function boot() public function onOutput() { $debug = $this->debug->getChannel('Models', array( - 'channelIcon' => 'fa fa-cubes', + 'channelIcon' => ':models:', 'nested' => false, )); $tableInfoRows = array(); @@ -190,7 +190,7 @@ protected function logConfig() $config = $this->app['config']->all(); \ksort($config); $configChannel = $this->debug->getChannel('Config', array( - 'channelIcon' => 'fa fa-cogs', + 'channelIcon' => ':config:', 'nested' => false, )); $configChannel->log($config); diff --git a/src/Debug/Framework/Symfony/DebugBundle/EventListener/BdkDebugBundleListener.php b/src/Debug/Framework/Symfony/DebugBundle/EventListener/BdkDebugBundleListener.php index 9249f100..57975932 100644 --- a/src/Debug/Framework/Symfony/DebugBundle/EventListener/BdkDebugBundleListener.php +++ b/src/Debug/Framework/Symfony/DebugBundle/EventListener/BdkDebugBundleListener.php @@ -35,14 +35,14 @@ class BdkDebugBundleListener implements EventSubscriberInterface private $debugCfg = array( 'channels' => array( 'event' => array( - 'channelIcon' => 'fa fa-bell-o', + 'channelIcon' => ':event:', 'channelShow' => false, ), 'request' => array( - 'channelIcon' => 'fa fa-arrow-left', + 'channelIcon' => ':request:', ), 'security' => array( - 'channelIcon' => 'fa fa-shield', + 'channelIcon' => ':security:', ), ), 'css' => '.debug .empty {border:none; padding:inherit;}', diff --git a/src/Debug/Framework/Yii1_1/Component.php b/src/Debug/Framework/Yii1_1/Component.php index ea73917d..919289d2 100644 --- a/src/Debug/Framework/Yii1_1/Component.php +++ b/src/Debug/Framework/Yii1_1/Component.php @@ -220,11 +220,10 @@ protected function logSession() return; } - $channelOpts = array( - 'channelIcon' => 'fa fa-suitcase', + $debug = $this->debug->rootInstance->getChannel('Session', array( + 'channelIcon' => ':session:', 'nested' => false, - ); - $debug = $this->debug->rootInstance->getChannel('Session', $channelOpts); + )); $debug->log('session id', $session->sessionID); $debug->log('session name', $session->sessionName); diff --git a/src/Debug/Framework/Yii1_1/LogRoute.php b/src/Debug/Framework/Yii1_1/LogRoute.php index ea4b9c50..1c2bdedf 100644 --- a/src/Debug/Framework/Yii1_1/LogRoute.php +++ b/src/Debug/Framework/Yii1_1/LogRoute.php @@ -291,7 +291,7 @@ private function processSqlCachingLogEntry(array $logEntry) ))), array( 'appendGroup' => $groupId, - 'icon' => 'fa fa-cube', + 'icon' => ':cache:', 'level' => 'info', ) )); diff --git a/src/Debug/Framework/Yii1_1/LogRouteMeta.php b/src/Debug/Framework/Yii1_1/LogRouteMeta.php index f3f18b41..717b63a4 100644 --- a/src/Debug/Framework/Yii1_1/LogRouteMeta.php +++ b/src/Debug/Framework/Yii1_1/LogRouteMeta.php @@ -145,7 +145,7 @@ private function messageMetaApplication(array $logEntry) private function messageMetaSystem(array $logEntry) { $channelName = 'system misc'; - $icon = 'fa fa-cogs'; + $icon = ':config:'; $logEntry['channel'] = $this->debug->getChannel($channelName, array( 'icon' => $icon, )); @@ -169,7 +169,7 @@ private function messageMetaSystemCaching(array $logEntry) return $logEntry; } $channelName = \str_replace('system.caching.', '', $logEntry['category']); - $icon = 'fa fa-cube'; + $icon = ':cache:'; $logEntry['category'] = $channelName; $logEntry['channel'] = $this->debug->getChannel($channelName, array( 'channelIcon' => $icon, @@ -196,7 +196,7 @@ private function messageMetaSystemCaching(array $logEntry) private function messageMetaSystemCmodule(array $logEntry) { $channelName = 'CModule'; - $icon = 'fa fa-puzzle-piece'; + $icon = ':component:'; $logEntry['channel'] = $this->debug->getChannel($channelName, array( 'channelIcon' => $icon, 'channelShow' => false, diff --git a/src/Debug/Framework/Yii1_1/PdoCollector.php b/src/Debug/Framework/Yii1_1/PdoCollector.php index b2d554ad..f4c2b66b 100644 --- a/src/Debug/Framework/Yii1_1/PdoCollector.php +++ b/src/Debug/Framework/Yii1_1/PdoCollector.php @@ -80,7 +80,7 @@ private function pdoGetChannel(CDbConnection $dbConnection) } // nest the PDO channel under our Yii channel return $this->component->debug->getChannel($channelName, array( - 'channelIcon' => 'fa fa-database', + 'channelIcon' => ':database:', 'channelShow' => false, )); } diff --git a/src/Debug/Framework/Yii1_1/UserInfo.php b/src/Debug/Framework/Yii1_1/UserInfo.php index dba89c99..2d9500cb 100644 --- a/src/Debug/Framework/Yii1_1/UserInfo.php +++ b/src/Debug/Framework/Yii1_1/UserInfo.php @@ -55,11 +55,10 @@ public function log() return; } - $channelOpts = array( - 'channelIcon' => 'fa fa-user-o', + $debug = $this->component->debug->rootInstance->getChannel('User', array( + 'channelIcon' => ':user:', 'nested' => false, - ); - $debug = $this->component->debug->rootInstance->getChannel('User', $channelOpts); + )); $this->logIdentityData($user, $debug); $this->logAuthClass($debug); diff --git a/src/Debug/Framework/Yii2/LogTarget.php b/src/Debug/Framework/Yii2/LogTarget.php index 570d8912..827619ca 100644 --- a/src/Debug/Framework/Yii2/LogTarget.php +++ b/src/Debug/Framework/Yii2/LogTarget.php @@ -201,7 +201,7 @@ private function messageMetaApplication($message) */ private function messageMetaCaching($message) { - $icon = 'fa fa-cube'; + $icon = ':cache:'; $message['category'] = null; $message['channel'] = $this->debug->getChannel('Cache', array( 'channelIcon' => $icon, @@ -221,7 +221,7 @@ private function messageMetaCaching($message) */ private function messageMetaConnection($message) { - $icon = 'fa fa-database'; + $icon = ':database:'; $message['category'] = null; $message['channel'] = $this->debug->getChannel('PDO', array( 'channelIcon' => $icon, @@ -241,7 +241,7 @@ private function messageMetaConnection($message) */ private function messageMetaModule($message) { - $icon = 'fa fa-puzzle-piece'; + $icon = ':component:'; $message['channel'] = $this->debug->getChannel($message['category'], array( 'channelIcon' => $icon, )); @@ -260,7 +260,7 @@ private function messageMetaModule($message) */ private function messageMetaView($message) { - $icon = 'fa fa-file-text-o'; + $icon = ':template:'; $message['channel'] = $this->debug->getChannel($message['category'], array( 'channelIcon' => $icon, )); diff --git a/src/Debug/Framework/Yii2/Module.php b/src/Debug/Framework/Yii2/Module.php index ca9a2a31..e0184a05 100644 --- a/src/Debug/Framework/Yii2/Module.php +++ b/src/Debug/Framework/Yii2/Module.php @@ -36,19 +36,19 @@ class Module extends BaseModule implements BootstrapInterface private $configDefault = array( 'channels' => array( 'events' => array( - 'channelIcon' => 'fa fa-bell-o', + 'channelIcon' => ':event:', 'nested' => false, ), 'PDO' => array( - 'channelIcon' => 'fa fa-database', + 'channelIcon' => ':database:', 'channelShow' => false, ), 'Session' => array( - 'channelIcon' => 'fa fa-suitcase', + 'channelIcon' => ':suitcase:', 'nested' => false, ), 'User' => array( - 'channelIcon' => 'fa fa-user-o', + 'channelIcon' => ':user:', 'nested' => false, ), ), diff --git a/src/Debug/LogEntry.php b/src/Debug/LogEntry.php index eef73664..6a72573f 100644 --- a/src/Debug/LogEntry.php +++ b/src/Debug/LogEntry.php @@ -263,6 +263,9 @@ protected function onSet($values = array()) if (isset($values['meta']['appendGroup'])) { $this->values['meta']['appendGroup'] = $this->subject->html->sanitizeId($values['meta']['appendGroup']); } + if (isset($values['meta']['icon']) && \preg_match('/^:(.+):$/', $values['meta']['icon'], $matches)) { + $this->values['meta']['icon'] = $this->subject->getCfg('icons.' . $matches[1], Debug::CONFIG_DEBUG); + } $this->onSetMetaAttribs(); if (\array_key_exists('channel', $values['meta'])) { $this->onSetMetaChannel(); diff --git a/src/Debug/Plugin/AbstractLogReqRes.php b/src/Debug/Plugin/AbstractLogReqRes.php index 24fd6556..c4527506 100644 --- a/src/Debug/Plugin/AbstractLogReqRes.php +++ b/src/Debug/Plugin/AbstractLogReqRes.php @@ -24,7 +24,7 @@ class AbstractLogReqRes protected $cfg = array( 'channelName' => 'Request / Response', 'channelOpts' => array( - 'channelIcon' => 'fa fa-exchange', + 'channelIcon' => ':send-receive:', 'channelSort' => 10, 'nested' => false, ), diff --git a/src/Debug/Plugin/ConfigEvents.php b/src/Debug/Plugin/ConfigEvents.php index b672b8aa..fde3e7d5 100644 --- a/src/Debug/Plugin/ConfigEvents.php +++ b/src/Debug/Plugin/ConfigEvents.php @@ -18,6 +18,8 @@ /** * Handle configuration changes + * + * This plugin only exists on the root Debug instance and only handles changes to the root instance */ class ConfigEvents implements SubscriberInterface { @@ -26,6 +28,7 @@ class ConfigEvents implements SubscriberInterface /** @var bool */ private $isBootstrapped = false; + /** @var bool */ private $isConfigured = false; @@ -90,7 +93,7 @@ public function onConfig(Event $event) * * Ensure that channels is a "tree" vs "flat" * - * @param string $val channels config value + * @param array $val channels config value * * @return array channels tree * diff --git a/src/Debug/Plugin/InternalEvents.php b/src/Debug/Plugin/InternalEvents.php index 97f845ef..e7d112bf 100644 --- a/src/Debug/Plugin/InternalEvents.php +++ b/src/Debug/Plugin/InternalEvents.php @@ -66,7 +66,7 @@ public function onDebugLogShutdown() 'attribs' => array( 'class' => 'php-shutdown', ), - 'icon' => 'fa fa-power-off', + 'icon' => ':shutdown:', ))); } diff --git a/src/Debug/Plugin/LogEnv.php b/src/Debug/Plugin/LogEnv.php index 47bcd4b7..7a8d03f7 100644 --- a/src/Debug/Plugin/LogEnv.php +++ b/src/Debug/Plugin/LogEnv.php @@ -123,7 +123,7 @@ private function logGitInfo() 'font-weight:bold;', 'font-size:1.5em; background-color:#DDD; padding:0 .3em;', $branch, - $this->debug->meta('icon', 'fa fa-github fa-lg') + $this->debug->meta('icon', ':github:') ); $this->debug->groupEnd(); } @@ -146,7 +146,7 @@ private function logSession() $debugWas = $this->debug; $this->debug = $this->debug->rootInstance->getChannel('Session', array( - 'channelIcon' => 'fa fa-suitcase', + 'channelIcon' => ':session:', 'nested' => false, )); $this->logSessionSettings($namePassed); diff --git a/src/Debug/Plugin/LogFiles.php b/src/Debug/Plugin/LogFiles.php index 53bde003..43203896 100644 --- a/src/Debug/Plugin/LogFiles.php +++ b/src/Debug/Plugin/LogFiles.php @@ -26,7 +26,7 @@ class LogFiles extends AbstractComponent implements SubscriberInterface protected $cfg = array( 'asTree' => true, 'channelOpts' => array( - 'channelIcon' => 'fa fa-files-o', + 'channelIcon' => ':files:', 'channelSort' => -10, 'nested' => false, ), diff --git a/src/Debug/Plugin/LogPhp.php b/src/Debug/Plugin/LogPhp.php index d2d79b4d..4d102c5e 100644 --- a/src/Debug/Plugin/LogPhp.php +++ b/src/Debug/Plugin/LogPhp.php @@ -28,7 +28,7 @@ class LogPhp implements SubscriberInterface /** @var array */ protected $cfg = array( 'channelOpts' => array( - 'channelIcon' => '🐘', + 'channelIcon' => ':php:', 'channelSort' => 10, 'nested' => false, ), diff --git a/src/Debug/Plugin/LogRequest.php b/src/Debug/Plugin/LogRequest.php index 1d308f46..d9a2a850 100644 --- a/src/Debug/Plugin/LogRequest.php +++ b/src/Debug/Plugin/LogRequest.php @@ -74,7 +74,7 @@ public function logRequest() 'attribs' => array( 'style' => $this->headerStyle, ), - 'icon' => 'fa fa-arrow-right', + 'icon' => ':send:', )) ); $this->debug->alert( diff --git a/src/Debug/Plugin/LogResponse.php b/src/Debug/Plugin/LogResponse.php index 8945665d..241e826c 100644 --- a/src/Debug/Plugin/LogResponse.php +++ b/src/Debug/Plugin/LogResponse.php @@ -105,7 +105,7 @@ public function logResponse() 'attribs' => array( 'style' => $this->headerStyle, ), - 'icon' => 'fa fa-arrow-left', + 'icon' => ':receive:', )) ); $this->logResponseHeaders(); diff --git a/src/Debug/Route/Html.php b/src/Debug/Route/Html.php index bab20166..70453f0b 100644 --- a/src/Debug/Route/Html.php +++ b/src/Debug/Route/Html.php @@ -94,6 +94,24 @@ public function addAssetProvider(AssetProviderInterface $assetProvider) } } + /** + * Build icon markup + * + * @param string|null $icon Icon css class or html markup + * + * @return string + */ + public function buildIcon($icon) + { + if (empty($icon)) { + return ''; + } + if (\strpos($icon, '<') === false) { + $icon = ''; + } + return $icon; + } + /** * Return all assets or return assets of specific type ("css" or "script") * @@ -314,7 +332,7 @@ private function buildHeader() private function buildLoading() { return $this->cfg['outputScript'] - ? '
Loading
' . "\n" + ? '
Loading ' . $this->buildIcon($this->debug->getCfg('icons.loading', Debug::CONFIG_DEBUG)) . '
' . "\n" : ''; } diff --git a/src/Debug/Route/Html/Tabs.php b/src/Debug/Route/Html/Tabs.php index 1ff47241..4e097e9f 100644 --- a/src/Debug/Route/Html/Tabs.php +++ b/src/Debug/Route/Html/Tabs.php @@ -127,10 +127,7 @@ private function buildTab(Debug $debug) $isActive = true; $label = 'Log'; } - $channelIcon = $debug->getCfg('channelIcon', Debug::CONFIG_DEBUG); - if ($channelIcon && \strpos($channelIcon, '<') === false) { - $channelIcon = ''; - } + $channelIcon = $this->route->buildIcon($debug->getCfg('channelIcon', Debug::CONFIG_DEBUG)); return $this->debug->html->buildTag( 'a', array( diff --git a/src/Debug/Utility/FindExit.php b/src/Debug/Utility/FindExit.php index 2d4ad03b..681114af 100644 --- a/src/Debug/Utility/FindExit.php +++ b/src/Debug/Utility/FindExit.php @@ -114,9 +114,7 @@ public static function getTokens($source, $parse = true, $inclWhitespace = true, */ public function setSkipClasses($classes) { - $classes = (array) $classes; - $classes[] = __CLASS__; - $this->classesSkip = $classes; + $this->classesSkip = \array_merge((array) $classes, [__CLASS__]); } /** @@ -173,12 +171,9 @@ private function searchTokenTest($token, $tokenNext) : null; } if ($token[0] === T_FUNCTION) { - $this->handleTfunction($tokenNext); + $this->handleTFunction($tokenNext); } - if (!$this->inFunc) { - return false; - } - if ($this->funcStack) { + if (!$this->inFunc || $this->funcStack) { return false; } return $token[0] === T_EXIT @@ -187,7 +182,7 @@ private function searchTokenTest($token, $tokenNext) } /** - * keep track of bracket depth + * Keep track of bracket depth * * @param string $token token string * @@ -197,16 +192,17 @@ private function handleStringToken($token) { if ($token === '{') { $this->depth++; - } elseif ($token === '}') { - $this->depth--; - if (\end($this->funcStack) === $this->depth) { - \array_pop($this->funcStack); - } - if ($this->function && $this->depth === 0 && $this->inFunc) { - return false; - } + return true; + } + if ($token !== '}') { + return true; + } + // token === '} + $this->depth--; + if (\end($this->funcStack) === $this->depth) { + \array_pop($this->funcStack); } - return true; + return !($this->function && $this->depth === 0 && $this->inFunc); } /** @@ -216,7 +212,7 @@ private function handleStringToken($token) * * @return void */ - private function handleTfunction($tokenNext) + private function handleTFunction($tokenNext) { if ($this->inFunc) { $this->funcStack[] = $this->depth; diff --git a/src/Debug/js/Debug.jquery.js b/src/Debug/js/Debug.jquery.js index 317c9368..edbd8298 100644 --- a/src/Debug/js/Debug.jquery.js +++ b/src/Debug/js/Debug.jquery.js @@ -2005,36 +2005,39 @@ } function buildChannelLis (channels, nameRoot, checkedChannels, prepend) { - var $li; var $lis = []; var channel; var channelNames = Object.keys(channels).sort(function (a, b) { return a.localeCompare(b) }); $.each(channelNames, function (i, channelName) { - var value = buildChannelValue(channelName, prepend, nameRoot); if (channelName === 'phpError') { // phpError is a special channel return } channel = channels[channelName]; channel.name = channelName; - $li = buildChannelLi( - channel, - value, - checkedChannels !== undefined - ? checkedChannels.indexOf(value) > -1 - : channel.options.show, - channelName === nameRoot - ); - if (Object.keys(channel.channels).length) { - $li.append(buildChannelList(channel.channels, nameRoot, checkedChannels, value + '.')); - } - $lis.push($li); + $lis.push(buildChannelLisIterator(channel, nameRoot, checkedChannels, prepend)); }); return $lis } + function buildChannelLisIterator (channel, nameRoot, checkedChannels, prepend) { + var value = buildChannelValue(channel.name, prepend, nameRoot); + var $li = buildChannelLi( + channel, + value, + checkedChannels !== undefined + ? checkedChannels.indexOf(value) > -1 + : channel.options.show, + channel.name === nameRoot + ); + if (Object.keys(channel.channels).length) { + $li.append(buildChannelList(channel.channels, nameRoot, checkedChannels, value + '.')); + } + return $li + } + /** * Build a single LI element without any children */ diff --git a/src/Debug/js/Debug.jquery.min.js b/src/Debug/js/Debug.jquery.min.js index 216299fe..493c57e5 100644 --- a/src/Debug/js/Debug.jquery.min.js +++ b/src/Debug/js/Debug.jquery.min.js @@ -1 +1 @@ -!function(h){"use strict";var C,O;function P(n){var t,e=n.find("> .array-inner");0 .t_array-expand").length||(h.trim(e.html()).length<1?n.addClass("expanded").find("br").hide():(e=(t=n).find("> .array-inner"),t.closest(".array-file-tree").length?(t.find("> .t_keyword, > .t_punct").remove(),e.find("> li > .t_operator, > li > .t_key.t_int").remove(),t.prevAll(".t_key").each(function(){var e=h(this).attr("data-toggle","array");t.prepend(e),t.prepend('')})):(e=h('array( ··· )'),t.find("> .t_keyword").first().wrap('').after('( ').parent().next().remove(),t.prepend(e)),h.each(C.iconsArray,function(e,t){n.find(e).prepend(t)}),n.debugEnhance(function(e){var t=e.data("expand"),n=e.parentsUntil(".m_group",".t_object, .t_array").length,a=0===n;void 0===t&&0!==n&&(t=e.closest(".t_array[data-expand]").data("expand"));void 0===t&&(t=a);return t||e.hasClass("array-file-tree")}(n)?"expand":"collapse")))}function H(e){O=e.data("config").get(),e.on("click","[data-toggle=vis]",function(){(e=h(e=this),t=e.data("vis"),n=e.closest(".t_object"),a=n.find("> .object-inner"),i=a.find("[data-toggle=vis][data-vis="+t+"]"),t="inherited"===t?"dd[data-inherited-from], .private-ancestor":"."+t,a=a.find(t),t=e.hasClass("toggle-off"),i.html(e.html().replace(t?"show ":"hide ",t?"hide ":"show ")).addClass(t?"toggle-on":"toggle-off").removeClass(t?"toggle-off":"toggle-on"),t)?(i=a).each(function(){var n=h(this),e=n.closest(".object-inner"),a=!0;e.find("> .vis-toggles [data-toggle]").each(function(){var e=h(this),t=e.hasClass("toggle-on"),e=e.data("vis");if(!t&&1===n.filter("inherited"===e?"dd[data-inherited-from], .private-ancestor":"."+e).length)return a=!1}),a&&n.show()}):a.hide();var e,t,n,a,i;return V(n,!0),!1}),e.on("click","[data-toggle=interface]",function(){return N(this),!1})}function F(r){h.each(O.iconsObject,function(e,t){var n,e=function(e,t){var n=t.match(/(?:parent(:\S+)\s)?(?:context(\S+)\s)?(.*)$/);if(null!==n){if(n[1]&&0===e.parent().filter(n[1]).length)return h();if(t=n[3],n[2])return e.filter(n[2]).find(t)}return e.find(t)}(r,e),a="string"==typeof t?t.match(/^([ap])\s*:(.+)$/):null,i=!a||"p"===a[1];a&&(t=a[2]),i?(a=t,n=(i=e).find("> i:first-child + i").after(a),n=(i=i.not(n.parent())).find("> i:first-child").after(a),(i=i.not(n.parent())).prepend(a)):e.append(t)})}function I(e){var t=e.find("> .t_identifier").length?["> .t_identifier"]:["> .classname","> .t_const"];e.find(t.join(",")).each(function(){var e=h(this),t=e.next(),n="object"===e.data("toggle");t.is(".t_maxDepth, .t_recursion, .excluded")?e.addClass("empty"):n||0!==t.length&&(e.wrap('').after(' '),t.hide())})}function N(e){var e=h(e),n=e.closest(".t_object");(e=e.is(".toggle-off")?e.add(e.next().find(".toggle-off")):e.add(e.next().find(".toggle-on"))).each(function(){var e=h(this),t=e.data("interface"),t=R(n,t);e.is(".toggle-off")?(e.addClass("toggle-on").removeClass("toggle-off"),t.show()):(e.addClass("toggle-off").removeClass("toggle-on"),t.hide())}),V(n)}function R(e,t){t='> .object-inner > dd[data-implements="'+CSS.escape(t)+'"]';return e.find(t)}function V(e,t){var n=t?".object-inner > .heading":"> .object-inner > .heading";e.find(t?".object-inner > dt":"> .object-inner > dt").each(function(e,t){var n=h(t).nextUntil("dt"),a=n.not(".heading").filter(function(e,t){return"none"!==h(t).css("display")}),n=0 .object-inner"),i=e.data("accessible"),r=null;e.is(".enhanced")||(a.find("> .private, > .protected").filter(".magic, .magic-read, .magic-write").removeClass("private protected"),"public"===i&&(a.find(".private, .protected").hide(),r="allDesc"),(t=e).find("> .object-inner").find("> dd > ul > li > .interface, > dd > ul > li > .interface + ul .interface").each(function(){var e=h(this).text();0!==R(t,e).length&&h(this).addClass("toggle-on").prop("title","toggle interface methods").attr("data-toggle","interface").attr("data-interface",e)}).filter(".toggle-off").removeClass("toggle-off").each(function(){N(this)}),i=i,i=function(e,t){var n=h('
'),a="public"===t?"toggle-off":"toggle-on",t="public"===t?"show":"hide",i={hasProtected:''+t+" protected",hasPrivate:''+t+" private",hasExcluded:'show excluded',hasInherited:'hide inherited'};return h.each(e,function(e,t){t&&n.append(i[e])}),n}({hasProtected:0<(n=a).children(".protected").not(".magic, .magic-read, .magic-write").length,hasPrivate:0 dd[class*=t_modifier_]").length?n.find("> dd[class*=t_modifier_]").last().after(i):n.prepend(i),F(a),a.find("> .property.forceShow").show().find("> .t_array").debugEnhance("expand"),r&&V(e,"allDesc"===r),e.addClass("enhanced"))}});function $(){var e=h(this).closest(".show-more-container");e.find(".show-more-wrapper").css("display","block").animate({height:"70px"}),e.find(".show-more-fade").fadeIn(),e.find(".show-more").show(),e.find(".show-less").hide()}function U(){var e=h(this).closest(".show-more-container");e.find(".show-more-wrapper").animate({height:e.find(".t_string").height()},400,"swing",function(){h(this).css("display","inline")}),e.find(".show-more-fade").fadeOut(),e.find(".show-more").hide(),e.find(".show-less").show()}function z(e){var t="https://symbl.cc/en/"+h(this).data("codePoint");e.stopPropagation(),window.open(t,"unicode").focus()}function K(e){var t=h(e.target),n=t.closest("li[class*=m_]");e.stopPropagation(),t.find("> .array-inner > li > :last-child, > .array-inner > li[class]").each(function(){W(this,n)})}function J(e){var t=h(e.target);e.stopPropagation(),t.find("> .group-body").debugEnhance()}function Y(e){var t=h(e.target),n=t.closest("li[class*=m_]");e.stopPropagation(),t.is(".enhanced")||(t.find("> .object-inner").find("> .constant > :last-child,> .property > :last-child,> .method .t_string").each(function(){W(this,n)}),B.enhanceInner(t))}function G(e){e=h(e.target),e=e.hasClass("t_array")?e.find("> .array-inner").find("> li > .t_string, > li.t_string"):e.hasClass("m_group")?e.find("> .group-body > li > .t_string"):e.hasClass("t_object")?e.find("> .object-inner").find(["> dd.constant > .t_string","> dd.property:visible > .t_string","> dd.method > ul > li > .t_string.return-value"].join(", ")):h();e.not("[data-type-more=numeric]").each(function(){var e;35<(e=h(this)).height()-70&&((e=e.wrap('
').parent()).append('
'),(e=e.wrap('
').parent()).append(''),e.append(''))})}function X(e){var s=h(e),e=s.find("> thead");s.is("table.sortable")&&(s.addClass("table-sort"),e.on("click","th",function(){var e,t=h(this),n=h(this).closest("tr").children(),a=n.index(t),i="desc"==(t.is(".sort-asc")?"asc":"desc")?"asc":"desc",n=(n.removeClass("sort-asc sort-desc"),t.addClass("sort-"+i),t.find(".sort-arrows").length||(n.find(".sort-arrows").remove(),t.append('')),s[0]),t=a,a=i,r=n.tBodies[0],o=r.rows,n="function"==typeof Intl.Collator?new Intl.Collator([],{numeric:!0,sensitivity:"base"}):null;for(a="desc"===a?-1:1,o=(o=Array.prototype.slice.call(o,0)).sort(function(i,r,o){var s=/^([+-]?(?:0|[1-9]\d*)(?:\.\d*)?)(?:[eE]([+-]?\d+))?$/;return function(e,t){var e=e.cells[i].textContent.trim(),t=t.cells[i].textContent.trim(),n=e.match(s),a=t.match(s);return n&&a?r*function(e,t){if(e .object-inner > .property.debug-value > .t_identifier").filter(function(){return this.innerText.match(/^file$/)}),a=!0===e.data("detectFiles")||0 *:last-child").remove()}else a.find("table thead tr > *:last-child").after("");a.find("table tbody tr").each(function(){var e,t,n,a;e=h(this),t=r,n=e.find("> td"),a={file:e.data("file")||n.eq(0).text(),line:e.data("line")||n.eq(1).text()},a=h("",{class:"file-link",href:ie(a.file,a.line),html:'',style:"vertical-align: bottom",title:"Open in editor"}),t?e.find(".file-link").replaceWith(a):e.hasClass("context")?n.eq(0).attr("colspan",parseInt(n.eq(0).attr("colspan"),10)+1):n.last().after(h("",{class:"text-center",html:a}))})}else e.is("[data-file]")?(i=n,(a=e).find("> .file-link").remove(),i||a.append(h("",{html:'',href:ie(a.data("file"),a.data("line")),title:"Open in editor",class:"file-link lpad"})[0].outerHTML)):(a=t,l=n,d=(t=e).data("foundFiles")||[],a=(a=t.is(".m_table")?t.find("> table > tbody > tr > .t_string"):a)||[],h.each(a,function(){var e,t,n,a,i,r,o,s;t=l,n=d,r=h(e=this),e=e.attributes,o=h.trim(r.text()),n=function(e,t){var n=[],a=h.trim(e.text());if(e.data("file"))return"boolean"==typeof e.data("file")?[null,a,1]:[null,e.data("file"),e.data("line")||1];if(0===t.indexOf(a))return[null,a,1];if(e.parent(".property.debug-value").find("> .t_identifier").text().match(/^file$/))return n={line:1},e.parent().parent().find("> .property.debug-value").each(function(){var e=h(this).find("> .t_identifier")[0].innerText,t=h(this).find("> *:last-child"),t=h.trim(t[0].innerText);n[e]=t}),[null,a,n.line];return a.match(/^(\/.+\.php)(?: \(line (\d+)(, eval'd line \d+)?\))?$/)||[]}(r,n),s=!0!==t&&r.hasClass("file-link"),r.closest(".m_trace").length?c(r.closest(".m_trace")):n.length<1||(n=function(e,t,n,a,i){var r;a?(r=h("",{text:n}),e.removeClass("file-link")):i?(r=e).prop("href",ie(t[1],t[2])):r=h("",{class:"file-link",href:ie(t[1],t[2]),html:n+' ',title:"Open in editor"});return r}(r,n,o,t,s),!1===s&&(a=r,i=n,s=e,h.each(s,function(){var e;void 0===this||(e=this.name,-1<["html","href","title"].indexOf(e))||("class"===e?(i.addClass(this.value),a.removeClass("t_string")):(i.attr(e,this.value),a.removeAttr(e)))}),s.style)&&i.attr("style",s.style.value),!1===r.is("td, th, li")?r.replaceWith(n):r.html(t?o:n))}))}function ie(e,t){var n={file:e,line:t||1};return o.linkFilesTemplate.replace(/%(\w*)\b/g,function(e,t){return Object.prototype.hasOwnProperty.call(n,t)?n[t]:""})}var i,r,re,oe,se=[],le=!1;function de(e){var t;l=e.data("config").get(),C=e.data("config").get(),H(e),W=s,B=q,(t=e).on("click",".close[data-dismiss=alert]",function(){h(this).parent().remove()}),t.on("click",".show-more-container .show-less",$),t.on("click",".show-more-container .show-more",U),t.on("click",".char-ws, .unicode",z),t.on("expand.debug.array",K),t.on("expand.debug.group",J),t.on("expand.debug.object",Y),t.on("expanded.debug.next",".context",function(e){W(h(e.target).find("> td > .t_array"),h(e.target).closest("li"))}),t.on("expanded.debug.array expanded.debug.group expanded.debug.object",G),Z(e)}function ce(e){var t=e.parent(),t=!t.hasClass("m_group")||t.hasClass("expanded");if(e.hide(),e.children().each(function(){fe(h(this))}),t&&e.show().trigger("expanded.debug.group"),!le){for(le=!0;se.length;)se.shift().debugEnhance("expand");le=!1}!1===e.parent().hasClass("m_group")&&e.addClass("enhanced")}function fe(e){if(!e.hasClass("enhanced")){if(e.hasClass("m_group"))i=(a=e).find("> .group-header"),r=i.next(),pe(a),pe(i),i.attr("data-toggle","group"),i.find(".t_array, .t_object").each(function(){h(this).data("expand",!1),s(this,a)}),h.each(["level-error","level-info","level-warn"],function(e,t){var n;a.hasClass(t)&&(n=i.children("i").eq(0),i.wrapInner(''),i.prepend(n))}),a.hasClass("expanded")||r.find(".m_error, .m_warn").not(".filter-hidden").not("[data-uncollapse=false]").length?se.push(i):i.debugEnhance("collapse",!0);else{if(e.hasClass("filter-hidden"))return;var t,n;e.is(".m_table, .m_trace")?(c(t=e),pe(t),t.hasClass("m_table")&&t.find("> table > tbody > tr > td").each(function(){s(this,t)}),t.find("tbody > tr.expanded").next().trigger("expanded.debug.next"),X(t.find("> table"))):((n=e).data("file")&&(n.attr("title")||(r=n.data("file")+": line "+n.data("line"),n.data("evalline")&&(r+=" (eval'd line "+n.data("evalline")+")"),n.attr("title",r)),c(n)),pe(n),n.children().each(function(){s(this,n)}))}var a,i,r;e.addClass("enhanced"),e.trigger("enhanced.debug")}}function s(e,t){e=h(e);e.is(".t_array")?P(e):e.is(".t_object")?I(e):e.is("table")?X(e):e.is(".t_string")?c(t,e):e.is(".string-encoded.tabs-container")&&s(e.find("> .tab-pane.active > *"),t)}function pe(e){var t,n,a,i,r,o=function(e){if(e.data("icon"))return e.data("icon").match("<")?h(e.data("icon")):h("").addClass(e.data("icon"));if(e.hasClass("m_group"))return;return function(e){var t,n;for(n in l.iconsMethods)if(e.is(n)){t=h(l.iconsMethods[n]);break}return t}(e.hasClass("group-header")?e.parent():e)}(e),s=e;for(r in l.iconsMisc)0!==(i=s.find(r)).length&&(a=h(l.iconsMisc[r]),a=(i.find("> i:first-child").hasClass(a.attr("class"))||i.prepend(a),null));o&&(e.hasClass("m_group")?e=e.find("> .group-header .group-label").eq(0):e.find("> table").length&&(n=0 table > caption")).length&&!1==n&&(t=h(""),e.find("> table").prepend(t)),e=t),e.find("> i:first-child").hasClass(o.attr("class"))||e.prepend(o))}function ue(e){(r=(i=e).data("config")).get("drawer")&&(i.addClass("debug-drawer debug-enhanced-ui"),(e=i.find(".debug-menu-bar")).before('
PHP
'),e.find(".float-right").append(''),i.find(".tab-panes").scrollLock(),i.find(".debug-resize-handle").on("mousedown",be),i.find(".debug-pull-tab").on("click",ge),i.find(".debug-menu-bar .close").on("click",he),r.get("persistDrawer"))&&r.get("openDrawer")&&ge()}function ge(){i.addClass("debug-drawer-open"),i.debugEnhance(),ye(),h("body").css("marginBottom",i.height()+8+"px"),h(window).on("resize",ye),r.get("persistDrawer")&&r.set("openDrawer",!0)}function he(){i.removeClass("debug-drawer-open"),h("body").css("marginBottom",""),h(window).off("resize",ye),r.get("persistDrawer")&&r.set("openDrawer",!1)}function me(e){ye(re+(oe-e.pageY),!0)}function be(e){h(e.target).closest(".debug-drawer").is(".debug-drawer-open")&&(re=i.find(".tab-panes").height(),oe=e.pageY,h("html").addClass("debug-resizing"),i.parents().on("mousemove",me).on("mouseup",ve),e.preventDefault())}function ve(){h("html").removeClass("debug-resizing"),i.parents().off("mousemove",me).off("mouseup",ve),h("body").css("marginBottom",i.height()+8+"px")}function ye(e,t){var n=i.find(".tab-panes"),a=i.find(".debug-menu-bar").outerHeight(),a=window.innerHeight-a-50;e=function(e){var t=i.find(".tab-panes");if(e&&"object"!=typeof e)return e;!(e=parseInt(t[0].style.height,10))&&r.get("persistDrawer")&&(e=r.get("height"));return e||100}(e),e=Math.min(e,a),e=Math.max(e,20),n.css("height",e),t&&r.get("persistDrawer")&&r.set("height",e)}h.fn.scrollLock=function(e){return(e=void 0===e||e)?void h(this).on("DOMMouseScroll mousewheel wheel",function(e){function t(){return e.stopPropagation(),e.preventDefault(),e.returnValue=!1}var n=h(this),a=this.scrollTop,i=this.scrollHeight,r=n.innerHeight(),o=e.originalEvent.wheelDelta,s=0 .tab-body > hr").toggleClass("filter-hidden",0 .tab-body").find(" > .debug-log-summary, > .debug-log").filter(function(){return h(this).height()<1}).length)}function Ce(){var e=h(this),t=e.is(":checked"),n=e.closest("label").next("ul").find("input"),a=e.closest(".debug");0 .tab-panes > .tab-primary > .tab-body").find(".m_alert, .group-body > *:not(.m_groupSummary)").each(function(){s.push({depth:h(this).parentsUntil(".tab_body").length,node:h(this)})}),s.sort(function(e,t){return e.depth .group-body").debugEnhance()}(l),r)&&l.hasClass("m_group")&&l.trigger("collapsed.debug.group")}ke(e.find("> .tab-panes > .tab-pane.active")),Te(e)}function Te(e){var t=0
'),a.get("drawer")||e.find("input[name=persistDrawer]").closest("label").remove(),n.find(".debug-options-toggle").on("click",Ie),h("input[name=debugCookie]").on("change",Fe).prop("checked",a.get("debugKey")&&je("debug")===a.get("debugKey")),a.get("debugKey")||h("input[name=debugCookie]").prop("disabled",!0).closest("label").addClass("disabled"),h("input[name=persistDrawer]").on("change",Ve).prop("checked",a.get("persistDrawer")),n.find("input[name=linkFiles]").on("change",Ne).prop("checked",a.get("linkFiles")).trigger("change"),n.find("input[name=linkFilesTemplate]").on("change",Re).val(a.get("linkFilesTemplate"))}function Pe(e){0===n.find(".debug-options").find(e.target).length&&Be()}function He(e){e.keyCode===Se&&Be()}function Fe(){h(this).is(":checked")?Ae("debug",a.get("debugKey"),7):Ae("debug","",-1)}function Ie(e){var t=h(this).closest(".debug-bar").find(".debug-options").is(".show");n=h(this).closest(".debug"),t?Be():(n.find(".debug-options").addClass("show"),h("body").on("click",Pe),h("body").on("keyup",He)),e.stopPropagation()}function Ne(){var e=h(this).prop("checked"),t=h(this).closest(".debug-options").find("input[name=linkFilesTemplate]").closest(".form-group");e?t.slideDown():t.slideUp(),a.set("linkFiles",e),h("input[name=linkFilesTemplate]").trigger("change")}function Re(){var e=h(this).val();a.set("linkFilesTemplate",e),n.trigger("config.debug.updated","linkFilesTemplate")}function Ve(){var e=h(this).is(":checked");a.set({persistDrawer:e,openDrawer:e,openSidebar:!0})}function Be(){n.find(".debug-options").removeClass("show"),h("body").off("click",Pe),h("body").off("keyup",He)}var We,f,p,qe=!1,$e={alert:'Alerts',error:'Error',warn:'Warning',info:'Info',other:'Other'},Ue='
';function ze(e){t=e.data("config")||h("body").data("config"),(Le=e.find("> .tab-panes > .tab-primary").data("options")||{}).sidebar&&Qe(e),t.get("persistDrawer")&&!t.get("openSidebar")&&Ze(e),e.on("click",".close[data-dismiss=alert]",Je),e.on("click",".sidebar-toggle",Ye),e.on("change",".debug-sidebar input[type=checkbox]",Ke),qe||(_e.push(Xe),xe.push(Ge),qe=!0)}function Ke(e){var t=h(this),n=t.closest(".toggle"),a=n.next("ul").find(".toggle"),i=t.is(":checked"),r=h(".m_alert.error-summary.have-fatal");n.toggleClass("active",i),a.toggleClass("active",i),"fatal"===t.val()&&(r.find(".error-fatal").toggleClass("filter-hidden",!i),r.toggleClass("filter-hidden",0===r.children().not(".filter-hidden").length))}function Je(e){var t=h(e.delegateTarget);setTimeout(function(){0===t.find(".tab-primary > .tab-body > .m_alert").length&&t.find(".debug-sidebar input[data-toggle=method][value=alert]").parent().addClass("disabled")})}function Ye(){var e=h(this).closest(".debug");(e.find(".debug-sidebar").is(".show")?Ze:et)(e)}function Ge(e){var t=e[0].className.match(/\bm_(\S+)\b/),t=t?t[1]:null;return!Le.sidebar||("group"===t&&e.find("> .group-body")[0].className.match(/level-(error|info|warn)/)&&(t=e.find("> .group-body")[0].className.match(/level-(error|info|warn)/)[1],e.toggleClass("filter-hidden-body",d.indexOf(t)<0)),-1<["alert","error","warn","info"].indexOf(t)?-1 .tab-primary > .tab-body > .expand-all"),s=(e.find(".tab-panes > .tab-primary > .tab-body").before(r),l=(l=e).closest(".debug").find(".m_alert.error-summary"),(s=l.find(".in-console")).prev().remove(),s.remove(),0===l.children().length&&l.remove(),i=(a=e).find(".debug-sidebar .php-errors ul"),h.each(["fatal","error","warning","deprecated","notice","strict"],function(e,t){var n=("fatal"===t?a.find(".m_alert.error-summary.have-fatal"):a.find(".error-"+t).filter(".m_error,.m_warn")).length;0!==n&&i.append(h("
  • ").append(h('