Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates To Kint Loading #2565

Merged
merged 1 commit into from
Feb 17, 2020
Merged

Conversation

najdanovicivan
Copy link
Contributor

Description
Here's another way of loading Kint. This makes it use composer version if it's available and only loads Kint from ThirdParty folder if there is no composer version already loaded. This makes it possible to properly update Kint to latest version from composer when when ComposerScripts.php is not being executed fo example when composer's been added after getting zipped framework files and script is left out.

Additionally I've added some configurations for Kint to be obtained from Config\App. We might add additional Kint configurations there as well.

One important config to be set is

\Kint\Renderer\RichRenderer::$folder = false;

This make Kint to be displayed in place where it's called. Otherwise it goes to bottom as toolbar which creates conflicts with debug toolbar.

This also handles the situation where there are Kint calls left out in production environment and Kint is not loaded via composer by always loading Kint classes and setting Kint as disabled. Otherwise the scripts will crash if there are Kint calls and environment is set to anything but production. With this it only skips Kint calls and the app does not crash anymore.

Ref #2373 and #2564

Checklist:

  • Securely signed commits
  • Component(s) with PHPdocs
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@lonnieezell
Copy link
Member

\Kint\Renderer\RichRenderer::$folder = false;

I was searching for this unsuccessfully last night. Thanks.

I think your solution works well. I initially balked at not using our autoloader, but pushing it to its own makes sense as it bypasses the ugly hack I was doing by removing it from our autoloader.

And I do like the idea of config options for Kint. Nice touch.

Merging. Still want a couple of people to bang on the kint3 branch under different scenarios before I merge that into develop just yet, though.

@lonnieezell lonnieezell merged commit 64d053d into codeigniter4:kint3 Feb 17, 2020
@najdanovicivan najdanovicivan deleted the kint3 branch February 18, 2020 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants