PHP Class Webiny\Component\ClassLoader\Loaders\AbstractLoader

Mostrar archivo Open project: Webiny/Framework

Protected Properties

Property Type Description
$maps A list of registered maps.
$rules Optional rules that are attached to the map.

Public Methods

Method Description
findClass ( string $class ) : string | boolean Parses that class name and returns the absolute path to the class.
getInstance ( ) Get an instance of Loader.
registerMap ( string $prefix, array | string $library ) : void Register a map.
unregisterMap ( string $mapPrefix ) : boolean Removes the given map prefix from class loader.

Method Details

findClass() abstract public method

NOTE: no file existence checks should be performed, nor should the method require or include the class, is should just return the path to the file.
abstract public findClass ( string $class ) : string | boolean
$class string Class name that should be loaded.
return string | boolean Path to the class or false.

getInstance() public static method

Get an instance of Loader.
public static getInstance ( )

registerMap() abstract public method

Register a map.
abstract public registerMap ( string $prefix, array | string $library ) : void
$prefix string Map prefix or namespace.
$library array | string Absolute path to the library or an array with path and additional options.
return void

unregisterMap() public method

Removes the given map prefix from class loader.
public unregisterMap ( string $mapPrefix ) : boolean
$mapPrefix string Map prefix that should be removed.
return boolean Returns true if the map prefix was found and removed, otherwise false.

Property Details

$maps protected_oe property

A list of registered maps.
protected $maps

$rules protected_oe property

Optional rules that are attached to the map.
protected $rules