So, a very long time ago, I had to write a very small cart app as an adjunct/add-on to a customer’s full store. The idea was, they’re going to sell a very select subset of products and they don’t want to do a huge install and pay for lots of new hardware and software. Make it run – and well – on the couple of spare boxes.
I did it in Rails but the performance was awful. So, as a side-project while I was working on optimizations, I re-built it from off-the-shelf PHP parts, and it was blazing fast. I used the bare minimum of parts – a simple router, a simple ORM, and my own dispatch/controller (that was conceptually stolen from Rails).
Like I said, it was a bare minimum app. It didn’t do a TON of things. As customers are want to do, they came back and asked, “Where are all the other things? The things it needs to do?”
“It doesn’t do those things”, I replied. “It says right here in the contract, ‘we aren’t going to do those things’, those things are to come later.”
Well, they were going to think about it, since we were going to charge money for those things. I started a little “plugin” thing to bide my time while they thought about it.
They thought about it and decided they didn’t want to pay for those things. Project cancelled.
Time passed and I had reason to pull out the codebase again. “Hey”, I said, “let’s implement some of those things to make it more attractive”. Before I could get an answer, this project was cancelled.
More time passed, and I began a huge “refactoring” of our existing product. It started off by folding in some bits from the tiny app, but eventually it became clear it needed to use a real, unified “stack” since getting all these disparate pieces together was actually more fragile than the ball-of-mud approach. So I abandoned it, yet again, and used the functionality provided by the framework we chose.
I was looking for some other file when I came across it in a directory called “misc” in a directory called “prototypes and saved things” in my project folder. So I put it up on Github.
It’s incredibly boring: it’s just a little PHP thing to let you hook into a “controller” (say, an MVC type thing) and call a set of defined thingees in an order you want. It’s a really, really dumb pre-and-post-dispatch type deal.
The story is far more interesting than the code.