class ClassLoader (View source)

A class that handles loading classes and interfaces from a class manifest instance.

Properties

protected array $manifests

Map of 'instance' (ClassManifest) and other options.

Methods

public static 
inst()

No description

public
getManifest()

Returns the currently active class manifest instance that is used for loading classes.

public
hasManifest()

Returns true if this class loader has a manifest.

public
pushManifest(ClassManifest $manifest, bool $exclusive = true)

Pushes a class manifest instance onto the top of the stack.

public
popManifest()

No description

public
registerAutoloader()

No description

public
string
loadClass(string $class)

Loads a class or interface if it is present in the currently active manifest.

public
string|false
getItemPath(string $class)

Returns the path for a class or interface in the currently active manifest, or any previous ones if later manifests aren't set to "exclusive".

public
init(bool $includeTests = false, bool $forceRegen = false, array $ignoredCIConfigs = [])

Initialise the class loader

public
bool
classExists(string $class) deprecated

Returns true if a class or interface name exists in the manifest.

Details

static ClassLoader inst()

No description

Return Value

ClassLoader

ClassManifest getManifest()

Returns the currently active class manifest instance that is used for loading classes.

Return Value

ClassManifest

hasManifest()

Returns true if this class loader has a manifest.

pushManifest(ClassManifest $manifest, bool $exclusive = true)

Pushes a class manifest instance onto the top of the stack.

Parameters

ClassManifest $manifest
bool $exclusive

Marks the manifest as exclusive. If set to FALSE, will look for classes in earlier manifests as well.

ClassManifest popManifest()

No description

Return Value

ClassManifest

registerAutoloader()

No description

string loadClass(string $class)

Loads a class or interface if it is present in the currently active manifest.

Parameters

string $class

Return Value

string

string|false getItemPath(string $class)

Returns the path for a class or interface in the currently active manifest, or any previous ones if later manifests aren't set to "exclusive".

Parameters

string $class

Return Value

string|false

init(bool $includeTests = false, bool $forceRegen = false, array $ignoredCIConfigs = [])

Initialise the class loader

Parameters

bool $includeTests
bool $forceRegen
array $ignoredCIConfigs

bool classExists(string $class) deprecated

deprecated 4.0.1 Use ClassInfo::exists() instead

Returns true if a class or interface name exists in the manifest.

Parameters

string $class

Return Value

bool