CI_DEBUG environment override - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: CI_DEBUG environment override (/showthread.php?tid=84186) |
CI_DEBUG environment override - doitlikejustin - 10-19-2022 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! RE: CI_DEBUG environment override - doitlikejustin - 10-25-2022 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? RE: CI_DEBUG environment override - kenjis - 10-27-2022 Try: Code: --- a/app/Config/Boot/development.php RE: CI_DEBUG environment override - paulbalandan - 10-27-2022 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. RE: CI_DEBUG environment override - doitlikejustin - 10-28-2022 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. RE: CI_DEBUG environment override - kenjis - 10-28-2022 Kint is disabled in production environment by default. It seems all you need to do is to set CI_ENVIRONMENT. RE: CI_DEBUG environment override - doitlikejustin - 10-28-2022 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: |