spencer-mortensen/autoloader

Autoload PHP classes

1.0.2 2018-05-26 05:38 UTC

This package is auto-updated.

Last update: 2024-12-23 18:42:26 UTC


README

This project is available as a Composer package:
spencer-mortensen/autoloader

Example

<?php

namespace SpencerMortensen\Autoloader;

$project = __DIR__;

$namespaces = array(
    'Example' => 'src',
    'Monolog' => 'vendor/monolog/monolog/src/Monolog',
    'Psr\\Log' => 'vendor/psr/log/Psr/Log'
);

require "{$project}/vendor/spencer-mortensen/autoloader/src/Autoloader.php";

new Autoloader($project, $namespaces);