CakePHP 1.2 VS 1.3 VS 2.0 Page Request Times

When I first started using CakePHP a few years ago, we had a lot of complaints about speed.  If you do some Google searches comparing CakePHP to other frameworks, it seems to be near the bottom of the pack.  I previously wrote a few articles on optimizing CakePHP here:

Implementing the following tips certainly helped; however, if there are issues with the core framework response time, no amount of optimization will truley help.  So after reading up on CakePHP 2.0 and it’s recent speed improvements, I wanted to do some straight CakePHP comparisons.  Below are 10 load times for CakePHP 1.2, 1.3, and the new 2.0.  These load times are of a brand new install simply loading the default home view, no database connection or any model loading. Read more »

Share

AJAX Star Rating Plugin For CakePHP

First off, I didn’t write this plugin, I was browsing CakePHP’s plugin bakery and it came from there:
http://bakery.cakephp.org/articles/schneimi/2010/08/19/ajax-star-rating-plugin-1

This is an excellent plugin and very easy-to-use.  The above article is extremely detailed and provides excellent step-by-step instructions to set it up and get it running.

In reviewing the comments, like any self-made plugins there were a few issues encountered and ironed out along the way, so if you run into any issues be sure to search the comments.
Enjoy this excellent Star Rating Plugin for your next or current CakePHP site!

Share

CakePHP 2-0 Ajax Pagination WITHOUT The Pages

As I promised in this article, I have created a full CakePHP example of performing AJAX pagination without the pages.  The goal of this article is to display news articles to a user.  As the user scrolls down, we will dynamically load in additional content so they can continue to scroll and read.

One of our challenges is to not load too much or too little content.  For more details on this, please review the theory article.  Let’s begin. Read more »

Share

CakePHP CSS Enhancements From 1.2 To 1.3

This article does seem a bit late since CakePHP 2.0 is on it’s way.  However, I felt it prudent to point out a few things that I’m really happy to see in the new default CSS provided by CakePHP.

On CakePHP’s website, you will find an excellent migration guide from 1.2 to 1.3 here:
http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3

It describes in great detail the various changes throughout the entire application and there are a lot of them.  But I think it left out some of the most important stuff, the default CSS provided for people who use the bakery to create their websites!

One of the things that irked me in 1.2 was I had to manually update the paginator helper to display what field is currently being sorted on.  Many times I had to ensure my peers were also doing the same thing and a lot of time was wasted checking this and ensuring it was done correctly. Read more »

Share

Creating AJAX Pagination WITHOUT The Pages

You may have noticed some changes in the way a few websites work.  For example, if you go to Google Images and do a search, there is no pagination (1, 2, 3, Next, Previous) anymore.  Instead Google loads the images as you need them, e.g. when you scroll down.

Another example is Facebook’s newsfeed.  I read an excellent article a few months back on their developer blog about this design decision.  By default, Facebook will only load a “full screen” of information with minimal scrolling.  However, as soon as you start scrolling they begin to fetch and display more content.  In the article, Facebook described this decision as a bandwidth saver.  They found that a lot of people would navigate away from the newsfeed before ever scrolling down or only looking at the top content.  By only showing 10-15 posts, they can keep the size of their newsfeed down oppose to loading 30+ posts that are never going to be read!  File size can easily go down 100s of KBs per page view and when you’re talking about millions of page views per second, that’s a significant number. Read more »

Share

IBM’s Watson on Jeopardy, The Final Saga

In yesterday’s article I focused mainly on Watson.  So, in case you missed the episode last night, BIG SPOILER ALERT, Watson won.  Ken was actually pretty close after Double Jeopardy; in fact he was leading after the Jeopardy round.  If Ken would have bet bigger in Final Jeopardy it wouldn’t have been a gigantic blow out…

Now, in today’s article I wanted to focus specifically on how incredible Google’s search technology is.  Below are the 5 categories from the Jeopardy round and a sample of questions from each category.  Beneath the question is the answer and whether Watson was wrong.  Beneath the answer is the result of a Google search and how easily and where the answer could be found. Read more »

Share

IBM’s Watson On Jeopardy!

I’ve been a fan of Jeopardy! for quite some time now.  Even more so over the past year.  Now that I am the Father of twins, going out at night just isn’t as easy as it was!  When I first heard about Watson being on Jeopardy, probably about 3 or 4 months ago, I was extremely excited.  Actually watching it over the past two nights has been just as thrilling.

Learning about the technology behind it, being a geek and trying to think and understand some of the algorithms used, watching it think and tell you it’s best guess and a little bit about the process to find it has been nothing but entertaining. Read more »

Share

Building A Scalable Queueing System With PHP

In today’s article we are going to cover building a queueing system with PHP.  Before we begin, let’s define what a queueing system is.  The best place to start is the dictionary:

“to line up or wait in a queue”

Now that we have our definition, let’s define why we would want to build a queueing system.  A queueing system is an excellent tool that will allow us to take a specific process and perform the functionality “offline”, e.g. the process will line up and we will process them one at a time at a later date.  This will probably be easier to explain with an example.

Imagine an admin area of a website that allows the administrator to send out a mass email to all of their users.  The simple process to building this functionality would be as follows:

1. Build a form that accepts a subject and a body for the email.
2. Retrieve the list of users from your database.
3. Loop through the users and send each person an individual email.

The above example works nice and fast when there are only a few hundred users.  However, imagine trying to send this email to 10,000 users.  The administrator would be waiting a long time for this process to finish.  Not only that, if they closed the browser, it probably would not finish properly.

So, the goal of our queueing system is to remove a specific process from running “online” (in a web browser) and running it “offline” with a scheduled task. Read more »

Share

Publishing an e-book on Smashwords

I feel a little bit behind in the times on this one, but I’ll work to catch up quickly.  Over the past year or so I’ve been compiling samples and I put together a book for developing CakePHP websites.  I saught publishing on the book, but unfortunately all of the big name publishers felt that CakePHP is too small of a market.

After being rejected, I wasn’t too sure what to do with the book.  So, I left it for a while.  Then, earlier this week through some Google searching I stumbled upon the idea of an e-book.  Previously I’ve associated e-books with “Get rich quick schemes” as you see a lot of websites selling e-books along those lines.

I started investigating this option a bit more and I found some videos about creating e-books with Adobe Indesign and formatting them for the various readers.  This quickly started sounding like a lot of work!  Instead I searched for other solutions.  That’s when I found it: Smashwords.  This is an incredible service.  You upload your Word Document and they automatically convert it for the over 10 e-book options out there!  Not only that, they will sell it and promote it on your behalf. Read more »

Share

Interesting CakePHP Bakery Components

I enjoy researching what other people are doing in the CakePHP world and I came across several interesting components at CakePHP’s bakery website:

Wizard Component

http://bakery.cakephp.org/articles/jaredhoyt/2010/09/10/wizard-component-1-2-1

This component looks pretty neat and easy-to-use.  You import the component and set a list of steps that the wizard will traverse through.  You then create views for those steps with forms that submit to themselves.  The wizard will then process the form and proceed to the next step for you persisting the data along the way.

Breadcrumbs Component

http://bakery.cakephp.org/articles/rees/2010/08/14/breadcrumbs

This is a component and helper all-in-one.  Inside your controllers, you define the breadcrumbs in each function and you alter your app controller to automatically render the breadcrumbs on each page for you making it a pain-less process to add breadcrumbs to your site!

SMS Text Message Component

http://bakery.cakephp.org/articles/donald_jackson/2010/08/14/component-to-send-sms-text-messages

This is a component that is written specifically for Panaceamoblie that is a helpful service to allow your website to send SMS services.  It works very similar to the EmailComponent.

Share

Buy one of my books