This package is not installable via Composer 1.x, please make sure you upgrade to Composer 2+. Read more about our Composer 1.x deprecation policy.

A small and lightweight PSR-4 and PSR-0 compatible loader

0.1 2016-03-01 19:04 UTC

This package is auto-updated.

Last update: 2021-11-10 01:57:39 UTC


A Tale Framework Component

What is Tale Loader?

A PSR-4 and PSR-0 compatible loader without other dependencies


Install via Composer

composer require "talesoft/tale-loader:*"
composer install


Assuming the following structure:



use Tale\Loader;

$loader = new Loader(__DIR__.'/library');

and you're done.

To disable the loader you can unregister it (which it will do automatically upon destruction)


If you want to map a namespace on your directory, use the second argument

$loader = new Loader(__DIR__.'/vendor/my/app', 'My\\App\\');

If your files are named differently, use the third parameter

$loader = new Loader(__DIR__.'/lib', 'My\\', '%s.class.php');

That's all it can do any probably ever will. Maybe optional class maps will be implemented.