2017 © Pedro PelĂĄez
 

library requisite

A modular, extensible PHP autoloader.

image

dnaber/requisite

A modular, extensible PHP autoloader.

  • Friday, March 25, 2016
  • by dnaber-de
  • Repository
  • 3 Watchers
  • 3 Stars
  • 1,144 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 2 Open issues
  • 4 Versions
  • 9 % Grown

The README.md

Requisite – a modular, extensible PHP autoloader

Inspired by Tom Buttler and Fuxia Scholz., (*1)

This library requires PHP version 5.5.0. If you're looking for older support, use the 1.0 release branch, that still supports PHP 5.3.0., (*2)

Concept

The main idea behind this autoloader is the separation of the file locating (Requisite\Rule) and file loading (Requisite\Loader) process., (*3)

One can register several rules on a main autoloader instance of Requisite\SplAutoloader. The included rule Rule\NamespaceDiretoryMapper matches namespaces to directory names (which actually implements Psr-4)., (*4)

Rules

Psr4

Maps namespaces to filesystem directories relative to a base directory and base namespace as described in Psr-4., (*5)

ClassMap

Provides a static map of full qualified class names to file names., (*6)

Usage examples


/** * Load the Requisite library. Alternatively you can use composer's * autoloader via include vendor/autoload.php */ require_once 'src/Requisite/Requisite.php'; Requisite\Requisite::init(); $autoloader = new Requisite\SplAutoLoader; //load the Monolog lib from the vendor/Monolog directory $autoloader->addRule( new Requisite\Rule\Psr4( __DIR__ . '/vendor/Monolog', // base directory 'Monolog' // base namespace ) ); // configure a ClassMap $autoloader->addRule( new Requisite\Rule\ClassMap( [ 'Foo\Bar' => '/vendor/package/src/Foo/Bar.php', 'Foo\Bazz' => '/vendor/package/src/Foo/Bazz.php' ] ) );

Roadmap

See issues labeled with »enhancement«, (*7)

The Versions

25/03 2016

dev-master

9999999-dev https://github.com/dnaber-de/Requisite

A modular, extensible PHP autoloader.

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

autoload psr-4 spl

24/03 2016

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/dnaber-de/Requisite

A modular, extensible PHP autoloader.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

autoload psr-4 spl

24/03 2016

1.0.0

1.0.0.0 https://github.com/dnaber-de/Requisite

A modular, extensible PHP autoloader.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

autoload psr-4 spl

21/04 2015

0.9.0

0.9.0.0 https://github.com/dnaber-de/Requisite

A modular and extendable SPL Autoloader.

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

autoload spl