This post originated from an RSS feed registered with PHP Buzz
by Alan Knowles.
Original Post: Why are we code nazis? and some php shops
Feed Title: Smoking toooo much PHP
Feed URL: http://www.akbkhome.com/blog.php/RSS.xml
Feed Description: More than just a blog :)
There was an amusing comment on my PDO post today, exposing how they hate being told what is good and bad, by us code nazis.
In some ways I have to agree, I dont like being told what is good or bad.. - buy I do enjoy reading the pro's and con's (the Joel on software stuff about exceptions, and the responses on other blogs helped form a well rounded opinion on their potential use.) Although a few hard core exception projects will probably be able to clarify their best uses.
But this week has been the best illustration yet, about why I tend to rant on about good or better practices. I had a potential client requesting an online shop. Simple you may think. Just download one of those great free open source projects..
So I started with what looked like one of the more popular, OSCommerce (no I'm not going to link to it...!). To put it politely, "What a bunch of turd crap", I only got to the installation stage that came up with an error "please turn on register globals" to realize this was not even worth the time of day. - Hint one, dont code with register globals on!!!
Next up was Fishcart, another project I had played with many years ago. The trouble this one has is that the installation is so horrifically complex (they even have a crazy perl script to try and help you out) - How complex could setting up a shop be - create the database, change the db connections and make a folder to put uploaded files. Yet this one just refused to do anything resembling install.
Last up was phpShop, something I had noticed from my referer logs, as the developers had chosen to use quite a few PEAR packages (including my little DB_DataObject). The downloadable one is an old version, however the one in svn contains all the pear based code. It was also was pretty easy to set up and get working , after spending a bit of time messing around with configuration files.- making sure the path was correct (hint you can use php to determine that, you dont need a config var for it)
In general the code from phpshop was not too bad, however, I had a few requirements for my shop that would involve quite a bit of hackingĀ to phpshop's internals, so I had to dive into the code. Unfortunatly having chosen to use DataObjects, they did not appear to have used it properly! - the Dataobjects that had been created did not contain any code apart from the autogenerated stuff.. They appeared to have an extra layer of libraries doing all the things that should have been in the dataobjects.. They also had chosen not to use wysiwyg style templates, opting instead for a few PHP style ones, and alot of html embeded in the PHP classes.
So at the end of the day, the decission was to build my own (with a bit of help). The backend will beĀ XUL based, and front end will be heavily CSS and Flexy template based.. Licence and distribution unknown at this time.. - but it may be pretty restrictive!, so dont hold you breath for a free well coded, downloadable shop ;)