Helping you solve those tough coding problems!
Learn some great web development and web design tips and techniques through recipes that clearly define the problem being solved with a working solution.
Popular Tags: cakephp | theory | optimization | javascript-development | asp-net | css | jquery-development | sql | ajax | c

Search:
Follow @endyourif rss Facebook LinkedIn

CakePHP 2.x Login System CakePHP 2.x Login System

Published on Sep 18, 2012 by Jamie Munro

Well, since one of my most popular all-time blog posts is Login system with CakePHP in under 10 minutes I think it's time that I update it to version 2.x (currently 2.2 at the time of writing).  The original post was probably written for version 1.2 or 1.1 and there have been several changes made, especially with breaking changes to the AuthenicateComponent.

The beautiful part is the changes are extremely limited.  In fact, only the UsersController requires a few minor changes.

Read more >

Tags: CakePHP | AuthComponent | CakePHP Component | cakephp 2.0 | PHP | CakePHP

CakePHP Version Comparison with PHP Version Comparison CakePHP Version Comparison with PHP Version Comparison

Published on Jun 25, 2012 by Jamie Munro

I've seen a few recent blog articles comparing the new version of PHP 5.4 to its predecessors and I thought I should get involved with this a bit as well.

To perform this test, I will layout the conditions I have chosen.  I'm trying to keep this as simple as possible.  I currently run a Dell Laptop with Windows 7 on it:

Windows NT 6.1 build 7601 (Unknown Windows version Business Edition Service Pack 1) i586

Because I often do a lot of .NET development recently I have PHP running as a CGI under IIS 7.5.

I then created a very simple .NET application that performs 100 requests of the same web page and tracks the response time.  These lists of response times are sorted and the highest and lowest responses are dropped.  The average is then calculated from this.

Read more >

Tags: CakePHP | Optimization | performance | php | cakephp 2.0 | PHP | CakePHP

CakePHP 2.0 Rant Retraction CakePHP 2.0 Rant Retraction

Published on Feb 1, 2011 by Jamie Munro

In yesterday's article, it appears I may have misunderstood something regarding lazy loading.  I incorrectly read it as "loading the data" on-demand oppose to loading the object on-demand.  This actually looks like a great feature, especially after reading this: http://bakery.cakephp.org/articles/Frank/2010/08/10/optimizing-model-loading-with-lazymodel

It appears associated models would automatically be loaded simply because they are related to the model you are querying, even if you are not retrieving data from it.

Thanks for the clarification on lazy loading Jose and I'm actually quite excited to see this change after further research into the situation.  Check out these benchmarks from the above mentioned article:

Before lazy loading


Total Requests made: 100
Total Time elapsed: 6.8480186462402 (seconds)
Requests/Second: 14.603 req/sec
Average request time: 0.068 seconds
Standard deviation of average request time: 0.002
Longest/shortest request: 0.078 sec/0.066 sec
Memory usage: 9.75MB

Post lazy loading


Total Requests made: 100
Total Time elapsed: 4.8957378864288 (seconds)
Requests/Second: 20.426 req/sec
Average request time: 0.049 seconds
Standard deviation of average request time: 0.001
Longest/shortest request: 0.056 sec/0.048 sec
Memory usage: 7.25MB

Almost 6 full requests more per second!  Just in the 100 requests made there is over 2 seconds being gained!  Excellent work community!

Read more >

Tags: CakePHP | cakephp 2.0 | lazy loading

CakePHP 2.0 Rant CakePHP 2.0 Rant

Published on Jan 31, 2011 by Jamie Munro

I was recently visiting the CakePHP bakery and decided to read a little bit about CakePHP 2.0-dev.  I've rather enjoyed CakePHP as a framework since version 1.1 all the way through to version 1.3.  However, after reading some of the "features" for version 2, I have to say, I'm a little disappointed about their focus.

Read more >

Tags: CakePHP | cakephp 2.0 | lazy loading