PHP Interface XStatic\AliasLoaderInterface

Afficher le fichier Open project: jeremeamia/xstatic

Méthodes publiques

Méthode Description
addAlias ( string $alias, string $fqcn ) Creates an alias to a fully-qualified class name (FQCN)
isRegistered ( ) : boolean Checks if the the Alias Loader has already been registered
load ( string $fqcn ) Loads an alias by creating a class_alias() to the requested class. This is used as an autoload function
register ( boolean | string $rootNamespace = false ) : boolean Registers the Alias Loader as an autoloader so that aliases can be resolved via class_alias()

Method Details

addAlias() public méthode

Creates an alias to a fully-qualified class name (FQCN)
public addAlias ( string $alias, string $fqcn )
$alias string Alias to associate with the class
$fqcn string FQCN of the class

isRegistered() public méthode

Checks if the the Alias Loader has already been registered
public isRegistered ( ) : boolean
Résultat boolean

load() public méthode

Loads an alias by creating a class_alias() to the requested class. This is used as an autoload function
public load ( string $fqcn )
$fqcn string FQCN of the class to be loaded

register() public méthode

The Root Namespace can be configured such that the alias is created in a particular namespace. Valid values for the $rootNamespace parameter are as follows: - false - The alias will be created in the global namespace (default) - true - The alias will be created in the namespace where it is referenced - Any specific namespace (e.g., 'Foo\\Bar') - The alias is created in the specified namespace
public register ( boolean | string $rootNamespace = false ) : boolean
$rootNamespace boolean | string Namespace where the alias should be created
Résultat boolean Returns true if the registration was successful