Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

elusivecodes/FyreLoader

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FyreLoader

FyreLoader is a free, open-source autoloader library for PHP.

Table Of Contents

Installation

Using Composer

composer require fyre/loader

In PHP:

use Fyre\Loader\Loader;

Basic Usage

$loader = new Loader();

Autoloading

It is recommended to bind the Loader to the Container as a singleton.

$container->singleton(Loader::class);

Methods

Add Class Map

Add a class map.

  • $classMap is an array containing the class map.
$loader->addClassMap($classMap);

Add Namespaces

Add namespaces.

  • $namespaces is an array containing the namespaces where the key is the namespace prefix and the value is the path.
$loader->addNamespaces($namespaces);

Clear

Clear the auto loader.

$loader->clear();

Get Class Map

Get the class map.

$classMap = $loader->getClassMap();

Get Namespace

Get a namespace.

  • $prefix is a string representing the namespace prefix.
$paths = $loader->getNamespace($prefix);

Get Namespace Paths

Get all paths for a namespace.

  • $prefix is a string representing the namespace prefix.
$paths = $loader->getNamespacePaths($prefix);

Get Namespaces

Get the namespaces.

$namespaces = $loader->getNamespaces();

Has Namespace

Determine whether a namespace exists.

  • $prefix is a string representing the namespace prefix.
$hasNamespace = $loader->hasNamespace($prefix);

Load Composer

Load composer.

  • $composerPath is a string representing the composer autoload path.
$loader->loadComposer($composerPath);

Register

Register the autoloader.

$loader->register();

Remove Class

Remove a class.

  • $className is a string representing the class name.
$loader->removeClass($className);

Remove Namespace

Remove a namespace.

  • $prefix is a string representing the namespace prefix.
$loader->removeNamespace($prefix);

Unregister

Unregister the autoloader.

$loader->unregister();

About

FyreLoader is a free, open-source autoloader library for PHP.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.