CI_DEBUG environment override |
Is it possible to override the CI_DEBUG constant in app/Config/Boot/development.php?
I would like to override this in .env without editing the development.php file so different environment can turn this on/off without committing the CI_DEBUG file change. I have tried the following (below) with no success: Code: CI_DEBUG = false If this is not possible by default, any suggestions on how to implement a solution into development.php to make it read the .env variables? Thank you!
My temporary solution has been to modify app/Config/Boot/development.php:
PHP Code: defined('CI_DEBUG') || define('CI_DEBUG', getenv('CI_DEBUG') === 'false' ? false : true); This seems to be the only workaround I have found, has anyone else dealt with this issue before?
Try:
Code: --- a/app/Config/Boot/development.php
I don't understand why you need to change the value for development.php. Since you're saying you want to turn it off in other environments, why not set "CI_ENVIRONMENT" to, for example, production so that you will use your production.php's value for CI_DEBUG which is false.
Because I still want to debug errors but I just want Kint disabled.
In production, you only get a "Whoops" message on server errors. Where in development, you get more debug information shown on screen.
Kint is disabled in production environment by default.
It seems all you need to do is to set CI_ENVIRONMENT.
But this is not a production environment. I am still developing, and want debugging information, just without Kint.
For example... An error with CI_ENVIRONMENT set to development shows: The same error with CI_ENVIRONMENT set to productions shows: |
Welcome Guest, Not a member yet? Register Sign In |