# ConfigDataFactory

> Creates the live Yii and PHP configuration shown by the Configuration page.

[API reference](/docs/api/index.md) › [Yii3 Debug](/docs/extensions/yii3-debug/reference/index.md) › ConfigDataFactory

| final readonly class | `Yii3\Debug\ConfigDataFactory` |
| --- | --- |
| Source | [`src/ConfigDataFactory.php`](https://github.com/yii3/debug/blob/main/src/ConfigDataFactory.php#L28) |

Creates the live Yii and PHP configuration shown by the Configuration page.

Application metadata the application does not declare falls back to the runtime: the Composer root package supplies
the name and version, `APP_ENV` the environment, and `APP_DEBUG` the debug mode.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`__construct()`](#method-__construct) | Creates the configuration-data factory with optional application metadata. | `ConfigDataFactory` |
| [`create()`](#method-create) | Builds the Configuration panel payload from the live application and PHP runtime. | `ConfigDataFactory` |

## Method details

### __construct() <span id="method-__construct"></span>

```php
public function __construct(array<string, mixed> $application = [])
```

Creates the configuration-data factory with optional application metadata.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$application` | `array<string, mixed>` | Optional application metadata. |

### create() <span id="method-create"></span>

```php
public function create(): array<string, mixed>
```

Builds the Configuration panel payload from the live application and PHP runtime.

**Returns**

`array<string, mixed>`: Payload accepted by the shared Configuration presenter.