30

Imagine this clusterfuck:
A small company creates its own CMS on PHP 5.5 and MySQL, coded by fresh junior devs who apparently just got into coding.

My new employer sadly is one of their customers and now I got the task to migrate a group of tightly linked websites on subdomains to an actually sane and maintainable CMS...

Fuck me...

Apparently the continuous extension of the websites over the years got so labor intense, that the mentioned company lacks the manpower to fulfill further development wishes.

I've looked into the code today... let me tell you, PTSD is helluva thing.

- Each subdomain has a complete copy of the Crap Management System, there is no use of composer packages and each of the 50 folders in the webroot contains a mix of source code and images or other resources.
- LESS is transpiled into CSS by PHP on requests.
- There is no central file for environment variables like a ".env".
- Each website uses at least 5 different versions of jQuery, of which some jquery.min.js files were manually modified.

Don't get me started on how the DB is organized...

My work on this has just started, there will be more I've yet to uncover.

"C'mon, man! Gimme a break!"

Comments
  • 6
    Oh, I forgot to mention this gem:
    They created some PHP functions to multiply and divide DB table record IDs so they can group records by ID range!
  • 4
    Sound likes you’re gonna be paid for a lonnnngggg time
    I wish someone would hand me a hot mess like that right now and a reasonable dread line
  • 1
    @killames I can subcontract you 🤣
  • 0
    @PonySlaystation in all honesty I’d be fine with that if you can give me a small advance say first two weeks
  • 1
    @PonySlaystation and a couple days to sleep first
  • 0
    @PonySlaystation any chance maybe you weren’t joking and I could join you in php hell ?
  • 2
    @killames I was joking. I don't think my employer would be fine with a subcontract, but I'll keep you in mind.
    Migrations can be quite satisfying, if successful in the end. 😉
  • 1
    @PonySlaystation honestly I have a bit of experience modifying applications and databases in place

    I had a multi b company’s shit database to work on a short term contract so I made all my mistakes there and since have been very very careful lol
  • 1
    @PonySlaystation course they also converted the databases dal layer to ad hoc linq to sql queries ...,
  • 1
    So basically they made it worse
  • 2
    Crap Management System eh? How is this not the default meaning of CMS.

    Either way good luck with that.
  • 1
    Again apparently
  • 1
    poor employer :) programmer will earn money from fixing this mess. Employer will lose/already lost money by hiriding people who make such shit
  • 3
    I would just start a new Symfony/Laravel project, running on PHP 8 with a sane composer setup, using a fresh MySQL 8 or MariaDB or Postgres, and the latest frontend JS thing you are comfortable with.

    Why no CMS? A CMS is cute when there are very few demands for new functionality, when you literally want a static site or a blog. "Unable to fulfill development wishes" sounds like they just need a flexible website backend.

    Then just rebuild the websites, one by one, into the fresh new system. You rewrite all code from the ground up. You can copy assets in bulk, but not without vetting/cleaning/organizing them.

    For each site you're migrating, there will be a "content update freeze" to prevent maintaining 2 versions.

    Announce that you'll be working 75% of the time on mess cleaning, and 25% on website content updates, so they have to make choices on what's important.

    Use a prioritized task list, and make 2-week sprints for yourself, so you can guard the 75/25 ratio.
  • 1
    No need to salvage those codes. Just focus on the data and migrate it to a better CMS.
Add Comment