A temporary fix to the Composer 5.2 autoload generator

Edit and apologies

The “fix” I had concocted for the PHP 5.2 auto load generator was not working and not needed.
I’m leaving the original post here as a gentle reminder to myself that the “measure twice, cut once” saying does apply to development as well.
The xrstf/composer-php52 works as intended with latest Composer version and my modification was fixing something that has never been broken to begin with.

Follow the instructions on the package site to have the magic happen and stop reading here.

Composer

I use Composer on a daily basis and in PHP 5.2 projects as well when developing for back-compatible WordPress plugins.
Part of the chores that PHP 5.2 imposes is greatly reduced by the use of the xrstf/composer-php52 library that takes care of creating a PHP 5.2 compatible autoload file that can be included in the main plugin file.
Recent updates to Composer seem to have broken the solution, at least for a while, and while I’ve opened a PR (here) to fix I need the library so badly I’ve gone and created a mirror of it on GitHub.
Straight from the README file the simple and slightly different instructions.
In your project’s composer.json file add the following lines:

{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/lucatume/composer-php52.git"
}
]
"require": {
"xrstf/composer-php52": "1.0.20"
},
"scripts": {
"post-install-cmd": [
"xrstf\\Composer52\\Generator::onPostInstallCmd"
],
"post-update-cmd": [
"xrstf\\Composer52\\Generator::onPostInstallCmd"
],
}