Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Kenny Katzgrau's Blog:
Enable Site-Wide Profiling With CodeIgniter
Dec 30, 2010 @ 15:07:33

On his blog today Kenny Katzgrau talks about a handy feature of the CodeIgniter framework - profiling - and how you can implement it site-wide rather than just on a controller by controller basis.

In your controller before you load a view, CodeIgniter will give you information regarding how fast the page loaded, how many SQL queries executed, the content of each query, and the running time of each query. This is incredibly useful when you are trying to debug your application, or simply see how quickly things are loading. There’s only one problem: To enable profiling, that line of code above must be present. What if you want to profile several pages, or even your whole web application?

He turned to another built-in feature of the framework, the controller hooks it allows, to set up a simple post-controller execution that gets a new CodeIgniter instance and enables the profiling configuration item. This is a much better option than having to put the line in each and every controller and method he might want profiled.

tagged: sitewide profiling codeigniter framework tutorial

Link:

Matthew Weir O'Phinney's Blog:
Cgiapp2 Tutorial 2 - Pluggable Applications
Jun 07, 2006 @ 11:17:36

Matthew Weir O'Phinney has created yet another tutorial surrounding the Cgiapp2software and looks this time at something he calls "pluggable applications".

He gives the example of needing a method for creating a well-structured layout in his appication, but also needing a sitewide template to apply to it. Traditional methods don't quite lend themselves to that, so he introduces a new function, cgiapp_postrun, to apply the template after the logic is through.

He includes two examples, one demonstrating the above mentioned situation and the other showing how to make a flexible method for including authentication in only certain parts of the application and not others. Both define a postrun() function to handle the changes to be made after the rest of the logic has finished.

tagged: cgiapp2 tutorial pluggable application sitewide template authentication cgiapp2 tutorial pluggable application sitewide template authentication

Link:

Matthew Weir O'Phinney's Blog:
Cgiapp2 Tutorial 2 - Pluggable Applications
Jun 07, 2006 @ 11:17:36

Matthew Weir O'Phinney has created yet another tutorial surrounding the Cgiapp2software and looks this time at something he calls "pluggable applications".

He gives the example of needing a method for creating a well-structured layout in his appication, but also needing a sitewide template to apply to it. Traditional methods don't quite lend themselves to that, so he introduces a new function, cgiapp_postrun, to apply the template after the logic is through.

He includes two examples, one demonstrating the above mentioned situation and the other showing how to make a flexible method for including authentication in only certain parts of the application and not others. Both define a postrun() function to handle the changes to be made after the rest of the logic has finished.

tagged: cgiapp2 tutorial pluggable application sitewide template authentication cgiapp2 tutorial pluggable application sitewide template authentication

Link:


Trending Topics: