PHP Classes
elePHPant
Icontem

Plug Loader: Autoload classes based on PSR-4 recommendation

Recommend this page to a friend!
  Info   View files Example   View files View files (19)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2016-02-23 (8 months ago) RSS 2.0 feedNot enough user ratingsTotal: 107 This week: 1All time: 8,430 This week: 1,047Up
Version License PHP version Categories
plug-loader 0.0.1MIT/X Consortium ...7.0Language, PHP 7
Description Author

This package can autoload classes based on PSR-4 recommendation.

There is an autoloader class that can load classes based on path of a specific directory that is associated to a given namespace.

It registers a given namespace and associate it to a given auto-loading directory. The class also registers sub-directories and associate them to sub-namespaces.

Innovation Award
PHP Programming Innovation award nominee
February 2016
Number 12
PSR-4 is a recommendation by the FIG (Framework Interoperability Group) that defines how package classes should be automatically loaded according to given namespaces that are associated to certain directories.

This class extends the recommendations of PSR-4 by defining a class autoloader that not only associates a given directory to a certain namespace, but also associates sub-directories to sub-namespaces.

Manuel Lemos
Picture of Samuel Adeshina
  Performance   Level  
Name: Samuel Adeshina <contact>
Classes: 19 packages by
Country: Nigeria Nigeria
Innovation award
Innovation award
Nominee: 7x

Winner: 1x

Details

Plug-Loader Join the chat at https://gitter.im/Samshal/Plug-Loader

About

A PSR4 Implementation of an autoloader for the ~Plug Microframework.

How-TO

> The configuration file for this autoloader can be __supplied in two different formats__: > It can be provided as a json file or as an xml file.

The Autoloader first checks for a json file before xml since thats the default config format. You must create an xml autoload configuration file in the document root in order to use xml for the config format. You can rename the autoload.xml.template file to autoload.xml after the autoload.json file has been deleted or renamed to test this.

  Files folder image Files  
File Role Description
Files folder imageexample (4 files, 1 directory)
Files folder imagetests (1 file)
Files folder imagevendor (3 files)
Accessible without login Plain text file .travis.yml Data Travis configuration file
Accessible without login Plain text file autoload.json Data Doc
Accessible without login Plain text file autoload.xml.template Data Auxiliary data
Accessible without login Plain text file php-classes-not-importing.txt Doc. Read Me
Accessible without login Plain text file readme.md Data Doc

  Files folder image Files  /  example  
File Role Description
Files folder imagesrc (3 directories)
  Accessible without login Plain text file autoload.json Data Example Autoload.json
  Accessible without login Plain text file autoload.json Data Example Autoload.json
  Accessible without login Plain text file index.php Example Example
  Accessible without login Plain text file index.php Example Example

  Files folder image Files  /  example  /  src  
File Role Description
Files folder imagebar (2 files)
Files folder imagefaz (2 files)
Files folder imagefoo (2 files)

  Files folder image Files  /  example  /  src  /  bar  
File Role Description
  Accessible without login Plain text file Bar.php Example Example
  Accessible without login Plain text file Bar.php Example Example

  Files folder image Files  /  example  /  src  /  faz  
File Role Description
  Accessible without login Plain text file Faz.php Example Example
  Accessible without login Plain text file Faz.php Example Example

  Files folder image Files  /  example  /  src  /  foo  
File Role Description
  Accessible without login Plain text file Foo.php Example Example
  Accessible without login Plain text file Foo.php Example Example

  Files folder image Files  /  tests  
File Role Description
  Accessible without login Plain text file autoloader_test.php Test PHPUnit Test

  Files folder image Files  /  vendor  
File Role Description
  Accessible without login Plain text file autoload.php Example Example script
  Plain text file autoloader.php Class Class source
  Plain text file autoloader_register.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 68%
Total:107
This week:1
All time:8,430
This week:1,047Up