Skip to content

Wiki Loaders

Danijel Galić edited this page Feb 1, 2024 · 1 revision
final class \FireHub\Core\Initializers\Autoload\Loaders()

Important

This class is marked as final.

### List of active loader implementations for autoloader

This class was created by Danijel Galić <danijel.galic@outlook.com>
Copyright: 2024 FireHub Web Application Framework
License: <https://opensource.org/licenses/OSL-3.0> OSL Open Source License version 3
Version: GIT: $Id$ Blob checksum.

Fully Qualified Class Name:  \FireHub\Core\Initializers\Autoload\Loaders
Source code:  view source code
Blame:  view blame
History:  view history

Methods

Type Name Title
public get ### Get loader callback
public add ### Adds a new loader
public remove ### Removes loader
public list ### Get list of autoloader implementations
public Loaders::get(string $name):callable

### Get loader callback

Source code:  view source code
Blame:  view blame

Parameters

  • string $name - non-empty-string Loader name.

Throws

  • \Error - If loader doesn't exist.

Returns

  • callable - callable(string):void Loader callback.
public Loaders::add(string $name, callable $callback):true

### Adds a new loader

Source code:  view source code
Blame:  view blame

Parameters

  • string $name - non-empty-string Loader name.
  • callable $callback - callable(string):void The autoload function being registered.

Throws

  • \Error - If loader is empty, or loader already exists.

Returns

  • true - Always true.
public Loaders::remove(string $name):true

### Removes loader

Source code:  view source code
Blame:  view blame

Parameters

  • string $name - non-empty-string Loader name.

Throws

  • \Error - If loader doesn't exist.

Returns

  • true - Always true.
public Loaders::list():array

### Get list of autoloader implementations

Source code:  view source code
Blame:  view blame

Returns

  • array - array<non-empty-string, callable(string):void> List of autoloader implementations.
Clone this wiki locally