PHP Classes

Flexible AutoLoader: Autoloader that supports PSR-0 and other methods

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 212 All time: 8,347 This week: 49Up
Version License PHP version Categories
falcraftloader 1.0MIT/X Consortium ...5.3PHP 5, Language
Description 

Author

This package is implements an autoloader that supports PSR-0 and other methods.

It registers an autoloader that can load classes associating module names or namespaces with specific directory paths.

The autoloader supports multiple directories per module, as well customizable class file name suffixes and prefixes.

Picture of Asher Wolfstein
  Performance   Level  
Innovation award
Innovation award
Nominee: 5x

 

Example

<?php

require_once('../../Loader/AutoLoader.php');
require_once(
'../../Resource/FileUtility.php');

use
Falcraft\Loader;
use
Falcraft\Resource;

echo
"Falcraft\\Data\\Loader\\AutoLoader.php Test\n";
echo
"------------------------------------------\n\n";

$autoLoader = new Loader\AutoLoader(array(), array('AutoRegister' => true));

use
Falcraft\tests\Loader\TestLoads;

$testObject = new TestLoads\TestClass();

var_dump($testObject);

echo
"\n";

$path = realpath(Resource\FileUtility::normalizePath('../../../AutoLoaderTest/'));

$autoLoader->addPath($path, 'AutoLoaderTest');

use
AutoLoaderTest\FirstNamespace;

$testObject2 = new FirstNamespace\TestClass();

var_dump($testObject2);

echo
"\n";

$autoLoader->removePath($path);

$autoLoader->addLibraryModule('AutoLoader', $path, null);

use
AutoLoaderTest\SecondNamespace;

$testObject3 = new SecondNamespace\TestClass();

var_dump($testObject3);

echo
"\n";



  Files folder image Files (17)  
File Role Description
Files folder imageAutoLoaderTest (2 directories)
Files folder imageFalcraft (4 directories)

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
Downloadfalcraftloader-2015-10-21.zip 30KB
Downloadfalcraftloader-2015-10-21.tar.gz 21KB
Install with ComposerInstall with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
PHP Configuration Trait Download .zip .tar.gz Abstract Loader Uses For Configuration Required
Abstract Data Types Download .zip .tar.gz Data Types Support Folder Components Required
 Version Control Unique User Downloads Download Rankings  
 0%
Total:212
This week:0
All time:8,347
This week:49Up