joi, 1 august 2019

Understanding and Debugging Composer loader

Composer is great, but when it comes to understanding or debugging it, things are not so clear.

Understanding Composer


First of all, you may noticed that there is a file vendor/autoload.php


// autoload.php generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInit::getLoader();


This is fine, right? Ok, but what is autoload_real.php? Short answer: it is nothing but the file with the definition of ComposerAutoloaderInit class. Great, until now ...