芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/minscoop.com/system/ThirdParty/Kint/Renderer/RichRenderer.php
Rich\ArrayLimitPlugin::class, 'blacklist' => Rich\BlacklistPlugin::class, 'callable' => Rich\CallablePlugin::class, 'color' => Rich\ColorPlugin::class, 'depth_limit' => Rich\DepthLimitPlugin::class, 'recursion' => Rich\RecursionPlugin::class, 'simplexml_element' => Rich\SimpleXMLElementPlugin::class, 'trace_frame' => Rich\TraceFramePlugin::class, ]; /** * RichRenderer tab plugins should implement TabPluginInterface. * * @psalm-var PluginMap */ public static $tab_plugins = [ 'binary' => Rich\BinaryPlugin::class, 'color' => Rich\ColorPlugin::class, 'method_definition' => Rich\MethodDefinitionPlugin::class, 'microtime' => Rich\MicrotimePlugin::class, 'source' => Rich\SourcePlugin::class, 'table' => Rich\TablePlugin::class, 'timestamp' => Rich\TimestampPlugin::class, ]; public static $pre_render_sources = [ 'script' => [ [self::class, 'renderJs'], [Rich\MicrotimePlugin::class, 'renderJs'], ], 'style' => [ [self::class, 'renderCss'], ], 'raw' => [], ]; /** * Whether or not to render access paths. * * Access paths can become incredibly heavy with very deep and wide * structures. Given mostly public variables it will typically make * up one quarter of the output HTML size. * * If this is an unacceptably large amount and your browser is groaning * under the weight of the access paths - your first order of buisiness * should be to get a new browser. Failing that, use this to turn them off. * * @var bool */ public static $access_paths = true; /** * The maximum length of a string before it is truncated. * * Falsey to disable * * @var int */ public static $strlen_max = 80; /** * Path to the CSS file to load by default. * * @var string */ public static $theme = 'original.css'; /** * Assume types and sizes don't need to be escaped. * * Turn this off if you use anything but ascii in your class names, * but it'll cause a slowdown of around 10% * * @var bool */ public static $escape_types = false; /** * Move all dumps to a folder at the bottom of the body. * * @var bool */ public static $folder = false; /** * Sort mode for object properties. * * @var int */ public static $sort = self::SORT_NONE; public static $needs_pre_render = true; public static $needs_folder_render = true; public static $always_pre_render = false; public static $js_nonce = null; public static $css_nonce = null; protected $plugin_objs = []; protected $expand = false; protected $force_pre_render = false; protected $use_folder = false; public function __construct() { $this->setUseFolder(self::$folder); $this->setForcePreRender(self::$always_pre_render); } public function setCallInfo(array $info): void { parent::setCallInfo($info); if (\in_array('!', $this->call_info['modifiers'], true)) { $this->setExpand(true); $this->setUseFolder(false); } if (\in_array('@', $this->call_info['modifiers'], true)) { $this->setForcePreRender(true); } } public function setStatics(array $statics): void { parent::setStatics($statics); if (!empty($statics['expanded'])) { $this->setExpand(true); } if (!empty($statics['return'])) { $this->setForcePreRender(true); } } public function setExpand(bool $expand): void { $this->expand = $expand; } public function getExpand(): bool { return $this->expand; } public function setForcePreRender(bool $force_pre_render): void { $this->force_pre_render = $force_pre_render; } public function getForcePreRender(): bool { return $this->force_pre_render; } public function setUseFolder(bool $use_folder): void { $this->use_folder = $use_folder; } public function getUseFolder(): bool { return $this->use_folder; } public function shouldPreRender(): bool { return $this->getForcePreRender() || self::$needs_pre_render; } public function shouldFolderRender(): bool { return $this->getUseFolder() && ($this->getForcePreRender() || self::$needs_folder_render); } public function render(Value $o): string { if (($plugin = $this->getPlugin(self::$value_plugins, $o->hints)) && $plugin instanceof ValuePluginInterface) { $output = $plugin->renderValue($o); if (null !== $output && \strlen($output)) { return $output; } } $children = $this->renderChildren($o); $header = $this->renderHeaderWrapper($o, (bool) \strlen($children), $this->renderHeader($o)); return '
'.$header.$children.'
'; } public function renderNothing(): string { return '
No argument
'; } public function renderHeaderWrapper(Value $o, bool $has_children, string $contents): string { $out = '
getExpand()) { $out .= ' kint-show'; } $out .= '"'; } $out .= '>'; if (self::$access_paths && $o->depth > 0 && ($ap = $o->getAccessPath())) { $out .= '
⇄
'; } if ($has_children) { $out .= '
⧉
'; if (0 === $o->depth) { $out .= '
⌕
'; $out .= '
'; } $out .= '
'; } $out .= $contents; if (!empty($ap)) { $out .= '
'.$this->escape($ap).'
'; } return $out.'
'; } public function renderHeader(Value $o): string { $output = ''; if (null !== ($s = $o->getModifiers())) { $output .= '
'.$s.'
'; } if (null !== ($s = $o->getName())) { $output .= '
'.$this->escape($s).'
'; if ($s = $o->getOperator()) { $output .= $this->escape($s, 'ASCII').' '; } } if (null !== ($s = $o->getType())) { if (self::$escape_types) { $s = $this->escape($s); } if ($o->reference) { $s = '&'.$s; } $output .= '
'.$s.'
'; if ($o instanceof InstanceValue && isset($o->spl_object_id)) { $output .= '#'.((int) $o->spl_object_id); } $output .= ' '; } if (null !== ($s = $o->getSize())) { if (self::$escape_types) { $s = $this->escape($s); } $output .= '('.$s.') '; } if (null !== ($s = $o->getValueShort())) { $s = \preg_replace('/\\s+/', ' ', $s); if (self::$strlen_max) { $s = Utils::truncateString($s, self::$strlen_max); } $output .= $this->escape($s); } return \trim($output); } public function renderChildren(Value $o): string { $contents = []; $tabs = []; foreach ($o->getRepresentations() as $rep) { $result = $this->renderTab($o, $rep); if (\strlen($result)) { $contents[] = $result; $tabs[] = $rep; } } if (empty($tabs)) { return ''; } $output = '
'; if (1 === \count($tabs) && $tabs[0]->labelIsImplicit()) { $output .= \reset($contents); } else { $output .= '
'; foreach ($tabs as $i => $tab) { if (0 === $i) { $output .= '
'; } else { $output .= '
'; } $output .= $this->escape($tab->getLabel()).'
'; } $output .= '
'; foreach ($contents as $i => $tab) { if (0 === $i) { $output .= '
'; } else { $output .= '
'; } $output .= $tab.'
'; } $output .= '
'; } return $output.'
'; } public function preRender(): string { $output = ''; if ($this->shouldPreRender()) { foreach (self::$pre_render_sources as $type => $values) { $contents = ''; foreach ($values as $v) { $contents .= \call_user_func($v, $this); } if (!\strlen($contents)) { continue; } switch ($type) { case 'script': $output .= '