I fought this one for a while today. There’s lots of documentation out there for using Composer with private repos and I got everything to work except getting the autoloader wired up. What finally worked for me was setting “no-api”: true in the repositories key. { “repositories”: [ { “type”:…
Category: Composer
Composer
Read more
Optimize composer’s autoloader
Most people write really simple autoloaders for their PHP projects that look at a class or namespace prefix, perform a file_exists and finally require_once the file. Something like: //Register an autoloader for our plugin’s actual code spl_autoload_register( function ( $class ) { //PSR-4 compliant autoloader //See http://www.php-fig.org/psr/psr-4/ $prefixes = array(…