constants vs. variables
May 21, 2007I just spend more than an hour tracking down why certain admin addons were not working in my photoblog anymore. Finally I found it: Pixelpost defines $dir = “../addons” and uses that to suck in the user defined functions from the addon PHP files.
However, this one file (ow dear, sounds exciting doesn’t it) included a function with a different declaration for $dir. So, after inclusion $dir changed and the suck-in script was left bewildered.
It started looking at the new folder and guess what? It couldn’t find any addons to include. Due to the missing addon functions, I was unable to upload a photo and got very frustrated about this last evening.
Today I methodologically tracked down the issue and resolved it for now.
And this, ladies and gents, should be a wise lesson why we should use constants instead of variables in PHP.















