$loader = new \Composer\Autoload\ClassLoader(); $loader->addClassMap(array( 'MyClass' => __DIR__ . '/lib/my_class.php', )); $loader->register();Now when we try to instantiate the MyClass class, the autoloader will automatically load the appropriate file. This method can be especially useful for packages that do not follow the PSR-4 or PSR-0 naming conventions. It can also be used to provide an alternate location for a class without having to move the file. The package library for this method is the Composer package, which is a popular PHP dependency manager that allows developers to easily manage and install libraries required by their projects.