Archive for September, 2011

Dynamic Eclipse PDT (PHP) templates for the singleton pattern

Sunday, September 25th, 2011

I’m currently working with a legacy PHP CMS and do-it-all system which is heavily reliant on singletons. Instead of relying on static methods and direct invocation we store object instances in a global array, these instances are then retrieved through the use of a call looking like this: singleton(‘ClassName’).... Read More

How to parse and tokenize a complete PHP project

Sunday, September 25th, 2011

Yesterday I had to loop through every directory in a whole PHP project and go through all the PHP files in order to get at their contents, the goal was to get information from each file in order to create an array looking like this for each class method:... Read More

MySQL replication in PHP – on the same machine

Wednesday, September 14th, 2011

I just realized I needed to replicate some data from one database to another, but only certain tables.... Read More

MySQL / InnoDB performance optimization

Wednesday, September 14th, 2011

Update: Do not forget to erase the two ib_log* files in /var/lib/mysql before restarting with the new configuration!... Read More

PicoLisp and Linux/GNU system commands

Friday, September 2nd, 2011

Most of the most commonly used and useful Linux commands needs a file as input, in the shell this can be circumvented by for instance a line like this: echo “hej” | md5sum.... Read More