CodeIgniter Forums
end of CI Controller call loop - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: end of CI Controller call loop (/showthread.php?tid=78789)



end of CI Controller call loop - Goddard - 03-10-2021

What is the last thing to run in CI 3 ?

Is the CI 3 loop documented some place?

Also I wanted to have an automated way to log performance like time and resource usage.  I want to be able to associate it to my controller function that was called.  Any recommendations?

Does the CI 3 controller have a destructor or something?


RE: end of CI Controller call loop - InsiteFX - 03-10-2021

CodeIgniter 3.1.11 User Guide - Benchmarking Class

CodeIgniter 3.1.11 User Guide - Application Flow Chart

CodeIgniter 3.1.11 User Guide - Design and Architectural Goals


RE: end of CI Controller call loop - Goddard - 03-10-2021

(03-10-2021, 12:12 PM)InsiteFX Wrote: CodeIgniter 3.1.11 User Guide - Benchmarking Class

CodeIgniter 3.1.11 User Guide - Application Flow Chart

CodeIgniter 3.1.11 User Guide - Design and Architectural Goals

Thanks that is helpful.  I knew about the benchmarking class and was planning on using it.  

What I would like to do is have it be logged at the end of every single function call so I can keep track of performance of the application.  I tried going to my MY_Controller inside the __destruct before the parent function is called, but that doesn't work as Session appears to already have been destroyed.

For example in the __destruct it just does this {elapsed_time}, but in the actual benchmark class it looks like it is supposed to return number_format not a view variable.


RE: end of CI Controller call loop - InsiteFX - 03-10-2021

My be extend the bench marking class and have it do the logging for you,
just a though.


RE: end of CI Controller call loop - Goddard - 03-10-2021

Yeah that would work nicely, but still how can I have for instance $this->benchmark->elapsed_time(); run at the end of every single function call in a controller?

Is this some kind of PHP structure I am not familiar with?

Thanks