Skip to content

Commit

Permalink
New structure of configs (#270)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik authored Feb 19, 2023
1 parent dad9f93 commit 3728d37
Show file tree
Hide file tree
Showing 40 changed files with 207 additions and 269 deletions.
108 changes: 18 additions & 90 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,36 +32,36 @@
"psr/http-server-handler": "^1.0",
"symfony/console": "^6.0",
"vlucas/phpdotenv": "^5.3",
"yiisoft/aliases": "^2.0",
"yiisoft/assets": "^3.0",
"yiisoft/cache": "^2.0",
"yiisoft/cache-file": "^2.0",
"yiisoft/aliases": "^3.0",
"yiisoft/assets": "^4.0",
"yiisoft/cache": "^3.0",
"yiisoft/cache-file": "^3.0",
"yiisoft/config": "^1.1",
"yiisoft/csrf": "^1.2",
"yiisoft/data-response": "^1.0",
"yiisoft/csrf": "^2.0",
"yiisoft/data-response": "^2.0",
"yiisoft/definitions": "^3.0",
"yiisoft/di": "^1.2",
"yiisoft/error-handler": "^2.0",
"yiisoft/error-handler": "^3.0",
"yiisoft/factory": "^1.0",
"yiisoft/files": "^2.0",
"yiisoft/html": "^3.0",
"yiisoft/http": "^1.2",
"yiisoft/i18n": "^1.1",
"yiisoft/log": "^2.0",
"yiisoft/log-target-file": "^2.0",
"yiisoft/router": "^2.0",
"yiisoft/router-fastroute": "^2.0",
"yiisoft/translator": "^2.0",
"yiisoft/log-target-file": "^3.0",
"yiisoft/router": "^3.0",
"yiisoft/router-fastroute": "^3.0",
"yiisoft/translator": "^3.0",
"yiisoft/translator-message-php": "^1.1",
"yiisoft/view": "^7.0",
"yiisoft/yii-console": "^1.3",
"yiisoft/view": "^8.0",
"yiisoft/yii-console": "^2.0",
"yiisoft/yii-debug": "^3.0@dev",
"yiisoft/yii-event": "^1.0",
"yiisoft/yii-event": "^2.0",
"yiisoft/yii-http": "^1.0",
"yiisoft/yii-middleware": "dev-master",
"yiisoft/yii-runner-console": "^1.0",
"yiisoft/yii-runner-http": "^1.0",
"yiisoft/yii-view": "^5.0"
"yiisoft/yii-runner-console": "^2.0",
"yiisoft/yii-runner-http": "^2.0",
"yiisoft/yii-view": "^6.0"
},
"require-dev": {
"codeception/c3": "^2.7",
Expand Down Expand Up @@ -93,79 +93,7 @@
"branch-alias": {
"dev-master": "1.0.x-dev"
},
"config-plugin-options": {
"source-directory": "config"
},
"config-plugin-environments": {
"dev": {
"params": [
"dev/params.php"
]
},
"prod": {
"params": [
"prod/params.php"
]
},
"test": {
"params": [
"test/params.php"
]
}
},
"config-plugin": {
"common": "common/*.php",
"params": [
"params.php",
"?params-local.php"
],
"web": [
"$common",
"web/*.php"
],
"console": [
"$common",
"console/*.php"
],
"events": "events.php",
"events-web": [
"$events",
"events-web.php"
],
"events-console": [
"$events",
"events-console.php"
],
"providers": "providers.php",
"providers-web": [
"$providers",
"providers-web.php"
],
"providers-console": [
"$providers",
"providers-console.php"
],
"delegates": "delegates.php",
"delegates-web": [
"$delegates",
"delegates-web.php"
],
"delegates-console": [
"$delegates",
"delegates-console.php"
],
"routes": "routes.php",
"bootstrap": "bootstrap.php",
"bootstrap-web": [
"$bootstrap",
"bootstrap-web.php"
],
"bootstrap-console": [
"$bootstrap",
"bootstrap-console.php"
],
"widgets": "widgets.php"
}
"config-plugin-file": "configuration.php"
},
"config": {
"sort-packages": true,
Expand Down
1 change: 0 additions & 1 deletion config/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
*-local.php
.merge-plan.php
5 changes: 0 additions & 5 deletions config/bootstrap-console.php

This file was deleted.

5 changes: 0 additions & 5 deletions config/bootstrap-web.php

This file was deleted.

5 changes: 0 additions & 5 deletions config/bootstrap.php

This file was deleted.

18 changes: 18 additions & 0 deletions config/common/aliases.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

return [
'@root' => dirname(__DIR__, 2),
'@assets' => '@root/public/assets',
'@assetsUrl' => '@baseUrl/assets',
'@baseUrl' => '/',
'@messages' => '@resources/messages',
'@npm' => '@root/node_modules',
'@public' => '@root/public',
'@resources' => '@root/resources',
'@runtime' => '@root/runtime',
'@vendor' => '@root/vendor',
'@layout' => '@resources/views/layout',
'@views' => '@resources/views',
];
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
36 changes: 36 additions & 0 deletions config/common/params.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

declare(strict_types=1);

use App\ViewInjection\CommonViewInjection;
use App\ViewInjection\LayoutViewInjection;
use App\ViewInjection\TranslatorViewInjection;
use Yiisoft\Definitions\Reference;
use Yiisoft\Yii\View\CsrfViewInjection;

return [
'app' => [
'charset' => 'UTF-8',
'locale' => 'en',
'name' => 'My Project',
],

'yiisoft/aliases' => [
'aliases' => require __DIR__ . '/aliases.php',
],

'yiisoft/translator' => [
'locale' => 'en',
'fallbackLocale' => 'en',
'defaultCategory' => 'app',
],

'yiisoft/yii-view' => [
'injections' => [
Reference::to(CommonViewInjection::class),
Reference::to(CsrfViewInjection::class),
Reference::to(LayoutViewInjection::class),
Reference::to(TranslatorViewInjection::class),
],
],
];
File renamed without changes.
Empty file removed config/console/.gitkeep
Empty file.
9 changes: 9 additions & 0 deletions config/console/commands.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

use App\Command\Hello;

return [
'hello' => Hello::class,
];
9 changes: 9 additions & 0 deletions config/console/params.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

return [
'yiisoft/yii-console' => [
'commands' => require __DIR__ . '/commands.php',
],
];
5 changes: 0 additions & 5 deletions config/delegates-console.php

This file was deleted.

5 changes: 0 additions & 5 deletions config/delegates-web.php

This file was deleted.

5 changes: 0 additions & 5 deletions config/delegates.php

This file was deleted.

5 changes: 0 additions & 5 deletions config/dev/params.php

This file was deleted.

9 changes: 9 additions & 0 deletions config/environments/dev/params.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

return [
'yiisoft/yii-debug' => [
'enabled' => true,
],
];
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions config/events-console.php

This file was deleted.

5 changes: 0 additions & 5 deletions config/events-web.php

This file was deleted.

5 changes: 0 additions & 5 deletions config/events.php

This file was deleted.

72 changes: 0 additions & 72 deletions config/params.php

This file was deleted.

5 changes: 0 additions & 5 deletions config/providers-console.php

This file was deleted.

7 changes: 0 additions & 7 deletions config/providers-web.php

This file was deleted.

7 changes: 0 additions & 7 deletions config/providers.php

This file was deleted.

File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 3728d37

Please sign in to comment.