Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be nice to make Kint minimally configurable. I wrote a patch to make configurable some Kint's properties:
theme
(Kint skin)maxLevels
(Max array/object levels to go deep)displayCalledFrom
(Whether to display where kint was called from)maxStrLength
(Max length of string before it is truncated)
Comment | File | Size | Author |
---|---|---|---|
#16 | make-dumper-plugins-configurable-2405179-16.patch | 1.59 KB | leymannx |
| |||
#3 | devel-kint-config-2405179-3.patch | 3.99 KB | willzyx |
#3 | interdiff.txt | 754 bytes | willzyx |
Comments
Comment #1
willzyx CreditAttribution: willzyx commentedComment #2
willzyx CreditAttribution: willzyx commentedReroll after #2392319: Config objects (but not config entities) should by default be immutable see https://www.drupal.org/node/2407153
Comment #3
willzyx CreditAttribution: willzyx commentedLooks like part of the patch (config schema/install) was missed in the last reroll.. Complete patch attached
Comment #6
moshe weitzman CreditAttribution: moshe weitzman at Acquia commentedLooks fine to me.
Comment #7
moshe weitzman CreditAttribution: moshe weitzman at Acquia commentedLooks fine to me.
Comment #8
willzyx CreditAttribution: willzyx commentedI think we should postpone this issue on #2191395: Make dpm() and friends pluggable (with Krumo, Kint, Ladybug etc)
Comment #9
willzyx CreditAttribution: willzyx commentedComment #10
esolitosSince Issue #2191395 is solved, should this be not postponed anymore?
Comment #11
willzyx CreditAttribution: willzyx commentedNow that the pluggable dumper system is in the patch in #3 is not valid anymore.. we need to create a generic way to configure dumper plugins
Comment #12
AnybodyYes this issue should definitely be brought back to life... setting "maxLevels" is for example essential to make theme debugging work for larger objects / arrays!
It's not a good solution to HACK the devel module to set that variable!
Comment #13
xaqroxI would like to help push this forward. Here's what I'm thinking thus far, but I am new to D8's OOP intensity, could someone (@willzyx?) let me know if I'm on the right track?
DevelDumperInterface
needs some way to declare its settings.I'm just not sure how to accomplish all these things. Should DevelDumperInterface have a function returning the names and defaults of configurable settings? Should it also return a form to edit those settings? Where/how do the dumper settings get saved, and how does the implementation access them? Any hints?
Comment #14
lussolucaHi xaqrox,
interesting idea.
You could look at other configurable plugin systems, like the Block one.
Maybe you can start posting some initial patches, then I'll available to review them.
Comment #15
Marko B CreditAttribution: Marko B commentedI would be happy if we just have config option to set in settings.php as this is dev thing, this should be enough so think something like this would be good.
in settings.local.php
$settings['kint_level_depth'] = '20';
then
use Drupal\Core\Site\Settings;
$some_kint_var= settings::get('kint_level_depth', '10') ;
should be enough right?
Comment #16
leymannxI like this approach due to its minimalistic intervention. So I patched
kint/kint/config.default.php
although it doesn't look like as if there should happen muchDrupal
inside. But where else?Now the following could be added to
settings.php
:Comment #17
AnybodyThats at least a starting point... is kint installed via composer or part of devel? Then such a change can be done...
Comment #18
leymannxIt had its own branch
8.x-1.x-kint
opened in 2014 but never updated since. Seems it got added back into the8.x-1.x
branch in the same year and only touched once, in 2016. See http://cgit.drupalcode.org/devel/log/kint/kint?h=8.x-1.xSo Kint probably should be a thing on its own and we probably shouldn't put that
Settings
code in theconfig.default.php
BUT in a duplicatedconfig.php
instead. Which on the other hand gets ignored viakint/kint/.gitignore
. Maybe we should unignoreconfig.php
?Would like to hear what the others think about it.
Comment #19
leymannxI also like @Anybody's approach from https://gist.github.com/JPustkuchen/a5f1eaeb7058856b7ef087b028ffdfeb. If you only use it locally anyways, why not. Minimal intervention. Maximum effect. Simply put the following snippet in your settings.php. No patches needed.
Comment #20
Marko B CreditAttribution: Marko B commentedOk, then at least we should add that info in readme file of kint so people know how to set it up.
Comment #21
moshe weitzman CreditAttribution: moshe weitzman commentedKint project was updated (finally!) and in our 3.x branch its brought in as a composer dependency. Memory issues are gone I think.
Comment #22
moshe weitzman CreditAttribution: moshe weitzman commentedThis issue has been migrated to DrupalSpoons. Its new URL is https://gitlab.com/drupalspoons/devel/-/issues/261.
Comment #23
Marko B CreditAttribution: Marko B commentedMoshe, how is migration of issues done, is it manual or is there some automatic way to do that? Also how do you think to manage future issues that come to d.org and redirect users to go to gitlab?