Getting started with Memcached

One of the most important aspects of building scalable websites is how you manage the caching of data. The problem with learning about cache is, it only really comes up when you fighting to keep your site online, which by that point, it’s too late. Implementing a cache should really be one of the fundamental [...]

Continue reading...

Getting started with Compass

A couple of weeks ago I wrote a post on getting started with Sass. Sass is an extension of CSS3 that adds the ability to use preprocessor type variables, mixins and includes. This enables you to write cleaner and better CSS and allows you to minify it for use in production. Compass is a “CSS [...]

Continue reading...

What is Object-Relational Mapping?

You might have come across the term Object-Relational Mapping (ORM) if you have ever worked with a framework or on a codebase of a large project. ORM is simply a way to convert data into Objects for use in Object-Orientated Programming. I can appreciate that the last sentence probably made no sense, so I’ll try [...]

Continue reading...

How to save PHP Sessions to a database

Sessions are a critical component of creating dynamic websites or web applications. If you are building these types of website, you will most certainly be required to handle Sessions at some point. In this post I will be looking at PHP Sessions, why you need them, how you should store them and I’ll give you [...]

Continue reading...

Why do you need to Salt and Hash passwords?

Storing user passwords is a critical component for any web application. When you store a user’s password, you must ensure that you have it secured in such a way that if your data is compromised, you don’t expose your user’s password. There have been many high profile cases of websites and web applications that have [...]

Continue reading...

Getting started with Sass

Sass (Syntactically Awesome Stylesheets) is a preprocessor extension language for CSS that makes it possible to use the power of preprocessing in your stylesheets. This means you can use all kinds of new and interesting techniques when writing CSS that will improve your workflow, reduce the amount of code you have to write and ensure [...]

Continue reading...

What is PHP Composer?

If you have ever written anything in PHP before, you have probably found that it feels like you have to keep re-inventing the wheel anytime you want to do a common task such as User Authentication, Database Management or Request Routing. PHP now has a handful of mature frameworks that have already solved all of [...]

Continue reading...

What is Namespacing?

When you progress from creating simple websites and web applications, to more complex and bigger projects, you will probably come across the term Namespacing. Namespacing is an important concept in computer programming as it enables you to create modular and extensive applications. Namespacing is a language agnostic term that forms one of the inherent features [...]

Continue reading...

Create a PHP Money Class

Handling money values within an application is something that you do not want to go wrong. If it’s an ecommerce application, displaying or charging the wrong amount to a customer is a big mistake. Calculating the various amounts of a transaction can also be time consuming if you don’t already have a pre-written solution. Whilst [...]

Continue reading...

Supported by