Giter Site home page Giter Site logo

kint's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kint's Issues

Ability to disable "d" keyboard shortcut?

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?

Composer autoload not registering shorthand functions

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.

Some (implemented) extensions that you could integrate

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?

Screenshot

Joe.

Specify depth per dump.

Instead of a config wide depth level, can we have a per dump with a default? Or a per dump, with the config fallback

custom shorthand functions

Should be able to combine different options, eg dk() would return expanded input without depth restrictions.

"unknown type" variables not dumped

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;

handle direct heredoc & nownoc in params

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
);

ErrorException, Illegal offset type when using dd() and Closure type hinting

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.

Create stable tag for Composer installs

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.

Packagist is not being updated

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?

javascript compression cause naming conflicts

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.

Add a new modifier or config value that will dump data to error_log()

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.

better recursion detection

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);

added &nbsp; to first cell in first row of table presentation

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>&nbsp;</th>';
}

Thanks for this good project. I will sustain it.

Best wishes,

Carmine Iaciofano

add option to collapse all children

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

trace improvements

  1. add ability to expand on show
  2. display place where it was called from when trace array is passed
  3. display a warning when an invalid trace array was passed

Path shortening on Windows has (usual) separator issues

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 );

dd() no styling

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.