Anatomy of a PHP App July 27, 2008

Some categories: geek. Some tags: , , , . And exactly 4 rambling responses.

PHP is one of the most popular website-powering server-side code languages. Why? Because all PHP apps are essentially the same as each other. A bold statement no doubt, but is it so hard to believe? All these apps/websites/scripts are based upon data. This data can be stored in a database (postgresql, mysql) or in files (flat-file systems), PHP files always fall into the following two categories: interpreter files and doer files.

Interpreter files: these interpret the data, they get the data, and then they display it. For example, a blog post, co-ordinates on a map, a forum topic and it’s replies. No matter how complicated the website, this is all they do. Sometimes they edit and mould the data (converting times, encryption, etc), but then they display it, which is the crucial point.

Get data >> play around with data >> display data

Doer files: these are sent requests from interpreter files (via a html form, header() GET content, or POST content through the use of fopen). They grab this data, which is either a) an update to the current data or b) an entirely new data-set. Either way, they then insert or update the relevant database/files to reflect this. Upon completion, they redirect the user back to the interpreter file, which shows the user that a change has occurred.

Get data >> insert/update a database or file system >> redirect to interpreter file

Thus, all PHP apps should follow this simple, repeating pattern:

Interpreter file, user clicks and or enters data >> data sent to doer file >> database/files updated >> back to the start

I have found that, in my latest PHP app (one that may or may not ever become public), this very simple analogy helps in my coding. Due to the extremely complex nature of the app I am attempting to create, splitting all files into “interpreters” and “doers” makes my life infinitely easier. I have two folders, one for each, and within those folders are my functions and doer files. Upon this basic structure, anything is, in theory, possible (within the general bounds of PHP itself).

I have yet to see an exception to this rule, the only “difference” would be when people combine the two files, especially in very basic apps such as a contact form or user login. Despite that, those files are split into the two “sections” of interpreter and doer.

Oh, I don’t post big posts often, so if you liked it and want more, diggles it!

The Web-Tablet July 23, 2008

Some categories: geek. Some tags: , . And exactly no rambling responses.

I must have one of these.

More on the patriotic thing July 21, 2008

Some categories: pointless. Some tags: , . And exactly 2 rambling responses.

I arrived in Northern Ireland a few hours ago, and what do I see on the houses as we drive to where we’re staying: the British flag. Hurrah! Why can’t the UK be like that!

Back in the UK July 15, 2008

Some categories: Uncategorized, hosting, ranting & raving, thoughts. Some tags: . And exactly 7 rambling responses.

And where’s the flag, where’s our proud, wonderful British flag? Where is the patriotism? I arrive at Gatwick airport, like all airports, it’s not a ‘nice’ place, but unlike the American airports, there’s no flag, there’s no patriotic symbols, there is absolutely nothing telling me I’m actually back in England.

Is Britain not proud of its own heritage? No. That sucks.

Upon completing Crysis July 14, 2008

Some categories: ranting & raving. Some tags: , . And exactly no rambling responses.

I’m dissapointed. After you kill the beast thing that sinks your ship, I thought I had completed Act 1 or similar, but no, the whole game? That and the fact that there is no real conclusion, the aliens still remain alive. Perfect sequel line-up ending which ruins the first game for me.

Resource Pile July 11, 2008

Some categories: news. Some tags: , , . And exactly no rambling responses.

Kerplunc has just launched a new website - Resource Pile, a blog dedicated to posting about all sorts of excellent resources including the classic icon sets, photoshop brushes, textures & etc. All wrapped in a design by me :): Check out Resource Pile!

Viacom should just piss off July 4, 2008

Some categories: Uncategorized. Some tags: . And exactly 2 rambling responses.

Leave Google/Youtube alone Viacom, you can’t defeat the pirates! Youtube removes the videos, the users simply re-upload, you cannot win. Even worse is the fact some moronic court judge decided to force Youtube to hand over all user data to Viacom, so Viacom can personally sue every.single.user who’s watched any of their thousands of copyrighted clips. This will mean uproar in the pirate community.

The fact of the matter is, people on Youtube aren’t really pirates, Bittorrent users are, Limewire users are. Is Viacom going to succeed against them? No. Will they succeed against Youtube users? No. The entire media community needs to stop fighting the masses and flow with them, explore the advantages of mass user viewing.

Viacom = fail.

From the Sunshine State July 1, 2008

Some categories: news. Some tags: . And exactly no rambling responses.

It’s all overcast. Here I am for two weeks by the beachside, boiling in the lovely warm (super-insanely-hot) sun and humid atmosphere. A time to forget the world at home and relax. And, of course, use the free wifi for coding and design development by the beach! </update>