Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Drupal 8 kint set maxLevels in settings.php to prevent out of memory

Currently devel doesn't allow to override KINT configuration in a clean way. Hopefully this will be possible some day via setting in UI or drupal setting override in settings.php Until this happens you may use this dirty trick in settings.php to override the setting.

See issues:

Simply copy this into your settings.php and change the value accordingly (Kint default: 7)

// Change kint maxLevels setting:
include_once(DRUPAL_ROOT . '/modules/contrib/devel/kint/kint/Kint.class.php');
if(class_exists('Kint')){
  // Set the maxlevels to prevent out-of-memory. Currently there doesn't seem to be a cleaner way to set this:
  Kint::$maxLevels = 4;
}
@JPustkuchen

This comment has been minimized.

Copy link
Owner Author

commented Feb 15, 2018

I think a dynamic path (get devel module path from service) isn't possible at this very early point in bootstrap?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.