PHP Interface XStatic\AliasLoaderInterface

Exibir arquivo Open project: jeremeamia/xstatic

Public Methods

Method 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 method

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 method

Checks if the the Alias Loader has already been registered
public isRegistered ( ) : boolean
return boolean

load() public method

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 method

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
return boolean Returns true if the registration was successful