An introduction to Doctrine

I recently applied for a new job as a web developer due to my 2012 plans involving moving to the city and working in a more corporate environment. After a technical interview over the phone mainly relating around PHP, MySQL and some general OO questions the interviewer finished by telling me more about the company. When he told me they specialise in Drupal development and use Doctrine for some in-house software and development I decided I better go do some research.

Cannot redeclare wpsc_register_post_types

I received the error "Cannot redeclare wpsc_register_post_types" while setting up a WordPress powered website to be used as a CMS. Everything was working locally but once I uploaded to the server I was continually getting the error around the wpsc_register_post_types function call. The first thing I tried was to deactivate the plugin which then caused an out of memory error when trying to allocate around 26mb of memory in wp-admin/menu.php.

List directory contents by modified date in php

At home we have quite a large collection of movies that have been collaborated over the years and are all stored on a central server. Every movie is stored in a unique folder along with some backdrop images and a xml file which stores information such as the movie title, description, production year and our own custom reviews. I wrote a C# application which allowed everybody to view all of this information easily and everything works well. But it didn't seem very helpful having a nice list of all the movies and their data unless you could view them in a newest to oldest order.

Autoloading Classes and Interfaces with Object Orientated PHP

If you have ever developed an object orientated application with php 4 then you will know what an annoyance it can be including all the different class files, well with php 5 the developers have introduced a new method called __autoload().

Note: There are two underscores before the word autoload.

The autoload function is called every time we try to access a class or interface which has not yet been defined. This may be clearer with an example.

Installing and Programming with PHP and Java

As a web developer PHP has always been top of my list when it comes to programming but just recently with my studies Java has been my main language and as I have come to love Java I looked into ways of using both PHP and Java together.

While searching the internet I found a few different solutions to this, you are able to recompile PHP with java support on both windows and Linux but the easiest solution I found for the windows operating system was Java Bridge, combined with WAMP (Windows Apache MySql and PHP) I was already to go in a matter of minutes.

Display Your Visitors Location using Google Maps

If you have ever seen a map on a web site showing your location then you know what we are trying to achieve here. One of the easiest ways to do this is to use a data file provided by maxmind to look up the users IP address or a domain name / IP address the visitor entered, I will first explain the steps we need to take and the tools we will need and then a walkthrough of how to put it all together.

What you will need.