Rather than a Follow Friday I thought I would do a Nasty PHP Friday instead.

This is the median length of files in a legacy Yii1 project I am working on. One of over three hundred such files. That in itself wouldn't be a big problem if it weren't for the fact this was written in the time of PHP 5.1 with zero namespaces. The way Yii1 loads files (it does its own autoloading) means there are a number of classes with conflicting names all in the base namespace. Hurrah! :elephpant: πŸš€


This one is actually an outlier at nearly 7,000 LOC it's one of the biggest files in the project but could easily be split into 100 or so class's as it contains all the logic for report generation and is not very DRY.

:elephpant: πŸš€

The fun side of dealing with legacy PHP codebases is finding ini_set thrown around like a condiment.

This example is made more entertaining by the fact it now actually reduces the resource available as the server is set up to provide 3GB RAM and max execution of five minutes for report generation. :elephpant: πŸš€

Show thread
Sign in to participate in the conversation
PHP Community on Mastodon

Open source. Open community. We are dedicated to building and enriching the PHP community.