browser icon
You are using an insecure version of your web browser. Please update your browser!
Using an outdated browser makes your computer unsafe. For a safer, faster, more enjoyable user experience, please update your browser today or try a newer browser.

php

Checking PHP code for compatibility issues

One project I occassionally hack on is Xerte Toolkits. Yesterday on the mailing list it came up that someone was trying to use XOT with PHP4. After getting over some initial shock that people still use PHP4 (it was end-of-lifed in August 2008) I wondered how easy it would be to check the status of … Continue reading »

Categories: development, php | Tags: , , | Leave a comment

Netbeans vs Vim … round 1 … fight

So, I think I’ve changed ‘editor’. Perhaps this is a bit like an engineer changing their calculator or something. For the last 10 years, I’ve effectively only used ‘vim‘ for development of any PHP code I work on. I felt I was best served using something like vim – where the interface was uncluttered, everything … Continue reading »

Categories: development, php | Tags: , , , , | 2 Comments

A week of fire fighting (aka why you should <3 unit tests).

I feel like I’ve spent most of this week debugging some PHP code, and writing unit tests for it. Thankfully I think this firefighting exercise is nearly over. Perhaps the alarm bells should have been going off a bit more in my head when it was implied that the code was being written in a … Continue reading »

Categories: php | Tags: , | Leave a comment

SQL Injection with added magic_quotes assistance (the joys of legacy code maintenance)

  Sometimes you really have to laugh (or shoot yourself) when you come across legacy code / the mess some other developer(s) left behind. (Names slightly changed to protect the innocent) class RocketShip { function rahrah() { $sql = “insert into foo (rah,rahrah,…) values ( ‘” . $this->escape_str($this->meh) . “‘, …… )”; mysqli_query($this->db_link, $sql) or … Continue reading »

Categories: development, php | Leave a comment

Zend_Cache – automatic cache cleaning can be bad, mmkay?

$customer uses Zend_Cache in their codebase – and I noticed that every so often a page request would take ~5 seeconds (for no apparent reason), while normally they take < 1 second … Some rummaging and profiling with xdebug showed that some requests looked like : Note how there are 25,000 or so calls for … Continue reading »

Categories: development, performance, php | Tags: , , , | 2 Comments

A caching PHP autoloader

This is probably of little use to normal people, or even many PHP programmers – unless you have more than a handful of directories to rummage through when __autoload()’ing PHP class files. I’ve sometimes found myself rummaging through 10-15, and this has a performance impact. Some random code which uses APC to cache a lookup … Continue reading »

Categories: development, performance, php | Tags: , , , , | 2 Comments

PHP Serialization & igbinary

Recently I’ve been trying to cache more and more stuff – mostly to speed things up. All was well, while I was storing relatively small numbers of data – because (as you’ll see below) my approach was a little flawed. Random background – I use Zend_Cache, in a sort of wrapped up local ‘Cache’ object, … Continue reading »

Categories: development, php | Tags: , , , | Leave a comment

Gregynog

Once a year, Aberystwyth’s Computer Science department take their second year students to Gregynog, for the purpose of preparing them for job interviews (mostly for the upcoming industrial year placements many students take between years 2 and 3). I’ve attended this for the last few years as an ‘Industrialist’ and help run mock interviews. Initially … Continue reading »

Categories: php | Tags: , , , | 5 Comments

Late to the performance party

Everyone else probably already knows this, but $project is/was doing two queries on the MySQL database every time the end user typed in something to search on to get the data between a set range (SELECT x,y….. LIMIT n, OFFSET m or whatever) and another to get the total count of records (SELECT count(field) ….). … Continue reading »

Categories: development, php | Tags: , , , | Leave a comment

Logging … and how not to do it.

Grumpy man, back from battling with some legacy code, has a rant. Continue reading »

Categories: development, php, python | Leave a comment