Monday, November 15, 2004
Reason #1.414213562 I hate PHP
Work was there. But then again, I was in my cubicle with that neat Zen-like emptiness to it.
Today's PHP problem I don't think was necessarily a PHP problem as it was a lack of documentation about installation. One of the clients uses OSCommerce, an open-source shopping cart management system and one of the modules “supposedly installed” was EasyPopulate, which allows one to populate the product database on the webserver from a spreadsheet. The customer used it once before, but that was then.
This is now.
Try as I might, I could not get the module to load. It was there, written in PHP, on the server, nestled among all the other PHP modules making up the shopping cart. Only it would not run.
Or rather, the shopping cart software would refuse to run it.
Or something like that.
It took me the better part of an hour (using Google) to find anything close to installation notes, for a slightly different version (“let me tell you about slightly different versions … ”) and it wasn't terribly surprising when those instructions didn't work.
Another hour or so was wasted trying to locate the module to download any version; old, new, borrowed, blue, anything.
I will say that the OSCommerce site looks good, but actually finding anything useful? Like … oh … the software? It's a sad state of affairs when one realizes that one downloaded what they were looking for by mistake (I was trying to download OSCommerce itself, thinking the module was one of those that used to be third party but had become part of the main distribution—I thought I downloaded OSCommerce but instead I had downloaded the latest version of the Easy Populate module). Yes, the site is that bad.
Now, the installation of the module. The module itself came with no installation guide, I guess on the assumption that you have the OSCommerce guide and that tells you how to install modules, cause the Good Lord knows that what I thought was the module installation module wasn't installing modules. I ended up having to go through the source code to the module, finding out why it was refusing to run and found the answer—because the module wasn't listed in one of the database tables that OSCommerce uses.
Some sixy SQL statments later (one to see what was in that particular table, one that I botched so badly that it basically wiped out that particular table, and fifty-eight to restore the table and add the new module) it was added and would now run.
Not correctly mind you, but it would run.
Some more hacking on the module (“no, the product database doesn't have those fields, so forget about them!”) and I think it works.
I hope.