Enable profiler globally - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Feature Requests (https://forum.codeigniter.com/forumdisplay.php?fid=29) +--- Thread: Enable profiler globally (/showthread.php?tid=61590) Pages:
1
2
|
RE: Enable profiler globally - John_Betong - 04-29-2015 Try adding the following in your own ./config/config_personal.php PHP Code: <?php # config_personal.php PHP Code: //================================================== RE: Enable profiler globally - PaulD - 04-30-2015 (04-29-2015, 03:32 PM)ivantcholakov Wrote: If it is introduced, maybe this global option should be not enforced in the same way for AJAX requests that output in non-HTML formats. For example, if an AJAX request returns in JSON format, the additional output from the profiler will damage the result, the client will be not able to parse it. Yes that is true, and a good point. In fact also true of normal AJAX requests too. And how would that be identified? From the header? That is probelmatic in itself I suspect. From above (04-29-2015, 06:07 PM)InsiteFX Wrote: This is how I do it with a profiler.php config file. That is a really neat and clever suggestion. Then I can include or not include in controllers I use for ajax and other things where the profiler would not be required. I really like this approach. Simple, clear and effective. Thank you. At the moment I just include the profiler line in all my controllers but commented out and I uncomment when I need it. However going to all the individual controllers (especially in a complicated routing site) is a pain. Your approach will work superbly for me, thank you again. Anyway, given all the points raised in earlier posts, perhaps enabling the profiler globally just has too many complications and inherent problems. I would still like to have it as a config or autoload global variable, but I can see now why maybe the CI developers would prefer not to do it. The debugging help provided by the profiler is just so useful and so powerful that I thought it would be handy to turn it on for all pages when needed and off for all pages when a site goes live globally. Thanks for all the replies though. Best wishes, Paul RE: Enable profiler globally - PaulD - 04-30-2015 (04-29-2015, 07:22 PM)John_Betong Wrote: Try adding the following in your own ./config/config_personal.php That seems an interesting approach too, but I would have to explore it in a bit more detail. But thanks for posting it, I will certainly take a more detailed look at it when I have time to try it out. Thank you for the suggestion and code though, Paul. RE: Enable profiler globally - ivantcholakov - 04-30-2015 I like the idea, although I've pointed out at some practical difficulties. Maybe they are solvable. RE: Enable profiler globally - InsiteFX - 05-01-2015 profiler.php - Create this file in application/config PHP Code: <?php PHP Code: /* MY_Controller PHP Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); RE: Enable profiler globally - RWCH - 05-01-2015 I have used a similar approach as InsiteFX. It's simple. Anybody can use it this way, so no need for 'extra switches'. Configuration is simply done in your configuration file ... also for enabling/disabling a profiler. |