Abstract Class Yiisoft\Yii\Runner\ApplicationRunner
| Inheritance | Yiisoft\Yii\Runner\ApplicationRunner |
|---|---|
| Implements | Yiisoft\Yii\Runner\RunnerInterface |
Provides basic functionality for creating adapters.
Protected Properties
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Yii\Runner\ApplicationRunner | |
| getConfig() | Yiisoft\Yii\Runner\ApplicationRunner | |
| getContainer() | Yiisoft\Yii\Runner\ApplicationRunner | |
| run() | Yiisoft\Yii\Runner\ApplicationRunner | |
| withConfig() | Returns a new instance with the specified config instance {@see ConfigInterface}. | Yiisoft\Yii\Runner\ApplicationRunner |
| withContainer() | Returns a new instance with the specified container instance {@see ContainerInterface}. | Yiisoft\Yii\Runner\ApplicationRunner |
Protected Methods
| Method | Description | Defined By |
|---|---|---|
| checkEvents() | Yiisoft\Yii\Runner\ApplicationRunner | |
| getConfiguration() | Yiisoft\Yii\Runner\ApplicationRunner | |
| runBootstrap() | Yiisoft\Yii\Runner\ApplicationRunner |
Property Details
Method Details
| public mixed __construct ( string $rootPath, boolean $debug, boolean $checkEvents, string|null $environment, string $bootstrapGroup, string $eventsGroup, string $diGroup, string $diProvidersGroup, string $diDelegatesGroup, string $diTagsGroup, string $paramsGroup, array $nestedParamsGroups, array $nestedEventsGroups, object[] $configModifiers = [], string $configDirectory = 'config', string $vendorDirectory = 'vendor', string $configMergePlanFile = '.merge-plan.php' ) | ||
| $rootPath | string |
The absolute path to the project root. |
| $debug | boolean |
Whether the debug mode is enabled. |
| $checkEvents | boolean |
Whether to check events' configuration. |
| $environment | string|null |
The environment name. |
| $bootstrapGroup | string |
The bootstrap configuration group name. |
| $eventsGroup | string |
The events' configuration group name. |
| $diGroup | string |
The container definitions' configuration group name. |
| $diProvidersGroup | string |
The container providers' configuration group name. |
| $diDelegatesGroup | string |
The container delegates' configuration group name. |
| $diTagsGroup | string |
The container tags' configuration group name. |
| $paramsGroup | string |
The configuration parameters group name. |
| $nestedParamsGroups | array |
Configuration group names that are included into configuration parameters group. This is needed for recursive merging of parameters. |
| $nestedEventsGroups | array |
Configuration group names that are included into events' configuration group. This is needed for reverse and recursive merge of events' configurations. |
| $configModifiers | object[] |
Modifiers for {@see \Yiisoft\Config\Config}. |
| $configDirectory | string |
The relative path from {@see $rootPath} to the configuration storage location. |
| $vendorDirectory | string |
The relative path from {@see $rootPath} to the vendor directory. |
| $configMergePlanFile | string |
The relative path from {@see $configDirectory} to merge plan. |
public function __construct(
protected string $rootPath,
protected bool $debug,
protected bool $checkEvents,
protected ?string $environment,
protected string $bootstrapGroup,
protected string $eventsGroup,
protected string $diGroup,
protected string $diProvidersGroup,
protected string $diDelegatesGroup,
protected string $diTagsGroup,
protected string $paramsGroup,
protected array $nestedParamsGroups,
protected array $nestedEventsGroups,
protected array $configModifiers = [],
protected string $configDirectory = 'config',
protected string $vendorDirectory = 'vendor',
protected string $configMergePlanFile = '.merge-plan.php',
) {
}
| protected void checkEvents ( ) | ||
| throws | \Psr\Container\ContainerExceptionInterface|ErrorException|\Psr\Container\NotFoundExceptionInterface | |
|---|---|---|
final protected function checkEvents(): void
{
if (
$this->checkEvents
&& null !== $configuration = $this->getConfiguration($this->eventsGroup)
) {
/** @psalm-suppress MixedMethodCall */
$this->getContainer()
->get(ListenerConfigurationChecker::class)
->check($configuration);
}
}
| public \Yiisoft\Config\ConfigInterface getConfig ( ) | ||
| throws | ErrorException | |
|---|---|---|
final public function getConfig(): ConfigInterface
{
return $this->config ??= $this->createDefaultConfig();
}
| protected array|null getConfiguration ( string $name ) | ||
| $name | string | |
final protected function getConfiguration(string $name): ?array
{
$config = $this->getConfig();
return $config->has($name) ? $config->get($name) : null;
}
| public \Psr\Container\ContainerInterface getContainer ( ) | ||
| throws | ErrorException|\Yiisoft\Definitions\Exception\InvalidConfigException | |
|---|---|---|
final public function getContainer(): ContainerInterface
{
$this->container ??= $this->createDefaultContainer();
if ($this->container instanceof Container) {
return $this->container->get(ContainerInterface::class);
}
return $this->container;
}
| protected void runBootstrap ( ) | ||
| throws | ErrorException|RuntimeException | |
|---|---|---|
final protected function runBootstrap(): void
{
$bootstrapList = $this->getConfiguration($this->bootstrapGroup);
if (empty($bootstrapList)) {
return;
}
(new BootstrapRunner($this->getContainer(), $bootstrapList))->run();
}
Returns a new instance with the specified config instance {@see ConfigInterface}.
| public Yiisoft\Yii\Runner\ApplicationRunner withConfig ( \Yiisoft\Config\ConfigInterface $config ) | ||
| $config | \Yiisoft\Config\ConfigInterface |
The config instance. |
final public function withConfig(ConfigInterface $config): static
{
$new = clone $this;
$new->config = $config;
return $new;
}
Returns a new instance with the specified container instance {@see ContainerInterface}.
| public Yiisoft\Yii\Runner\ApplicationRunner withContainer ( \Psr\Container\ContainerInterface $container ) | ||
| $container | \Psr\Container\ContainerInterface |
The container instance. |
final public function withContainer(ContainerInterface $container): static
{
$new = clone $this;
$new->container = $container;
return $new;
}
Signup or Login in order to comment.