ComponentLoader
in package
Loads commands from installed Neuron components.
Scans composer.json files for CLI provider classes and registers their commands.
Table of Contents
Properties
- $fs : IFileSystem
- $loadedProviders : array<string|int, mixed>
- $registry : Registry
Methods
- __construct() : mixed
- getLoadedProviders() : array<string|int, mixed>
- Get the list of loaded providers
- loadComponents() : void
- Load commands from all installed components
- loadProvider() : bool
- Load a command provider class
- registerProvider() : bool
- Manually register a provider
- findComposerJson() : string|null
- Find the project's composer.json
- findVendorDirectory() : string|null
- Find the vendor directory
- loadProjectCommands() : void
- Load commands from the project's composer.json
Properties
$fs
private
IFileSystem
$fs
$loadedProviders
private
array<string|int, mixed>
$loadedProviders
= []
$registry
private
Registry
$registry
Methods
__construct()
public
__construct(Registry $registry[, IFileSystem|null $fs = null ]) : mixed
Parameters
- $registry : Registry
- $fs : IFileSystem|null = null
-
File system implementation (null = use real file system)
getLoadedProviders()
Get the list of loaded providers
public
getLoadedProviders() : array<string|int, mixed>
Return values
array<string|int, mixed>loadComponents()
Load commands from all installed components
public
loadComponents() : void
loadProvider()
Load a command provider class
public
loadProvider(string $providerClass) : bool
Parameters
- $providerClass : string
Return values
boolregisterProvider()
Manually register a provider
public
registerProvider(string $providerClass) : bool
Parameters
- $providerClass : string
Return values
boolfindComposerJson()
Find the project's composer.json
private
findComposerJson() : string|null
Return values
string|nullfindVendorDirectory()
Find the vendor directory
private
findVendorDirectory() : string|null
Return values
string|nullloadProjectCommands()
Load commands from the project's composer.json
private
loadProjectCommands() : void