Tutorial Details
- Topic: CodeIgniter
- Difficulty: Moderate
- Tut Format: Video
In this 15th episode of the series, we are going to learn about three subjects: Profiling, Benchmarking and Hooks. You can use these tools to analyze your CodeIgniter applications performance, and figure out what part of the code you need to optimize. We are also going to make even further improvements to the Profiler library to suit our needs.
Catch Up
- Day 1: Getting Started With the Framework
- Day 2: Database Selecting Methods
- Day 3: Sending Emails
- Day 4: Newsletter Signup
- Day 5: CRUD
- Day 6: Login
- Day 7: Pagination
- Day 8: AJAX
- Day 9: File Uploading and Image Manipulation
- Day 10: The Calendar Library
- Day 11: File and Directory Operations
- Day 12: Shopping Cart
- Day 13: Extending the Framework
- Day 14: Security
- Day 15: Profiling, Benchmarking & Hooks
Day 15: Profiling, Benchmarking & Hooks
Premium Members: Download this Video ( Must be logged in)

Thanks for watching! Any questions/thoughts?
Tags: codeignitercodeigniter from scratchcodeigniter screencastcodeigniter videoframeworkPHPphp frameworkVideos

Thanks a lot for this post.
Definitely this is the best series on Nettuts.
CI RULZZZZ……… :-)
This is the best serise i ever seen on nettuts. and i also started learning CI from this series…Thanks for this post ;)
very very good working thanks a lot
The next part of this series should cover ORM.
http://www.phpandstuff.com/articles/codeigniter-doctrine-from-scratch-day-1-install-and-setup
codigniter and doctrine .. its the best – i have started my CI Experience with this series.
Firstly thank you very much for this gr8 tutorials.
But i have some requests if possible.
1. Can you create more important video tutorials ? Because most people won’t use benchmarking tools. It’s not a common thing to use .
2. Instead of this lets say “non-popular” topics , can you explain for example writing a membership system , writing template system, doctrine on codeigniter(2.0) or other ORMs on codeigniter , backend pro etc.
They are more useful i think.
Thank you for tutorials. I will be looking for more tutorials.
Kolay gelsin hocam.
Take a look at Burak’s personal site (http://www.phpandstuff.com) and I think you will find what you are looking for.
Thanks for the Red Meat Burak!!!!!!
I was starting to get skinny on all of the Tofu for the last few days…..
Thanks Burak,
Nice post on CodeIgniter – profiling, benchmarking & Hooks.
Great explanation on how to use hooks. Thanks, Burak!
Could somebody make a tutorial like this for Zend Framework?
http://zendcast.com is good.
Wonderful! Thanks for this!
Cool article, and the series is great, even if I used CI before. It shows you a style of programming.
This series is excellent. I sometimes wonder how much it helped CodeIgniter grow in popularity – I am pretty sure that such fantastic resources as provided here may encourage a lot of people to try this particular framework as opposed to the other ones which do not have such well-explained tutorials.
I’m studying CI now and starting to fall for it just because of this series.
GREAT :) thanks!
you know would be so great? a full lesson about debug triks.
WOW! Greatttttttttttttttttttt!
Can’t find the video in the Plus section, the link under the video links to the 14th episode :(
Baruk,
According to PHP.NET, Methods with the same name as the last element of a namespaced class name will no longer be treated as constructor. This change doesn’t affect non-namespaced classes.
Just FYI
Excellent!
I’m writing a CI application now and have looked into benchmarking on the documentation site, but could not make any sense of it.
This video helped me alot.
Any chance of video on all of CI’s debugging methods?
Thanks
The next part of this series should cover CI Web Page Caching and CI output class. (Cache)
What do you say guys? Please request…
Caching,
That will be great Khalil.
waiting for your next ci tutorial.
Agree!
This is extremely valuable. I always prefer to build-test-build-test. That way I can refactor stuff as I go. This helps me do that. Very good article, Burak – thanks.
When you build-build-build-test – it leaves you a mountain to climb when you finally start testing and something needs reworking, which is horrifically unproductive and a frequent deadline killer.
Very great video, specially for extending Profiler.php
I still can’t download this video. Why?
Thank you Burak. Good tutorial!
In the next tutorial I would like to request a small piece of URI-thinking while using CI. Tips for mixing the URI and the regular querystring. With all segments and stuff. I think it´s annoying to feel dependent of knowing where a specific filter is positioned in the URL (segment position).
Profiling and benchmarks are hugely important. For anyone who is already building apps or has apps in the wild it is a great tool to help you find bottlenecks in your service.
And I don’t understand why all of you are asking for ORMs? Use active record in your models and stay away from the overhead.
can’t find the video download in the plus section
I am working in CI from last 2 years, I just wanna say that If a beginner read these tutorials once then he can get much knowledge about CI. Codeigniter tutorials on net-tuts focus on useful and effective functions on CI. Keep Rocking CI.
even your site too rocking. so many useful information zeeshan rasool. Net-tuts made me to focus on a a best PHP framework easy and lighter.
Thanks for net-tuts.
I second that, I’ve been working with (and on) CI for about the same time, and I have never looked back since, it’s simple, easily extensible and powerful, it’s like the jQuery of php ;P
attn: jeff way – what’s wrong with the download? even though i have logged in and tried to download the episode it ain’t working.
Thanks Burak! As usual very well done!
plz any link to download this tut
Great tutorial! Just can’t live without CI, I love that framework!
I should point out that there’s no need to literally copy and paste the CI_Profiler::run() function when overriding it if you are not changing the code of the function itself but just adding code after it, since CI_Profiler::run just returns the output. Here’s a simpler way:
class MY_Profiler extends CI_Profiler
{
public function run()
{
$output = parent::run();
// here you can save $output to file and whatnot
return “”;
}
}
About xdebug, I’ve been using that for several months now and it’s just great, it’s a tool a developer just cannot miss.
Excellent tip! Thanks.
Great Work! Thx =)
Great tut Burak. Your tuts keep getting better and better. This one is a very insightful post. Particularly from the the standpoint of proper use of hooks and extending the core through “MY_” variants. Both of which are easy solutions to allow you to change the basic functionality of the framework without hacking any core code whatsoever.
Again, good stuff!
Just wanted to say thanks. You’re doing a great job.
http://blip.tv/file/get/NETTUTS-CodeIgniterFromScratchProfilingBenchmarkingHooks108.flv
thanks for the help
Thanks a lot for this post…I’ve always been hesitant to start CI though have always thought of doing so. This share have made it so easy for me to do it now.
Thanks a lot for this amazing tutorials!!
I’ve been learning CodeIgniter and love it!!
A question: public access to the system folder from the browser doesn’t cause a little security risk? Aside from the fact that each file is protected from direct reading, I wonder if it would be better to deny any access to the system folder (with .htaccess for example).
Great article, i like your post, want to say thank u for your post
I want to download the screencast. But the download link is nog working. I have a premium account!
I’ve created new resources page on my blog, where I have included all the CodeIgniter links to videos and source code. So people can easier find it, instead of reading all the comments :-) I’ll be updated when new articles comes out. http://gravityfx.org/resources/ I hope you guys find it useful. Thanks to NetTuts+ of course for all they hard work. I don’t take any credit for the videos/links. I simply link to direct links for people who want to download the videos and watch on other devices instead of just streaming.
nice article!
I will be very useful
CI use in my projects.
Desenvolvedor web
Dear Jeffrey Way and Burak, is there any tutorial to integrated WYSIWYG TinyMCE with CodeIgniter??
Becoz I already following step by step from another tutorial but still I can’t see this Tiny MCE in my view.
Thx btw for your Awesome tutorial..
I’m not familiar with it, but I found this from a google search:
http://codeigniter.com/wiki/TinyMCE/
How to make localization using codeigniter
i would make website contain 2 languages :D
very nice tutorial Burak, keep writing :)
What about a implementation of a authentication for production use ? … im thinking about implementing ion_auth or even zend_auth into codeigniter
Day 15 zip file with all the files in this video would be helpful :)
In CodeIgniter 2.0.2, the logs file is now only in the application folder and I cannot access it by “http://localhost/ci_series/CI_15/logs/profiler.php”.
Also, all the methods in the Profiler.php file are now protected (except for the constructor and run methods), so how do you get the peak benchmarks?
Hi Burak,
I used the hook to check login session, and I got a Redirect error 310,
this is my code :
============== hook declaration ================
$hook['post_controller_constructor'] = array(
‘class’ => ‘MySession’,
‘function’ => ‘check’,
‘filename’ => ‘mysession.php’,
‘filepath’ => ‘hooks’
);
============================================
============= hook class =====================
class MySession {
function check(){
$CI=& get_instance();
$CI->load->helper(‘url’);
session_start();
(isset($_SESSION['isactive']))? redirect(‘welcome’): redirect(‘login’);
}
}
===========================================
Thanks :)
The video if Offline. :(