Welcome Guest, Not a member yet? Register   Sign In
How to enable debug toolbar in CI4.0.0-rc.3

(11-15-2019, 09:11 AM)hbonds Wrote: I have set environment to development through .htaccess file using code

SetEnv CI_ENVIRONMENT development

environment is successfully set to development, but I am still not able to see debug toolbar.
How can I see debug toolbar on application?


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):

     if (isset($_SESSION['user_session'])) {
       $user_session = TRUE;

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:

       if (\App\Controllers\Vars::NOTIFICATION_WEBWORKER_PUBLIC) { // start shared WW if required for non-registered viewers
            require FCPATH.'assets/js/ww_inline.js';
       } else if (($user_session) && (\App\Controllers\Vars::NOTIFICATION_WEBWORKER)) { //  start WW when user signed in
            require FCPATH.'assets/js/ww_inline.js';
       } else if (($user_session) && (\App\Controllers\Vars::NOTIFICATION_SHARED_WEBWORKER)) { // start shared WW when user signed in
       if (\App\Controllers\Vars::NOTIFICATION_SHARED_WEBWORKER_XHR) { // if both XHR & SSE SWW off, then you get none
            $worker_type = 'sww_xhr.js';
       } else if (\App\Controllers\Vars::NOTIFICATION_SHARED_WEBWORKER_SSE) { // if both XHR & SSE SWW off, then you get none
            $worker_type = 'sww_sse.js';
            require FCPATH.'assets/js/sww_inline.js';
       // require FCPATH.'assets/js/post_inline.js';

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 Wink.

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.


Messages In This Thread
RE: How to enable debug toolbar in CI4.0.0-rc.3 - by Gary - 01-17-2020, 12:33 PM

Theme © iAndrew 2016 - Forum software by © MyBB