kint-php / kint Goto Github PK
View Code? Open in Web Editor NEWKint - a powerful and modern PHP debugging tool.
Home Page: http://kint-php.github.io/kint/
License: MIT License
Kint - a powerful and modern PHP debugging tool.
Home Page: http://kint-php.github.io/kint/
License: MIT License
save and allow to view previously dumped variables
https://gist.github.com/aequasi/5341974
Heres my code example. Not sure why, but unless i dump with dd, the single clicking functionality doesnt work
Keyboard shortcut to expand all of the nodes would by highly appreciated.
(eg. "f" to expand the nodes and start keyboard navigation, "j" to expand first node and start keyboard navigation)
BTW, there's no direct link to github project on the project home page suggested by google: http://raveren.github.com/kint/
When using Composer to install Kint, the shorthand functions d()
, dd()
, s()
, sd()
do not register until some Kint static method has been called.
Consider:
d($_SERVER); // Fatal error: Call to undefined function d()
Kint::dump($_SERVER); // works correctly
d($_SERVER); // now works because Kint registered its shorthand functions
Switching the autoload argument in composer.json
(line 22) from classmap
to files
will correctly register the functions. This tells Composer to require Kint.class.php
so the setup code executes, exactly like Kint's standard installation practice.
I'm not especially comfortable with the guts of Composer or various Autoloading styles, but I wanted to throw this out there since it seems like an easy fix.
Instead of a config wide depth level, can we have a per dump with a default? Or a per dump, with the config fallback
Dear "raveren",
I use this project to catch table view data and copy-and-paste the value in a spreadsheet to make comparison.
For the purpose to have the pasted data to remain aligned in the cells, I suggest to add a to the first cell in first raw, so that the copied data will not miss it and, then, the first row will not slide to the left.
/tg_app/kint/parsers/parser.class.php:231..233
if ( $firstRow ) {
$extendedValue .= '<th> </th>';
}
Thanks for this good project. I will sustain it.
Best wishes,
Carmine Iaciofano
"Source" and "Arguments" tabs/buttons currently do not react to mouse clicks. They do work with kint's keyboard controls.
Should be able to combine different options, eg dk() would return expanded input without depth restrictions.
Not sure why as you showed me that you had correctly configured packagist to hook to github, but packagist is not being updated with your latest commits. In fact it still has the original version which had the bug with the case of one file. Can you maybe try to rehook it?
Possibly add docbloc output too if available
window.open(
'data:text/html;base64,'
+ window.btoa(
unescape(
encodeURIComponent(
document.documentElement.innerHTML
)
)
)
);
Instead of document.documentElement
use needed Kint nodes along with something along the lines of document.querySelectorAll('script')[0].innerHTML
.
When running PHP on Windows - between server configuration, PHP functions and PHP code paths end up containing most exotic combinations of back and forward slashes.
As result kint's shorten path functionality tends to not work.
It is good practice to equalize all slashes when running comparisons and/or replacements on filesystem paths:
public static function shortenPath( $file, $line = null )
{
$file = str_replace( '\\', '/', $file );
$shortenedName = $file;
foreach ( self::$appRootDirs as $path => $replaceString ) {
$path = str_replace( '\\', '/', $path );
Currently everything is displayed in Packagist with dev-master
but doing so doesn't allow the package to be installed with a minimum stability of stable, only dev. To fix this, create a version tag so that Kint can be installed in stable Composer installs.
since f2cab96, need to rewrite this through decorator parameters, not js
I noticed when you use dd() it as no style to it and it looks like text output only. With d() you get to see the styling. So I don't know if this is a bug because I just found this and so far it's really nice idea & very helpful. Thanks for making Kint.
Having kint on the page interferes with my ability to type the letter d
into an html form. The keyboard navigation is great, usually, but I do not see an option in the config to disable it. Is this currently an option?
Seems like by default kint uses compressed javascript.
This compression creates many global short-named variables, like:
i=function...
This global variables were overwritten somewhere in our big project. "i" is common name for cyclic variable. As a result - expand/close button in kint traces are not working.
I get rid of this by adding:
$_kintSettings['devel'] = true;
But I'm not sure that this will not break something in future releases.
I think there is no need for compression at all, anyway kint is used only in debugging environment.
When you for instance have an array of objects, you don't always want to see the contents of the objects, just the headers.
I imagine the icon to look like 3 horizontal lines
I would like the option to send the dumps to the error log instead of the browser. In a perfect world there would be a modifier for this to send one message and there would be a config setting that would in effect turn that modifier on 100% of the time so that all output goes to the error_log.
How can I implement in Slim Framework ?
An object should be allowed to be displayed more than once. For example:
// *RECURSION* is detected here, even though it is not recursive
$obj = new stdClass;
$arr = array(
'a' => $obj,
'b' => $obj
);
d($arr);
Hi,
I like your tool. I'm currently using it with ASTs so there is a lot of recursive noise. As such I've added a few features that make life a bit easier:
-- color coding and hyperlinking recursive references
-- filter based on property name or class name (this could be further generalised)
-- filter statics
-- filter null values.
I'd be honoured if you'd include my additions in your codebase. What do I need to do to be able to initiate a pull request?
Joe.
Kint::dump( <<<XML
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited by XMLSpy® -->
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
XML
);
I've come across some weird behavior when using dd
with Kint. Consider the following class.
class Foo {
public function bar(Closure $baz)
{
return call_user_func($baz);
}
}
If you attempt to dd
an instance of this class it will throw an ErrorException
.
dd(new Foo);
The weird thing is, if you allow the method to receive a second argument it doesn't freak out on you.
class Foo {
public function bar(Closure $baz, $qux)
{
return call_user_func($baz);
}
}
dd
on a new instance now and it works fine. The next really weird thing is if you reverse the order of the arguments it fails again with an ErrorException
.
class Foo {
public function bar($qux, Closure $baz)
{
return call_user_func($baz);
}
}
I'm not really sure where to begin debugging this as I'm not familiar with Kints code base at all. Hopefully I've given enough information for you to be able to reproduce this.
Running PHP 5.4.13 as well.
When an object has a __toString() function, get it and display it in the header row. Handy for understanding at a glance collapsed objects.
The default shortcut to focus the address bar in Chrome is alt+D.
Kint collides with this shortcut.
To reproduce:
The url browser field is supposed to be focused now, but nothing happens.
It would be good to have ability to use - and ! modifiers together to have clean output, expanded by default.
When there is variable with "unknown type" error appears on parser.class.php:56
# first parse the variable based on its type
$methodName = '_parse_' . gettype( $variable );
gettype in php 5.4 returns "unknown type" according to:
http://php.net/manual/en/function.gettype.php
suggested fix:
# first parse the variable based on its type
$type = gettype( $variable );
if($type == 'unknown type')
$type = 'unknown';
$methodName = '_parse_' . $type;
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.