Dependency injection 3.2+ ​
A limited service container is built to instantiate crawlers and parsers. This allows custom crawlers to define dependencies to a limited set of services.
Included services ​
The container includes the following runtime services:
Service | Description | Added in |
---|---|---|
OutputInterface | Current output, either extracted from console application or constructed as ConsoleOutput | 3.2.0 |
LoggerInterface | Current logger, only available if the logFile configuration option is passed | 3.2.0 |
EventDispatcherInterface | Current event dispatcher instance, either extracted from console application or constructed as new instance | 3.2.0 |
ClientFactory | Factory to create Guzzle client with defaults from clientOptions configuration option | 4.0.0 |
ClientInterface | Shared Guzzle client, constructed with clientOptions configuration option | 4.0.0 |
Supported factories ​
The service container is built when creating crawlers and parsers through their respective factories, including: