PHP Classes

frdl Autoloader: Autoload classes with PSR-0, PSR-4, mapping, etc.

Recommend this page to a friend!
  Info   View files Example   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 68%Total: 215 This week: 1All time: 8,313 This week: 560Up
Version License PHP version Categories
source-loader 0.9.21BSD License5.3PHP 5, Language, Stream wrappers
Description 

Author

This class can autoload classes with PSR-0, PSR-4, mapping, etc.

It implements several types of autoload strategies that can be configured dynamically.

Currently it can autoload classes from given directories follow PSR-0 or PSR-4 specifications, or map specific classes to given files, call existing __autoload function, or load a class from remote server.

Innovation Award
PHP Programming Innovation award nominee
April 2015
Number 13
Autoloading is a PHP feature that allows to automatically load classes according to rules defined by autoloader code.

This package implements multiple common autoloading strategies like PSR-0, PSR-4, class mapping, etc..

Manuel Lemos
Picture of Till Wehowski
  Performance   Level  
Name: Till Wehowski <contact>
Classes: 30 packages by
Country: Germany Germany
Age: 45
All time rank: 107469 in Germany Germany
Week rank: 411 Up15 in Germany Germany Up
Innovation award
Innovation award
Nominee: 12x

Example

<?php
/**
 * SourceLoader example usage
 */

require 'SourceLoader.php';

frdl\webfan\Autoloading\SourceLoader::top()
   ->
addPsr4('frdl\\', DIRECTORY_SEPARATOR . 'pathToDir' . DIRECTORY_SEPARATOR, true)
   ->
addPsr0('aNamespace\\', DIRECTORY_SEPARATOR . 'pathToDir-Old' . DIRECTORY_SEPARATOR, false)
   ->
class_mapping_add('MyClass', DIRECTORY_SEPARATOR . 'pathToDir' . DIRECTORY_SEPARATOR .'cl.MyClass.php', $success)
   ->
autoload_register()
   ->
unregister(array(frdl\webfan\Autoloading\SourceLoader::top(),'autoloadClassFromServer'))
;


  Files folder image Files  
File Role Description
Accessible without login Plain text file Autoloader.php Example Example script
Accessible without login Plain text file example.php Example Example
Accessible without login Plain text file Loader.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file SourceLoader.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 80%
Total:215
This week:1
All time:8,313
This week:560Up
 User Ratings  
 
 All time
Utility:93%StarStarStarStarStar
Consistency:87%StarStarStarStarStar
Documentation:62%StarStarStarStar
Examples:68%StarStarStarStar
Tests:-
Videos:-
Overall:68%StarStarStarStar
Rank:378