Skip to content

Commit

Permalink
Remove hard code dependency in config.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Oct 21, 2023
1 parent efde024 commit 2c572bf
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,19 @@ yii help gii/model
yii gii/model --tableName=city --modelClass=City
```

### Configure with yiisoft/config

> Add the following code to your `config/config-plugin` file in your application.
```php
'config-plugin' => [
'web' => [
'$yii2-gii', // add this line
'web/*.php'
],
],
```

## Testing

[Check the documentation testing](/docs/testing.md) to learn about testing.
Expand Down
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
"source-directory": "config"
},
"config-plugin": {
"web": "web/*.php",
"params": "params.php"
"yii2-gii": "modules.php"
}
},
"config": {
Expand All @@ -52,7 +51,6 @@
},
"scripts": {
"check-dependencies": "composer-require-checker",
"mutation": "roave-infection-static-analysis-plugin",
"psalm": "psalm",
"test": "phpunit"
},
Expand Down
2 changes: 1 addition & 1 deletion config/web/gii.php → config/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'modules' => [
'gii' => [
'class' => \yii\gii\Module::class,
'allowedIPs' => $params['yii.gii.allowedIPs'] ?? [],
'allowedIPs' => $params['yii.gii.allowedIPs'] ?? ['127.0.0.1', '::1'],
],
],
];
Expand Down
9 changes: 0 additions & 9 deletions config/params.php

This file was deleted.

0 comments on commit 2c572bf

Please sign in to comment.