phpcraftdream/psr4utoload

dev-master 2021-03-03 10:52 UTC

This package is auto-updated.

Last update: 2022-11-29 02:05:46 UTC


README

\PHPCraftdream\PSR4Autoload\PSR4Autoload - PSR4 autoload class

Installation

Run

composer require phpcraftdream/psr4utoload

Usage

    require_once './vendor/autoload.php';

    $psr4utoload = new \PHPCraftdream\PSR4Autoload\PSR4Autoload();

    $psr4utoload->register();

    $psr4utoload->setPaths(
        [
            'NameSpace1' => '/dir1/',
            'NameSpace2' => '/dir2/',
            'NameSpace3' => '/dir3/',
        ]
    );

    $obj = new \NameSpace1\className();