zen of coding

CakePHP

Object mockery and Cake

A few times we already had gone over unit testing… and why it is a good thing to do. If you had been interested in this topic for a while, then I’m sure you’ve come across the concept of “Mock Objects”. But really, what are they? And more importantly how[…]

Read More »

Improved cache and sessions storage with CakePHP and Redis

CakePHP 2.3 + Redis 2.6.7 For the vast majority of applications out there the issue of cache and session store doesn’t really come into play until the application is large enough to where it needs to be scaled to multiple web servers. At that point filesystem (default cache and session[…]

Read More »

Million dollar site in CakePHP …

Is that possible? Yes, and it has been done. But… — CakePHP is slow. I’ve seen bench-marks on “Hello world” and cake falls behind other frameworks. — What’s your caching strategy? — [crickets] … Cache content CakePHP comes with a built-in view caching mechanism. Granted there is always a question[…]

Read More »

CakePHP + MongoDB, Next Steps

CakePHP 2.2 / MongoDB 2.0.4 Let’s continue building on top of what we’ve done previously. I’d say that the main consideration when it comes to building out your MongoDB is the choice between embedding everything into a single collection vs linking (or manual referencing) to another collection. What does it[…]

Read More »

CakePHP + MongoDB Introduction

CakePHP 2.2/MongoDB 2.0.4 We all know that CakePHP is awesome, and I’m sure you’ve heard that MongoDB is pretty awesome as well. So how do we make these awesome technologies play well together? In an awesomely easy way :) Let’s get things rolling by setting up MongoDB. (Instructions for Ubuntu)[…]

Read More »

Building “the blog tutorial”… the TDD way (part 2 – controller testing)

CakePHP 2.2 We have prepped our app with enough testing, to be ready to move on to write out the rest of the code… There was a good reason why we have started our TDD with the model layer. By encapsulating the business logic into our models we were able[…]

Read More »

Building “the blog tutorial”… the TDD way (part 1 – model testing)

CakePHP 2.2 Part 2 I personally consider Test Driven Development (TDD) as a “must do”, rather than a “nice to have”. Unfortunately as developers we often suffer from tight deadlines, tons of requirements and deliverables and sometimes a simple lack of understanding as to why TDD is so important. Granted,[…]

Read More »

User Auth with CakePHP 2.1 – part 3

As promised in the previous part we’ll take a look at the admin section. If you remember, we’ve setup our users so that when they create an account, they are inactive by default and cannot login into the app. app/Controller/AppController.php $this->Auth->authenticate = array(             ‘all'[…]

Read More »

User Auth with CakePHP 2.1 – part 2

CakePHP 2.1 Now that we’ve completed our basic setup for Auth, let’s take a look at the User.php model… class User extends AppModel {         public $validate = array(       ‘username’ => array(           array(            […]

Read More »

User Auth with CakePHP 2.1 – part 1

CakePHP 2.1 The example application in the CakePHP book does a very good job of covering setup and implementation of a basic Auth system. Let’s continue building on that and cover a few other things, by adding a couple of more features and looking at some of the other things[…]

Read More »
%d bloggers like this: