How to enable debug toolbar in CI4.0.0-rc.3 - 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: How to enable debug toolbar in CI4.0.0-rc.3 (/showthread.php?tid=74855) |
RE: How to enable debug toolbar in CI4.0.0-rc.3 - hbonds - 11-18-2019 (11-17-2019, 06:07 AM)andaru.ru Wrote: Just rename env file to .env & change # CI_ENVIRONMENT = production to CI_ENVIRONMENT = development (Delete #)Yes I tried this way only, but still it is not getting displayed. RE: How to enable debug toolbar in CI4.0.0-rc.3 - engel - 11-18-2019 Adding Code: SetEnv CI_ENVIRONMENT development should fix the problem. Make sure .htaccess is allowed in your apache configuration. RE: How to enable debug toolbar in CI4.0.0-rc.3 - hbonds - 11-22-2019 (11-18-2019, 03:26 AM)engel Wrote: AddingI tried this one, enviroment do get set to development but I can not see debug toolbar or its icon. RE: How to enable debug toolbar in CI4.0.0-rc.3 - MGatner - 11-22-2019 @engel What version of the framework are you using? There have been some toolbar bugs fixed since the last release, and some major issues fixed in the RCs before that. RE: How to enable debug toolbar in CI4.0.0-rc.3 - hbonds - 11-25-2019 Issue is not to set environment, it is already set to development and that is working fine, issue is debug toolbar is not getting displayed on development environment. RE: How to enable debug toolbar in CI4.0.0-rc.3 - Gary - 01-17-2020 (11-15-2019, 09:11 AM)hbonds Wrote: I have set environment to development through .htaccess file using code Hi, Did this question ever get resolved? I had a similar experience today... the debug toolbar was working, and then disappeared whilst I was busy, but I didn't immediately notice it was gone. I checked all the ENVIRONMENT settings, and even tried to stick additional extra-double-triple-sure settings in all the places mentioned in this post, and a few other places too (even though the ENVIRONMENT was initially only set in the .ENV file, which had worked- and still does for me- without a problem). I could even tell when exactly the toolbar had ceased functioning (the logs in \writable\debugbar folder stopped, whereas the general \writable\logs were still being recorded)... but couldn't remember exactly what I was working on at the time. Being a noob, it took me a while to work out that it was a variable that was not being assigned (or even defined) in the header portion of the page that was causing it ($_SESSION['user_session'] wasn't set, so there was no assignment of $user_session): Code: <?php When $user_session was used again in the footer of the page, it didn't throw any errors that made it obvious that it wasn't defined (because the way I was testing for it), and the bits I was working on all seemed functional: Code: <?php If $user_session is simply defined somewhere before it's checked in the footer, the debugbar & its logs comes back. It's repeatable- so the debugbar can be broken on demand . I don't have a handle on why it happens... though, I'm sure one of the experts familiar with the internals could field this question without too much difficulty (?). Hope this helps. Noobie, Gary RE: How to enable debug toolbar in CI4.0.0-rc.3 - littlej - 01-17-2020 Hello mate ! I had a similar issue before, using CI in a subfolder. What does your browser's console says ? Unable to reach some files ? In a local environment, set your base_url to "http://localhost:8080/", then in your console launch "php spark serve". Is it working now with your app ? RE: How to enable debug toolbar in CI4.0.0-rc.3 - JNapolitanoIT - 01-17-2020 Hey there. I would like to add my two cents on this topic. First off, might I suggest that instead of using the following code block to access/manipulate session data: Code: .... that you use the built-in session library instead. This way you don't have to worry too much about sessions closing early, or not at all, or not on time, etc. The session library was built to do the heavy lifting for you so you don't have to worry about anything else. For example, the way to do this is to call the Sessions service using its helper function like so: Code: $session = session(); Now, you can access your session data easily. Reformatting your code from before to utilize this would look like the following: Code: .... You can read more about it here. The reason I bring this up is because the way you're accessing session data could impact the debug toolbar. For example, see here. Also it is always best to utilize the frameworks built-in libraries for consistency across your application. After this, you may want to make sure your write permissions are properly set for the following directory: Code: writable/debugbar/ I hope this helps you out and I am not talking out of my hind-end RE: How to enable debug toolbar in CI4.0.0-rc.3 - Gary - 01-17-2020 (01-17-2020, 12:33 PM)Gary Wrote:(11-15-2019, 09:11 AM)hbonds Wrote: I have set environment to development through .htaccess file using code (01-17-2020, 03:06 PM)JNapolitanoIT Wrote: Hey there. Brilliant! Thanks JNapolitanoIT... I had just started with my experimenting with sessions, which is why I needed the toolbar, and then noticed I'd manage to break it... so now that I'm back up and running and about to pick up where I left off on sessions, your pointers are perfectly timed. Gary RE: How to enable debug toolbar in CI4.0.0-rc.3 - JNapolitanoIT - 01-17-2020 (01-17-2020, 03:06 PM)Gary Wrote:(01-17-2020, 12:33 PM)Gary Wrote:(11-15-2019, 09:11 AM)hbonds Wrote: I have set environment to development through .htaccess file using code You're very welcome I am glad I can be of some help. Good luck with your project. The session library if I am correct is a beefed up port from CodeIgniter 3 and if that's the case then you've got yourself a robust Session library to work with using CodeIgniter 4. It handles all of the session data and does all of the behind-the-scenes stuff so you can focus on developing your application and it is a very powerful library |