windwalker/loader

Windwalker Loader package

Installs: 71

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 4

Forks: 0

Open Issues: 1

Type:windwalker-package

3.5.23 2019-10-26 15:42 UTC

README

Windwalker Loader is a simple, easy using class loader, support PSR-0, PSR-4 and class mapping autoload.

Installation via Composer

Add this to the require block in your composer.json.

{
    "require": {
        "windwalker/loader": "~3.0"
    }
}

Usage

use Windwalker\Loader\ClassLoader;

$loader = new ClassLoader;

// Register autoload first
$loader->register();

$loader->addPsr0('Windwalker', __DIR__ . '/../src');

$loader->addPsr4('Windwalker\\Core\\', __DIR__ . '/core/src');

$loader->addMap('Windwalker\\Cache\\Cache', __DIR__ . '/../src/Cache/Cache.php');

// Just use your class, it will autoload
$cache = new \Windwalker\Cache\Cache;

Autoload Standard