PHPackages                             czachor/psr4-autoloader - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. czachor/psr4-autoloader

AbandonedArchivedLibrary

czachor/psr4-autoloader
=======================

PSR-4 Autoloader based on https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader-examples.md

149↓100%PHP

Since Feb 22Pushed 9y ago1 watchersCompare

[ Source](https://github.com/czachor/Psr4Autoloader)[ Packagist](https://packagist.org/packages/czachor/psr4-autoloader)[ RSS](/packages/czachor-psr4-autoloader/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

PSR-4 autoloader implementation
===============================

[](#psr-4-autoloader-implementation)

Specification:

Based on:

Changes compared to original file:

- remove "Class" suffix
- small code changes and cleanup

An example of a general-purpose implementation that includes the optional functionality of allowing multiple base directories for a single namespace prefix.

Given a foo-bar package of classes in the file system at the following paths ...

```
/path/to/packages/foo-bar/
    src/
        Baz.php             # Foo\Bar\Baz
        Qux/
            Quux.php        # Foo\Bar\Qux\Quux
    tests/
        BazTest.php         # Foo\Bar\BazTest
        Qux/
            QuuxTest.php    # Foo\Bar\Qux\QuuxTest

```

... add the path to the class files for the \\Foo\\Bar\\ namespace prefix as follows:

```
