Snapshots of a PHP enterprise developer ’s life ( How I needed CCTV… )
July 11, 2007 at 4:42 pm | In Application Architecture, Code, Design, Design and Implementation, Software, codebloke, framework, http debugger, ide, komodo, lamp, mysql, php, php5, user experience, zend | 1 CommentThis article is actually meant to be praise for Komodo 4.1 IDE (a reasonably priced PHP IDE with HTTP debugging features), but when I started to write the post I realised that the whole story must be told from different angle. Not that the Komodo is not worth praising, it is and that’s for sure. However, since the story evolved I’ve taken decision to post a link to community version (Komodo Edit) and make a point regarding much more complicated matter. And so it happens a bit more important if you pay your bills implementing business logic with the PHP5 and LAMP like I do.
Story in brief is about knowing and not guessing, but let me start with some memories of the past.
History
While working for a UK email marketing company some time ago (I am still thinking if I should mention them in this article…) I was developing a couple of new features. Long ago this company decided to use very complicated application stack. It’s enough to say that Postgres, PHP4 and XSLT were running under one roof (sometimes) delivering… transitional HTML.
So, every time a helpdesk ticket was initiated by the fault report I heard the same mantra being sung to clients “we cannot replicate the error”.
From the very beginning I felt it wasn’t right to do bullshit talking to the clients that pay your bills. I knew how to make web-based system fully monitored. Problem was that with this company (for the first time in my life) I plunged a bit with my own projects, system was undocumented and the other senior developer acted simply like a jerk. As you see it’s wasn’t the perfect positions to address my bright vision of a fully self-aware web-based application server. Especially that this “dotcom” company, located in the countryside had a huge problem with equipping developers with a new dev server, we also suffered electricity shortages from time to time and the internet uplink was down pretty often… However I liked the rural setup (see video below).
So, I started to develop that solution on my own and ended up with a very efficient piece of code that I called CCTV, which allows:
- Remote side profiling
- Login / logoff based on database-stored sessions
- Real-time application input and output logging
- Detecting users opening application with multiple browser windows
System creates “remote side” profiles based on ip/proxy/network block/country/browser and you can compare these profiles with all logged HTTP requests, i.e. searching for fraudsters (without laborious strings digging).
I don’t need to explain that unlike file-based PHP sessions this system can be distributed across database cluster without even breaking the sessions. Also, you can use multiple web and database servers. In terms of uptime, mixed with stuff like i.e. round robin (internet) or hiding web server behind a load balancer (in LAN) it makes your application virtually invincible (with “virtually” stressed). Another benefit here is that you can centralize session’s management and logoff one or all users even though the session (or cookie) has not expired yet.
Real time output logging makes sense only in the development phase (UX – User Experience, cross-browser functionality checks, etc.). One of the features I like is that when you forced user’s logoff having output logging turned on, you can rebuild his “last seen” application state when he logs back.
I don’t need to explain significance of that… it simply undermines the dogma of HTTP being a stateless protocol. Not anymore…
So, I started to think of all this looking at Komodo which has HTTP debugger built-in and having that tool I probably would never start my CCTV project…
Today
I am now senior developer at World First in London a foreign exchange company with yearly turnover of approx. 3 billion GBP (roughly $6,000,000,000.00).
Part of my job is development of the dealing application in the Intranet that runs on LAMP and CCTV is a part of it. Just looked at the stats… so, running PHP5 and MySQL 5.20 we serve over 180,000 HTTP requests daily (which means apporx. 80,000 database transactions a day) and I can restore every second of the system’s life, as easy as if I had a rewind button.
Future?
When you deliver a platform (and PHP5 surely is a platform), you must deliver a coherent application framework. Not for internet, blogging, CMS, etc., but for the enterprise. Otherwise you force the developers like me to do your job.
Now, assuming that MySQL 5.2 is now really a database… then maybe it’s a good time to stop playing funny guys and together with MySQL AB you deliver a unified application platform with all features mentioned above with the C-implemented sessions functionality?
I wonder if guys at Zend realize already that even support of IBM’s DB2, or projects like OPAL (trick with Oracle’s support for PHP), these are simply jokes when the only thing decent with PHP is so far the language syntax – inherited anyway.
Don’t get me wrong. I am a big PHP fan and I wait for a situation update… but seems to me like they decide to make money on events and that type of crap, rather than software.
Martin
World First UK Ltd. – Currency converter ( web-based & live! )
May 8, 2007 at 4:52 pm | In AJAX / XMLHttpRequest, Code, iframe, webdesign | Leave a CommentWorld First, foreign exchange and currency transfer company in London provides webmasters with extremely useful tool.
World First handy currency converter is a service that you can easily integrate with your website or even eBay auction.
In order to get access to the dedicated converter cut/paste code you need to contact World First. It’s calling the converter as HTML iframe so no coding skills required.
Live converter and all-two-lines-code sample here: www.codebloke.co.uk/FxConverter
http://codebloke.wordpress.com strikes back – User interface for WEB (2.0:-)
November 18, 2006 at 11:52 pm | In AJAX / XMLHttpRequest, Code, Philosophy behind solutions, Web 2.0, Wordpress.com, development | Leave a CommentHowdy,
please take a look on my newest article on user interface and accessibility issues for web, Web 2.0 as well
http://codebloke.wordpress.com/user-interface-in-web-applications-abstract/
Web 2.0 is …
November 16, 2006 at 2:08 pm | In AJAX / XMLHttpRequest, Code, Web 2.0, development | Leave a CommentGrowing number of “community” companies around, constant media pressure and self-proclaimed industry leaders waiting to be recognized.
Hard to distinct buzz from a real value that the Web 2.0 brings.
So, what actually is the Web 2.0?
Actually, my perspective on that is simple
It’s just a different way to describe what we’ve got on the table for years, but it’s a good way and for me, worth to follow…

Five down-to-earth reasons to consider Web 2.0 a real breakthrough:
- For the first time as a mass and common approach to development we have strictly defined interfaces (API’s) accessible via network,
- Not only the interfaces, but also responsibility is strictly defined,
- …and really documented, from the Day One online.
- It practically introduces SOA (services oriented architecture)
- Ends all discussions on “which programming language is the best for Web”*
*) answer: one you can create an efficient API with…
However, talking is a cheap sport and would be nice to demonstrate what I mean.Maybe with some working piece of code…
Let’s say we need to:
- Verify delivery address and post code entered by users at the checkout in our web-based B2B ordering system (to avoid possible shipping problems like i.e. delays, returns, etc.).
- Initial purpose is verify the data as they’re only entered on the website, but…
- We need to create a reusable solution, so that it can be used from different platforms (i.e. just in case we would like to extend that functionality on verifying delivery data for orders collected by phone).
- Almost forgot… we’ve got a budget of approx. £200 for that project because this equals a monthly operational cost for re-processing the shipments. Re-delivery cost is usually invoiced on customers as it’s their fault*. They gave us incorrect address, right?
*) Fact: Customers don’t like to pay twice, even if it’s their fault… Plus, your customer care department will spend some extra time on calming them down, but it’s hard to indicate that as direct result of not sanitizing data input, so thing can be successfully masked
![]()
Post codes in the United Kingdom it’s not really a complicated issue.
For £750 you can buy CD with raw data from Royal Mail and keep it local.
Royal Mail provides also a ‘Find a postcode‘ service – available here:
http://www.royalmail.com/portal/rm/postcodefinder
Search options there are limited to 12 addresses a day… so not really something we were looking for. Plus, we wanted a unified interface. Hmm…
![]()
I believe that every 9 y.o. computer geek (even without the MCP) knows how to manually verify address (post code…) with a browser and a search engine.
Our implementation will do exactly the same:
- We collect unstructured data set from public websites, here google.com, yahoo.co.uk, viamichelin.com and yell.com
- We compare the results
- We format results in industry standard XML document

So, we’ve got a web server (1) that is processing requests from users (2) or servers (3). This machine communicates with other web servers (A) fetching for public content and connects my MySQL-to-XML database (B) that contains phone prefixes.
As long as we can provide a correct UK post code we should get a correct set of detailed information formatted as XML.

![]()
The result XML above was generated trough a URI:
http://www.codebloke.co.uk/XML/?asXML=MK42+7BU&go=check
Now you can test your sample UK post code over simple web form published here: http://www.codebloke.co.uk/XML/form/
-
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.