diff --git a/_data/menu.yml b/_data/menu.yml index 4c2bfe745..6236cbee1 100644 --- a/_data/menu.yml +++ b/_data/menu.yml @@ -8,8 +8,8 @@ url: /settings/ text: Kint settings reference - - url: /contrib/ - text: Improving Kint + url: /internals/ + text: Kint internals - url: /writing-plugins/ text: Writing plugins diff --git a/_includes/example_kint b/_includes/example_kint index 091753bda..b03550b53 100644 --- a/_includes/example_kint +++ b/_includes/example_kint @@ -1,6 +1,7 @@
$time integer 1486849709
2017-02-11 21:48:29 UTC
$data string (740) "eyJjb2xvciI6InJnYmEoMjU1LCAyNTUsIDAsIDAuNSkiLCJkYXRhIjpbeyJ1c2VybmFtZSI6Im1v...
  • Base64
  • Contents
  • base64_decode($data) string (555) "{"color":"rgba(255, 255, 0, 0.5)","data":[{"username":"monkey","created":"20...
    base64_decode($data)
    • Json (2)
    • Contents
    • color => string (22) "rgba(255, 255, 0, 0.5)"
      json_decode(base64_decode($data), true)['color']
      yellow
      +
      $time integer 1486849709
      2017-02-11T21:48:29+00:00
      +
      $data string (740) "eyJjb2xvciI6InJnYmEoMjU1LCAyNTUsIDAsIDAuNSkiLCJkYXRhIjpbeyJ1c2VybmFtZSI6Im1v...
      • Base64
      • Contents
      • base64_decode($data) string (555) "{"color":"rgba(255, 255, 0, 0.5)","data":[{"username":"monkey","created":"20...
        base64_decode($data)
        • Json (2)
        • Contents
        • color => string (22) "rgba(255, 255, 0, 0.5)"
          json_decode(base64_decode($data), true)['color']
          yellow
           #FF0
           #FFFF00
           #FFFF0080
          @@ -8,10 +9,10 @@
           hsla(60, 100%, 50%, 0.5)
           
          data => array (6)
          json_decode(base64_decode($data), true)['data']
          • Table (6)
          • Contents (6)
          • usernamecreatedlastlog
            0monkey2017-01-25 22:24:082017-01-28 14:49:51
            1tiger2017-01-03 11:40:502017-01-09 17:44:48
            2mantis2017-01-03 12:19:482017-01-10 14:46:51
            3snake2017-01-11 22:15:252017-02-06 01:45:46
            4crane2017-01-09 22:28:342017-01-22 00:12:26
            5panda2017-01-14 13:20:402017-01-27 23:14:40
          • 0 => array (3)
            json_decode(base64_decode($data), true)['data'][0]
            username => string (6) "monkey"
            json_decode(base64_decode($data), true)['data'][0]['username']
            created => string (19) "2017-01-25 22:24:08"
            json_decode(base64_decode($data), true)['data'][0]['created']
            lastlog => string (19) "2017-01-28 14:49:51"
            json_decode(base64_decode($data), true)['data'][0]['lastlog']
            1 => array (3)
            json_decode(base64_decode($data), true)['data'][1]
            username => string (5) "tiger"
            json_decode(base64_decode($data), true)['data'][1]['username']
            created => string (19) "2017-01-03 11:40:50"
            json_decode(base64_decode($data), true)['data'][1]['created']
            lastlog => string (19) "2017-01-09 17:44:48"
            json_decode(base64_decode($data), true)['data'][1]['lastlog']
            2 => array (3)
            json_decode(base64_decode($data), true)['data'][2]
            username => string (6) "mantis"
            json_decode(base64_decode($data), true)['data'][2]['username']
            created => string (19) "2017-01-03 12:19:48"
            json_decode(base64_decode($data), true)['data'][2]['created']
            lastlog => string (19) "2017-01-10 14:46:51"
            json_decode(base64_decode($data), true)['data'][2]['lastlog']
            3 => array (3)
            json_decode(base64_decode($data), true)['data'][3]
            username => string (5) "snake"
            json_decode(base64_decode($data), true)['data'][3]['username']
            created => string (19) "2017-01-11 22:15:25"
            json_decode(base64_decode($data), true)['data'][3]['created']
            lastlog => string (19) "2017-02-06 01:45:46"
            json_decode(base64_decode($data), true)['data'][3]['lastlog']
            4 => array (3)
            json_decode(base64_decode($data), true)['data'][4]
            username => string (5) "crane"
            json_decode(base64_decode($data), true)['data'][4]['username']
            created => string (19) "2017-01-09 22:28:34"
            json_decode(base64_decode($data), true)['data'][4]['created']
            lastlog => string (19) "2017-01-22 00:12:26"
            json_decode(base64_decode($data), true)['data'][4]['lastlog']
            5 => array (3)
            json_decode(base64_decode($data), true)['data'][5]
            username => string (5) "panda"
            json_decode(base64_decode($data), true)['data'][5]['username']
            created => string (19) "2017-01-14 13:20:40"
            json_decode(base64_decode($data), true)['data'][5]['created']
            lastlog => string (19) "2017-01-27 23:14:40"
            json_decode(base64_decode($data), true)['data'][5]['lastlog']
        • {"color":"rgba(255, 255, 0, 0.5)","data":[{"username":"monkey","created":"2017-01-25 22:24:08","lastlog":"2017-01-28 14:49:51"},{"username":"tiger","created":"2017-01-03 11:40:50","lastlog":"2017-01-09 17:44:48"},{"username":"mantis","created":"2017-01-03 12:19:48","lastlog":"2017-01-10 14:46:51"},{"username":"snake","created":"2017-01-11 22:15:25","lastlog":"2017-02-06 01:45:46"},{"username":"crane","created":"2017-01-09 22:28:34","lastlog":"2017-01-22 00:12:26"},{"username":"panda","created":"2017-01-14 13:20:40","lastlog":"2017-01-27 23:14:40"}]}
           
      • eyJjb2xvciI6InJnYmEoMjU1LCAyNTUsIDAsIDAuNSkiLCJkYXRhIjpbeyJ1c2VybmFtZSI6Im1vbmtleSIsImNyZWF0ZWQiOiIyMDE3LTAxLTI1IDIyOjI0OjA4IiwibGFzdGxvZyI6IjIwMTctMDEtMjggMTQ6NDk6NTEifSx7InVzZXJuYW1lIjoidGlnZXIiLCJjcmVhdGVkIjoiMjAxNy0wMS0wMyAxMTo0MDo1MCIsImxhc3Rsb2ciOiIyMDE3LTAxLTA5IDE3OjQ0OjQ4In0seyJ1c2VybmFtZSI6Im1hbnRpcyIsImNyZWF0ZWQiOiIyMDE3LTAxLTAzIDEyOjE5OjQ4IiwibGFzdGxvZyI6IjIwMTctMDEtMTAgMTQ6NDY6NTEifSx7InVzZXJuYW1lIjoic25ha2UiLCJjcmVhdGVkIjoiMjAxNy0wMS0xMSAyMjoxNToyNSIsImxhc3Rsb2ciOiIyMDE3LTAyLTA2IDAxOjQ1OjQ2In0seyJ1c2VybmFtZSI6ImNyYW5lIiwiY3JlYXRlZCI6IjIwMTctMDEtMDkgMjI6Mjg6MzQiLCJsYXN0bG9nIjoiMjAxNy0wMS0yMiAwMDoxMjoyNiJ9LHsidXNlcm5hbWUiOiJwYW5kYSIsImNyZWF0ZWQiOiIyMDE3LTAxLTE0IDEzOjIwOjQwIiwibGFzdGxvZyI6IjIwMTctMDEtMjcgMjM6MTQ6NDAifV19
        -
      $object MysteriousObject#2 (2)
      • Properties (2)
      • Available methods
      • Static properties
      • public definition -> string (143) "<?xml version="1.0"?> <Mystery created="2022-11-10 22:33:28"> <Name>Mysterio...
        $object->definition
        • XML
        • Contents
        • Mystery SimpleXMLElement (2)
          simplexml_load_string($object->definition)
          • Children (2)
          • Attributes
          • Name -> SimpleXMLElement (8) "Mysterio"
            (string) simplexml_load_string($object->definition)->Name
            Value -> SimpleXMLElement (6) "Object"
            (string) simplexml_load_string($object->definition)->Value
            • Attributes
            • type => string (10) "mysterious"
              (string) simplexml_load_string($object->definition)->Value['type']
          • created => string (19) "2022-11-10 22:33:28"
            (string) simplexml_load_string($object->definition)['created']
        • <?xml version="1.0"?>
          +
        $object MysteriousObject#2 (2)
        • Properties (2)
        • Available methods
        • Static properties
        Called from <ROOT>/demo.php:9 [d()]
      \ No newline at end of file +
    protected created -> DateTime#5 2022-11-10 22:33:28 +00:00 UTC
    • Available methods (25)
    • Class constants (14)
  • public define(string $definition): void
    $object->define()
    Defined in <ROOT>/demoload.php:58
  • private static $loaded :: boolean true
\ No newline at end of file diff --git a/advanced.md b/advanced.md index 8a8f88703..004444d06 100644 --- a/advanced.md +++ b/advanced.md @@ -128,12 +128,14 @@ These plugins are on in a default Kint installation. * `ProfilePlugin` Profiles your dump to identify classes, interfaces, instances, or properties causing performance issues. * `ProxyPlugin` - Mostly used for tests, this is also useful if you don't want to make your own plugin class. It takes the array of types and bitmask of triggers the plugin should apply to, as well as a callback that should be run. Here's an example of using `ProxyPlugin` to make a simple `ToString` plugin: + This takes the array of types and bitmask of triggers the plugin should apply to, as well as a callback that should be run. The second argument is either a `ContextInterface` or an `AbstractValue` depending on the trigger. + + This is mostly useful if you don't want to make your own plugin class. Here's an example of using `ProxyPlugin` to make a simple `ToString` plugin:
hasMethod('__toString')) {
-                return;
+                return $v;
             }
 
-            $r = new Representation('toString');
             try {
-                $r->contents = (string) $var;
+                $string = (string) $var;
             } catch (Throwable $t) {
-                return;
+                return $v;
             }
 
-            $o->addRepresentation($r);
+            $r = new StringRepresentation('toString', $string);
+            $v->addRepresentation($r);
+
+            return $v;
         }
     );
 
diff --git a/contrib.md b/contrib.md
deleted file mode 100644
index 87a9f99bc..000000000
--- a/contrib.md
+++ /dev/null
@@ -1,128 +0,0 @@
----
-permalink: /contrib/
-title: Improving Kint
----
-
-
-
- -# Improving Kint - -
- -## Contributor guidelines - -You can see a full list of contributor guidelines in the repository. The short (And possibly out of date) version is here: - -* The code has to work from the PHP version specified in `composer.json` up to the latest release, ideally with support for the next version too -* Default plugins should only handle builtin PHP functionality. An exception was made for blacklisting the PSR `ContainerInterface` and `EventDispatcherInterface` due to their disproportionate performance impact and generic nature -* Keep the output clear and concise. Don't display incorrect information -* Don't write bad code. If you make changes make sure you run the formatter and rebuild -* Don't break BC outside a new major release -* Arrays may contain references. Objects are always references. **Don't alter user input in the parser.** - -
-
- -## Setting up a dev environment - -For developing on core Kint you'll need two things: - -1. Composer (PHP) -2. Npm (NodeJS) - -If you don't have composer do yourself a favor and learn it. If you don't have npm that's understandable. - -In any case, Kint uses composer and npm for development tools. Composer calls npm under the assumption that it's in your `$PATH`. - -If all of these are installed simply run `composer install` and all your dependencies will be installed automatically. - -
-
- -## Format and Build - -The reason you need composer and npm, is because they'll let us write sloppy code and have the computer fix it for us! - -Specifically, composer runs php-cs-fixer to reformat PHP code to a consistent style, while npm packages do the same for the JS and SASS files. - -* Static analysis can find bugs in code when even unit tests don't. You should always run `composer analyze` before a commit and fix any errors. -* Tests have to pass. You should always run `./vendor/bin/phpunit tests` before a commit and fix any errors. -* Since code style is a good thing you should always run `composer format` before a commit to fix any inconsistent code style. -* Since we deliver reproducibly compiled JS/CSS/PHAR files in our repo you should always run `composer build` before a commit to rebuild the files and commit them. - -If you fail any of these steps CI will complain. - -
-
- -## Kint architecture and design - -Kint's architecture can roughly be split into: - -* Parsing -* Rendering -* The facade that glues them together - -### Parsing - -The `Kint\Parser` class is instantiated and loaded up with `Kint\Parser\PluginInterface` objects and let loose on the incoming data. It returns a `Kint\Zval\Value` containing information about the input data's type, name, visibility, access path, and a list of `Kint\Zval\Representation\Representation` of the data. (Among other things) - -When it's done parsing it loads up all the applicable plugins and lets them alter the value at will. By the time the value gets back it will likely have even more representations of data. Each of the representations may in turn hold more values. - -In addition to altering the value, the plugins may add to the `hints` array keys on both the values and the representations to inform the renderer as to their options. - -Values can be extended to alter behavior at the value level. Again this is mostly of use in the rendering stage. - -### Rendering - -After you have a value you need to render it. What the renderer does is somewhat irrelevant. It could print out text or it could print out HTML. It could store the dumped data in a database or email it to the ISS. - -If you're using the parser on it's own you can do whatever you want with the data, but if you want to make a renderer that's easily integrated into Kint you'll want to implement the `Kint\Renderer\RendererInterface`. - -Extend the `Kint\Renderer\AbstractRenderer` and it's fairly simple: It has 4 methods that return strings to output. - -* `preRender()` -* `render(Value)` -* `renderNothing()` -* `postRender()` - -Additionally, the `filterParserPlugins(array $plugins)` method lets the renderer alter the list of parser plugins before parsing. This lets renderers that can't support plugins anyway disable them for performance. - -The renderer typically uses hints to inform its rendering behavior. For example, the `blacklist` hint causes the rich renderer to draw a crossed out button instead of a `+`. - -### The Kint facade - -The `Kint\Kint` class is a facade to help dumping data. The process for a standard Kint dump goes like this: - -* Get the settings for this dump. - * Static settings on the `Kint` class - * Information from the backtrace - * Information from the call site - * Variable names - * Modifiers -* Create a parser and set it up -* Add all the plugins you want to use to the parser -* Create a renderer and set it up -* Call the renderer's `preRender` method -* For each variable you want to dump - * Pass it into the parser - * Pass the parser's output value to the renderer -* Call the renderers `postRender` method - -Some of the generic options are handled by `Kint\Utils`, and information about the call site is handled by `Kint\CallFinder`. - -The facade that ties it all together implements `Kint\FacadeInterface` to ensure a consistent constructor, so that extended facades can be statically created with `createFromStatics()`. -
- -

Writing plugins »

- -
diff --git a/images/intro.png b/images/intro.png index f5c2a9583..1e4c8bd9b 100644 Binary files a/images/intro.png and b/images/intro.png differ diff --git a/images/plugin-after.png b/images/plugin-after.png index 46ba33f8a..f1cb3d195 100644 Binary files a/images/plugin-after.png and b/images/plugin-after.png differ diff --git a/images/plugin-before.png b/images/plugin-before.png index e56dc782e..90ed63f62 100644 Binary files a/images/plugin-before.png and b/images/plugin-before.png differ diff --git a/images/plugin-binary.png b/images/plugin-binary.png index 864bad979..02c1ea8d2 100644 Binary files a/images/plugin-binary.png and b/images/plugin-binary.png differ diff --git a/images/plugin-microtime.png b/images/plugin-microtime.png index 525241909..63db46ac3 100644 Binary files a/images/plugin-microtime.png and b/images/plugin-microtime.png differ diff --git a/index.md b/index.md index 512a901db..0cc0edff5 100644 --- a/index.md +++ b/index.md @@ -117,7 +117,6 @@ Let's take a look at this data with Kint * `-d($var)` will attempt to `ob_clean` the previous output and flush after printing * Add heavy classes to the blacklist to improve performance: `Kint\Parser\BlacklistPlugin::$shallow_blacklist[] = SomeLargeClass::class;` -* To put dumps in a toolbar at the bottom of the page set `Kint\Renderer\RichRenderer::$folder = true;` * To change display theme, use `Kint\Renderer\RichRenderer::$theme = 'theme.css';`. You can pass the absolute path to a CSS file, or use one of the built in themes: * `original.css` (default) * `solarized.css` diff --git a/internals.md b/internals.md new file mode 100644 index 000000000..3ef26b2d0 --- /dev/null +++ b/internals.md @@ -0,0 +1,118 @@ +--- +permalink: /internals/ +title: Kint internals +--- + + +
+ +# Kint internals + +
+ +## Overview + +Kint is typically used as an install-and-forget dumping tool but has plenty of options for customization and to be used as a library. + +For both contributing to Kint and for customizing behavior a certain familiarity with Kint's internals is required. This page provides a brief overview of what goes on under the hood. + +First, a `Kint\Value\Context\ContextInterface` is passed into `Kint\Parser` along with a PHP value. The parser then creates a `Kint\Value\AbstractValue` to represent the value and returns it. + +Once the `AbstractValue` has been built it's passed to a `Kint\Renderer\RendererInterface` which produces a string output. + +Creating the initial `ContextInterface` (Which includes the input value's name among other things) and sticking all of this together is handled by the `Kint\Kint` facade (which is aliased to `\Kint`) + +
+
+ +## Parser + +The parser receives an input value and a `ContextInterface` as parameters. It calls `gettype()` to get the first piece of information about the input data. + +The parser loops through its `Kint\Parser\PluginBeginInterface` plugins and if one of them returns an `AbstractValue` this is the value returned. + +If not, it switches on the type and calls one of various specialized parsing routines. In the case of arrays and objects this will result in recursive parsing of child values. Since references are a thing the parser has to detect recursive data structures to prevent infinite recursion. + +After the basic parse is done and the `AbstractValue` has been created the parser loops through its `PluginCompleteInterface` plugins which can each alter the value and returns the final result. + +
+
+ +## Values + +Values all must inherit from `AbstractValue`. All values have a string `$type` and an integer `$flags` which contains a bitmask of states common to all values (Such as when a value is blacklisted or reaches the depth limit) + +Depending on the type of data a value may have more properties. A `StringValue` has a string, an encoding, and a length. Meanwhile an `ArrayValue` has a size and a list of child `AbstractValue` + +Once the parser receives a parameter you no longer have information from the parent scope: what it was called, if it was a child of an array, if it was a private property, or if it was a reference. This is passed into the parser from the parent scope as a `ContextInterface` and stored in `$context` + +Lastly, `$representations` stores a list of `Kint\Value\Representation\RepresentationInterface` attached to the value, which allows the rich renderer to have multiple tabs showing different representations of the same data. + +
+
+ +## Renderer + +The renderer takes values produced by the parser and outputs a string. The exact process varies depending on the renderer. It could print out text or it could print out HTML. It could store the dumped data in a database or email it to the ISS. + +### RichRenderer + +On its own the `Kint\Renderer\RichRenderer` only renders 3 types of representation: `StringRepresentation`, `ValueRepresentation` and `ContainerRepresentation`. + +It has two sets of plugins: A list of `Kint\Renderer\Rich\ValuePluginInterface` for custom rendering of values, and a list of `TabPluginInterface` for custom rendering of representations in a value. + +### TextRenderer + +The `TextRenderer` ignores representations entirely and provides the most succinct explanation possible. For scalar values it will show the value, for arrays it will show the children, and for objects it will show the "Children". + +An objects children are typically the properties but plugins can overwrite them in certain cases. For instance, if an object has no properties the `IteratorPlugin` will set the iterator contents to be the children. + +`TextRenderer` has a list of `Kint\Renderer\Text\PluginInterface` which can alter the rendering of values, and a whitelist of parser plugins to stop all of the plugins from running on every dump. + +The `CliRenderer` and `PlainRenderer` extend `TextRenderer` and provide additional features like colors. + +
+
+ +## Contributor guidelines + +You can see a full list of contributor guidelines in the repository. + +Since the parser takes PHP data by reference, and since input data can contain references itself, you can very easily break your application by accidentally altering data inside the dump. Be **very careful** not to alter user data. + +### Setting up a dev environment + +For developing on core Kint you'll need two things: + +1. Composer (PHP) +2. Npm (NodeJS) + +If you don't have composer do yourself a favor and learn it. If you don't have npm that's understandable. + +In any case, Kint uses composer and npm for development tools. Composer calls npm under the assumption that it's in your `$PATH`. + +If all of these are installed simply run `composer install` and all your dependencies will be installed automatically. + +### Format and Build + +* Static analysis can find bugs in code when even unit tests don't. You should always run `composer analyze` before a commit and fix any errors. +* Tests have to pass. You should always run `./vendor/bin/phpunit tests` before a commit and fix any errors. +* Since code style is a good thing you should always run `composer format` before a commit to fix any inconsistent code style. +* Since we deliver reproducibly compiled JS/CSS/PHAR files in our repo you should always run `composer build` before a commit to rebuild the files and commit them. + +If you fail any of these steps CI will complain. + +
+ +

Writing plugins »

+ +
diff --git a/settings.md b/settings.md index a8f198eae..bbfde0fdf 100644 --- a/settings.md +++ b/settings.md @@ -9,7 +9,7 @@ title: Kint settings reference
  • Parser plugin settings
  • Renderer settings
  • Renderer plugin settings
  • -
  • Improving Kint »
  • +
  • Kint internals »
  • @@ -42,16 +42,16 @@ These are technically on `Kint\Kint` but it's aliased to the root namespace for ### Other settings -`Kint\Zval\Representation\ColorRepresentation` +`Kint\Utils` -`ColorRepresentation::$color_map` | A map of HTML color names to hex codes. +`Utils::$char_encodings` | A list of multibyte character encodings to try to identify to be passed to `mb_detect_encoding`. Default includes `ASCII` and `UTF-8` +`Utils::$legacy_encodings` | A list of windows single-byte and other ambiguous encodings. If no multibyte encoding was detected Kint will assume the first matching legacy_encoding is correct. --- -`Kint\Zval\BlobValue` +`Kint\Value\Representation\ColorRepresentation` -`BlobValue::$char_encodings` | A list of multibyte character encodings to try to identify to be passed to `mb_detect_encoding`. Default includes `ASCII` and `UTF-8` -`BlobValue::$legacy_encodings` | A list of windows single-byte and other ambiguous encodings. If no multibyte encoding was detected Kint will assume the first matching legacy_encoding is correct. +`ColorRepresentation::$color_map` | A map of HTML color names to hex codes.
    @@ -74,7 +74,15 @@ All parser plugins delivered with Kint are in the `Kint\Parser` namespace. ### BlacklistPlugin `BlacklistPlugin::$blacklist` | List of class strings to blacklist. -`BlacklistPlugin::$shallow_blacklist` | List of class strings to blacklist unless you dump it explicitly. This is great for heavy values that impact performance like DI containers. Default includes `Psr\Container\ContainerInterface` +`BlacklistPlugin::$shallow_blacklist` | List of class strings to blacklist unless you dump it explicitly. This is great for heavy values that impact performance like DI containers. Default includes `Psr\Container\ContainerInterface` and `Psr\EventDispatcher\EventDispatcherInterface` + +### ClassHooksPlugin + +`ClassHooksPlugin::$verbose` | Show method for all properties with hooks, not just the ones with docstrings. Default `false` + +### ClassStringsPlugin + +`ClassStringsPlugin::$blacklist` | List of strings to ignore before looking for matching class names. ### DOMDocumentPlugin @@ -123,7 +131,7 @@ All parser plugins delivered with Kint are in the `Kint\Parser` namespace. ### XmlPlugin -`XmlPlugin::$parse_method` | One of `SimpleXML`, `DOMDocument`, or `XMLDocument` DOMDocument is slower, and you'll need to enable `DOMDocumentPlugin` for it to work. `XMLDocument` is PHP8.4+. Default `SimpleXML` +`XmlPlugin::$parse_method` | One of `SimpleXML`, `DOMDocument`, or `XMLDocument`. `XMLDocument` is PHP8.4+. Default `SimpleXML`
    @@ -139,15 +147,15 @@ All parser plugins delivered with Kint are in the `Kint\Parser` namespace. `Kint\Renderer\RichRenderer` +`RichRenderer::$theme` | Which theme to use. One of the CSS files from `resources/compiled/` or the full path to a CSS file. Default `original.css` `RichRenderer::$value_plugins` | List of rich renderer value plugins `RichRenderer::$tab_plugins` | List of rich renderer tab plugins `RichRenderer::$pre_render_sources` | Array of arrays. Keys `script` `style` and `raw` are arrays of strings or callables returning strings. `script` and `style` will be placed in tags with nonces for CSP, while `raw` will be output as-is. -`RichRenderer::$theme` | Which theme to use. One of the CSS files from `resources/compiled/` or the full path to a CSS file. Default `original.css` `RichRenderer::$strlen_max` | The maximum length of text to show in the bar. 0 to disable. Default 80 `RichRenderer::$timestamp` | Timestamp to print in footer in date() format. Default `null` `RichRenderer::$access_paths` | Enable or disable the showing of access paths. Default `true` `RichRenderer::$escape_types` | Enable or disable the escaping of types. Enabling will hurt performance, but allow you to use unicode text on non-utf8 web pages. Default `false` -`RichRenderer::$folder` | Enable a folder attached to the bottom of the viewport and place the dumps in that. Default `false` +`RichRenderer::$folder` | Place dump in folder automatically. Default `false` `RichRenderer::$needs_pre_render` | Whether to render CSS and JS on the next dump. Default `true` before first dump. `RichRenderer::$always_pre_render` | Whether to render CSS and JS on every dump. Default `false` @@ -167,9 +175,9 @@ All parser plugins delivered with Kint are in the `Kint\Parser` namespace. `Kint\Renderer\PlainRenderer` inherits from `TextRenderer` -`PlainRenderer::$pre_render_sources` | List of callables to execute or strings to render before initial render. See also `RichRenderer::$pre_render_sources` `PlainRenderer::$theme` | Which theme to use. One of the CSS files from `resources/compiled/` if using composer, or the full path to a CSS file. Default `plain.css` -`PlainRenderer::$disable_utf8` | Whether to disable the utf-8 parts of the decorations and use htmlentities instead. Vastly increases output size. If your web page isn't in utf-8, set this to `true`. Default `false` +`PlainRenderer::$pre_render_sources` | List of callables to execute or strings to render before initial render. See also `RichRenderer::$pre_render_sources` +`PlainRenderer::$disable_utf8` | Whether to disable the utf-8 parts of the decorations and use htmlentities instead. Vastly increases output size. If your web page isn't in utf-8, set this to `true`. Default `false` `PlainRenderer::$needs_pre_render` | Whether to render CSS and JS on the next dump. Default `true` before first dump. `PlainRenderer::$always_pre_render` | Whether to render CSS and JS on every dump. Default `false` @@ -190,8 +198,8 @@ All parser plugins delivered with Kint are in the `Kint\Parser` namespace. `Kint\Renderer\Rich\BinaryPlugin` -`BinaryPlugin::$chunk_length` | The amount of bytes per chunk of output. Default `0x4` `BinaryPlugin::$line_length` | The amount of bytes per line of output. Default `0x10` +`BinaryPlugin::$chunk_length` | The amount of bytes per chunk of output. Default `0x2` --- @@ -201,6 +209,6 @@ All parser plugins delivered with Kint are in the `Kint\Parser` namespace.
    -

    Improving Kint »

    +

    Kint internals »

    diff --git a/writing-plugins.md b/writing-plugins.md index 57f8427f1..08c5bdb3c 100644 --- a/writing-plugins.md +++ b/writing-plugins.md @@ -5,7 +5,7 @@ title: Writing plugins