[eluser]John_Betong[/eluser]
[quote author="pickupman" date="1280725800"]It sounds like you want the information offline in a log file. My code will only show the profiler to a logged in group/user. Having it run in a log file maybe a bit inefficient as it's an additional read/write in the filesystem. For me the profiler is really for development purposes to view queries and $_REQUEST arrays beyond that it doesn't seem to make sense to log the output.
You could look at the output class, and extend the enable_profiler method to write to log instead of appending to the page.[/quote]
I have now solved the problem.
Solution steps:
1. Submit "SPECIFIC_STRING" in my input form
2. Test for "SPECIFIC_STRING" and toggle a $_SESSION['PROF_TOG'] TRUE or FALSE
3. In MY_Controller set $this->output->enable_profiler($_SESSION['PROF_TOG']);
Script:
Code:
// config.php
$_SESSION['PROF_TOG'] = isset($_SESSION['PROF_TOG']) ? $_SESSION['PROF_TOG'] : FALSE;
// controller.php
$_SESSION['words'] = $this->_get_search_words(); // uses $_POST
// Toggle if search === SPECIF_STRING_ON & SPECIF_STRING_OFF
if ('SPECIF_STRING_ON' == trim($_SESSION['words']))
{
$_SESSION['PROF_TOG'] = TRUE;
}
if ('SPECIF_STRING_OFF' == trim($_SESSION['words']))
{
$_SESSION['PROF_TOG'] = FALSE;
}
// My_Controller.php
$this->output->enable_profiler($_SESSION['PROF_TOG']);
The profile information is now browser specic depending on $_SESSION['PROF_TOG']
Many thanks for your suggestion which led to the solution where I did not want any user browsing my site to see the profiling information.