PHP Класс FOF30\Autoloader\Autoloader

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
addMap ( string $prefix, array | string $paths, boolean $prepend = false ) Registers a set of PSR-4 directories for a given namespace, either appending or prefixing to the ones previously set for this namespace.
findFile ( string $class ) : string | false Finds the path to the file where the class is defined.
getFallbackDirs ( ) : array Returns the list of fall=back directories
getInstance ( ) : Autoloader
getPrefixes ( ) : array Returns the prefix to directory map
hasMap ( string $prefix ) : boolean Does the autoloader have a map for the specified prefix?
loadClass ( string $class ) : boolean | null Loads the given class or interface.
register ( boolean $prepend = false ) : void Registers this instance as an autoloader.
setMap ( string $prefix, array | string $paths ) : void Registers a set of PSR-4 directories for a given namespace, replacing any others previously set for this namespace.
unregister ( ) : void Unregisters this instance as an autoloader.

Описание методов

addMap() публичный Метод

Registers a set of PSR-4 directories for a given namespace, either appending or prefixing to the ones previously set for this namespace.
public addMap ( string $prefix, array | string $paths, boolean $prepend = false )
$prefix string The prefix/namespace, with trailing '\\'
$paths array | string The PSR-0 base directories
$prepend boolean Whether to prefix the directories

findFile() публичный Метод

Finds the path to the file where the class is defined.
public findFile ( string $class ) : string | false
$class string The name of the class
Результат string | false The path if found, false otherwise

getFallbackDirs() публичный Метод

Returns the list of fall=back directories
public getFallbackDirs ( ) : array
Результат array

getInstance() публичный статический Метод

public static getInstance ( ) : Autoloader
Результат Autoloader

getPrefixes() публичный Метод

Returns the prefix to directory map
public getPrefixes ( ) : array
Результат array

hasMap() публичный Метод

Does the autoloader have a map for the specified prefix?
public hasMap ( string $prefix ) : boolean
$prefix string
Результат boolean

loadClass() публичный Метод

Loads the given class or interface.
public loadClass ( string $class ) : boolean | null
$class string The name of the class
Результат boolean | null True if loaded, null otherwise

register() публичный Метод

Registers this instance as an autoloader.
public register ( boolean $prepend = false ) : void
$prepend boolean Whether to prepend the autoloader or not
Результат void

setMap() публичный Метод

Registers a set of PSR-4 directories for a given namespace, replacing any others previously set for this namespace.
public setMap ( string $prefix, array | string $paths ) : void
$prefix string The prefix/namespace, with trailing '\\'
$paths array | string The PSR-4 base directories
Результат void

unregister() публичный Метод

Unregisters this instance as an autoloader.
public unregister ( ) : void
Результат void