The Iterator - Iterator of thoughts

Old solution

I've been tasked with getting a very old web application into working condition as the OS underneath it have been upgraded. The app was written in PHP sometime between 2008 and 2011 and it is very ad-hoc ..

As we changed and upgraded the PHP version 5.3.x to 8.x (current) much of the code complained about broken statements and missing or too many parameters, I've been over the code base several times and mended problems, as requirements and code-style has been updated since 2011.

Today, I got access to the database .. I almost regret asking for access. It's really messy, very n00bish and just about zero relationships between tables, columns filled with values ..

The application is a kind of administrative interface for an internal DNS to handle provisioning of IoT-devices, where orders, devices, locations and DNS records are meshed together. Much of it is to drive the DNS configurations, so I spent some time looking at the configuration data, a colleague told me they have had problems with the DNS .. no wonder, there were duplicates and triplicate PTR records and other problems.

I wrote up a summary of my findings as the customer is interested in "upgrading" after I have fixed all the problems with the code, I wrote it up to inform my colleague and service manager what I found and overall view. This to trying to establish some sort of "difficulty level" or "complexity level", so they don't go to the customer and promise something that hasn't been thought through properly.

To upgrade this properly one would need to basically rewrite the whole shebang, define and declare objects and how they relate to other object, rewrite the code to support an Object-orieinted storage of objects in the database, change the whole database schema and then add code for an API, so the UI could GET/POST/PUT/PATCH and DELETE objects .. which would also allow other systems to communicate and interface with the application. This is what I need to convey to my service manager .. I find it interesting, I know how to build it, how to handle the data and build the UI .. but I'm not sure the customer would like the price tag of it.

OTOH: As the customer is in the public sector, similar systems aught to be available as open source, as to be cheap, robust and available as it would be tax money at work.

#work