-
YanKleber Junior Member
 
-
Posts: 32
Threads: 10
Joined: Apr 2020
Reputation:
0
I am using CI4 installed with Composer.
I checked this thread but it didn't work for me.
I have this set in .env file:
Code: CI_ENVIRONMENT = development
Any idea?
Thanks!
Recovering the wasted time...
-
Gary Member
  
-
Posts: 191
Threads: 38
Joined: Oct 2019
Reputation:
2
04-24-2020, 04:33 PM
(This post was last modified: 04-24-2020, 04:38 PM by Gary.)
Go to app\Config\Filters.php and make sure this line is uncommented:
'after' => [
'toolbar', // comment this out to disable the debug toolbar
You can also check in .htaccess (in the public folder) for CI_ENVIRONMENT... some of these similar settings override others, so having it set in one place doesn't always mean you get what you're expecting.
-
YanKleber Junior Member
 
-
Posts: 32
Threads: 10
Joined: Apr 2020
Reputation:
0
04-24-2020, 04:39 PM
(This post was last modified: 04-24-2020, 04:40 PM by YanKleber.)
(04-24-2020, 04:33 PM)Gary Wrote: Go to app\Config\Filters.php and make sure this line is uncommented:
'after' => [
'toolbar', // comment this out to disable the debug toolbar
It is... either in $aliases as well in $globals...
Here it is my Filters.php file:
PHP Code: class Filters extends BaseConfig { // Makes reading things below nicer, // and simpler to change out script that's used. public $aliases = [ 'csrf' => \CodeIgniter\Filters\CSRF::class, 'toolbar' => \CodeIgniter\Filters\DebugToolbar::class, 'honeypot' => \CodeIgniter\Filters\Honeypot::class, ];
// Always applied before every request public $globals = [ 'before' => [ //'honeypot' // 'csrf', ], 'after' => [ 'toolbar', //'honeypot' ], ];
// Works on all of a particular HTTP method // (GET, POST, etc) as BEFORE filters only // like: 'post' => ['CSRF', 'throttle'], public $methods = [];
// List filter aliases and any before/after uri patterns // that they should run on, like: // 'isLoggedIn' => ['before' => ['account/*', 'profiles/*']], public $filters = []; }
Any other idea?
Recovering the wasted time...
-
YanKleber Junior Member
 
-
Posts: 32
Threads: 10
Joined: Apr 2020
Reputation:
0
04-24-2020, 04:53 PM
(This post was last modified: 04-24-2020, 04:54 PM by YanKleber.)
(04-24-2020, 04:47 PM)Gary Wrote: Have you also checked .htaccess (particularly in the public folder)?
If you make any changes to some of these config files (including .env), you may also need to stop and restart the server to be sure they've been digested (though, I think the .htaccess in the public folder doesn't always seem to require this (?)).
I checked the .htaccess file but I really don't know what to change there. I tried to add to it (at the top) the line:
Code: SetEnv CI_ENVIRONMENT development
But it didn't take ANY effect so I removed it.
And yes, I restarted Apache after all changes.
PS: I think it is not related to the issue, but... my pages are all rendered with "View Parser". I don't think the debugger is available only for whose render pages with plain View, is it?
Recovering the wasted time...
-
Gary Member
  
-
Posts: 191
Threads: 38
Joined: Oct 2019
Reputation:
2
04-24-2020, 05:02 PM
(This post was last modified: 04-24-2020, 05:03 PM by Gary.)
SetEnv CI_ENVIRONMENT development <-- in .htaccess is good.
I stand under possible correction, but as far as I'm aware, it should show up regardless of how the page is generated (though, it doesn't get on-screen (only header) updates if one updates using JavaScript without a page update, or navigates TO the page using JavaScript).
If there are any framework exceptions being thrown (check in the network response tab for these), then it also breaks the toolbar.
-
YanKleber Junior Member
 
-
Posts: 32
Threads: 10
Joined: Apr 2020
Reputation:
0
I see... well I really don't know what else try here...
Recovering the wasted time...
-
YanKleber Junior Member
 
-
Posts: 32
Threads: 10
Joined: Apr 2020
Reputation:
0
Sorry, I stayed away for a while studying CI and was a bit frustrated with the debug bar thing. Today I made some tests and figured a couple things.
I realized that the debugger is throwing the following two errors in console (in EVERY page of my project):
PHP Code: Access to XMLHttpRequest at 'http://localhost/curso-codeigniter4/index.php?debugbar_time=1588198772' from origin 'http://curso-ci4' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. index.php?debugbar:59
GET http://localhost/curso-codeigniter4/index.php?debugbar_time=1588198772 net::ERR_FAILED
If I comment the 'toolbar' line under $globals in Filters.php the error goes away. I think it may be related.
Any idea?
Recovering the wasted time...
|