Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New structure of configs #570

Merged
merged 9 commits into from
Feb 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
adapt blog
  • Loading branch information
vjik committed Feb 4, 2023
commit f766b4565b2e4c40981a54f404594e2633ed4368
77 changes: 1 addition & 76 deletions blog/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,82 +129,7 @@
"branch-alias": {
"dev-master": "3.0.x-dev"
},
"config-plugin-options": {
"source-directory": "config"
},
"config-plugin-environments": {
"dev": {
"params": [
"test/params.php"
]
},
"prod": {
"params": [
"test/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-backend.php",
"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",
"installer-types": [
"npm-asset"
],
Expand Down
5 changes: 0 additions & 5 deletions blog/config/bootstrap-console.php

This file was deleted.

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

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
42 changes: 1 addition & 41 deletions blog/config/params.php → blog/config/common/params.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,50 +9,25 @@
use Cycle\Database\Config\SQLite\FileConnectionConfig;
use Cycle\Database\Config\SQLiteDriverConfig;
use Yiisoft\Assets\AssetManager;
use Yiisoft\Cookies\CookieMiddleware;
use Yiisoft\Definitions\Reference;
use Yiisoft\ErrorHandler\Middleware\ErrorCatcher;
use Yiisoft\Form\Field\SubmitButton;
use Yiisoft\Router\CurrentRoute;
use Yiisoft\Router\Middleware\Router;
use Yiisoft\Router\UrlGeneratorInterface;
use Yiisoft\Session\SessionMiddleware;
use Yiisoft\Translator\TranslatorInterface;
use Yiisoft\User\Login\Cookie\CookieLoginMiddleware;
use Yiisoft\Yii\Console\Application;
use Yiisoft\Yii\Console\Command\Serve;
use Yiisoft\Yii\Cycle\Schema\Conveyor\AttributedSchemaConveyor;
use Yiisoft\Yii\Cycle\Schema\Provider\FromConveyorSchemaProvider;
use Yiisoft\Yii\Cycle\Schema\Provider\PhpFileSchemaProvider;
use Yiisoft\Yii\Middleware\Locale;
use Yiisoft\Yii\Sentry\SentryMiddleware;
use Yiisoft\Yii\View\CsrfViewInjection;

return [
'locale' => [
'locales' => ['en' => 'en-US', 'ru' => 'ru-RU', 'id' => 'id-ID', 'sk' => 'sk-SK'],
'ignoredRequests' => [
'/debug**',
'/inspect**',
],
],
'mailer' => [
'adminEmail' => '[email protected]',
'senderEmail' => '[email protected]',
],
'middlewares' => [
ErrorCatcher::class,
SentryMiddleware::class,
SessionMiddleware::class,
CookieMiddleware::class,
CookieLoginMiddleware::class,
Locale::class,
Router::class,
],

'yiisoft/aliases' => [
'aliases' => [
'@root' => dirname(__DIR__),
'@root' => dirname(__DIR__, 2),
'@assets' => '@root/public/assets',
'@assetsUrl' => '@baseUrl/assets',
'@baseUrl' => $_ENV['BASE_URL'],
Expand Down Expand Up @@ -129,21 +104,6 @@
],
],

'yiisoft/yii-console' => [
'name' => Application::NAME,
'version' => Application::VERSION,
'autoExit' => false,
'commands' => [
'serve' => Serve::class,
'user/create' => App\User\Console\CreateCommand::class,
'user/assignRole' => App\User\Console\AssignRoleCommand::class,
'fixture/add' => App\Command\Fixture\AddCommand::class,
'fixture/schema/clear' => App\Command\Fixture\SchemaClearCommand::class,
'router/list' => App\Command\Router\ListCommand::class,
'translator/translate' => App\Command\Translation\TranslateCommand::class,
],
],

'yiisoft/yii-cycle' => [
// DBAL config
'dbal' => [
Expand Down
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions blog/config/console/commands.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

use Yiisoft\Yii\Console\Command\Serve;

return [
'serve' => Serve::class,
'user/create' => App\User\Console\CreateCommand::class,
'user/assignRole' => App\User\Console\AssignRoleCommand::class,
'fixture/add' => App\Command\Fixture\AddCommand::class,
'fixture/schema/clear' => App\Command\Fixture\SchemaClearCommand::class,
'router/list' => App\Command\Router\ListCommand::class,
'translator/translate' => App\Command\Translation\TranslateCommand::class,
];
File renamed without changes.
14 changes: 14 additions & 0 deletions blog/config/console/params.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

declare(strict_types=1);

use Yiisoft\Yii\Console\Application;

return [
'yiisoft/yii-console' => [
'name' => Application::NAME,
'version' => Application::VERSION,
'autoExit' => false,
'commands' => require __DIR__ . '/commands.php',
],
];
5 changes: 0 additions & 5 deletions blog/config/delegates-console.php

This file was deleted.

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

This file was deleted.

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

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 0 additions & 5 deletions blog/config/events.php

This file was deleted.

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

This file was deleted.

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

This file was deleted.

6 changes: 0 additions & 6 deletions blog/config/providers.php

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
31 changes: 31 additions & 0 deletions blog/config/web/params.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

declare(strict_types=1);

use Yiisoft\Cookies\CookieMiddleware;
use Yiisoft\ErrorHandler\Middleware\ErrorCatcher;
use Yiisoft\Router\Middleware\Router;
use Yiisoft\Session\SessionMiddleware;
use Yiisoft\User\Login\Cookie\CookieLoginMiddleware;
use Yiisoft\Yii\Middleware\Locale;
use Yiisoft\Yii\Sentry\SentryMiddleware;

return [
'middlewares' => [
ErrorCatcher::class,
SentryMiddleware::class,
SessionMiddleware::class,
CookieMiddleware::class,
CookieLoginMiddleware::class,
Locale::class,
Router::class,
],

'locale' => [
'locales' => ['en' => 'en-US', 'ru' => 'ru-RU', 'id' => 'id-ID', 'sk' => 'sk-SK'],
'ignoredRequests' => [
'/debug**',
'/inspect**',
],
],
];
5 changes: 0 additions & 5 deletions blog/config/widgets.php

This file was deleted.

91 changes: 91 additions & 0 deletions blog/configuration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?php

declare(strict_types=1);

return [
'config-plugin' => [
'params' => [
'common/params.php',
],
'params-web' => [
'$params',
'web/params.php',
],
'params-console' => [
'$params',
'console/params.php',
],
'di' => [
'$common',
'common/di/*.php',
],
'di-web' => [
'$di',
'$web',
'web/di/*.php',
],
'di-console' => [
'$di',
'$console',
],
'di-providers' => [
'$providers',
],
'di-providers-web' => [
'$di-providers',
],
'di-providers-console' => [
'$di-providers',
],
'di-delegates' => [
'$delegates',
],
'di-delegates-web' => [
'$di-delegates',
],
'di-delegates-console' => [
'$di-delegates',
],
'events' => [],
'events-web' => [
'$events',
'web/events.php',
],
'events-console' => [
'$events',
'console/events.php',
],
'routes' => [
'common/routes/*.php',
],
'bootstrap' => [
'common/bootstrap.php',
],
'bootstrap-web' => [
'$bootstrap',
],
'bootstrap-console' => [
'$bootstrap',
],
],
'config-plugin-environments' => [
'dev' => [
'params' => [
'environments/dev/params.php',
],
],
'prod' => [
'params' => [
'environments/prod/params.php',
],
],
'test' => [
'params' => [
'environments/test/params.php',
],
],
],
'config-plugin-options' => [
'source-directory' => 'config',
],
];
3 changes: 3 additions & 0 deletions blog/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ services:
- ./:/app
# host-volume for composer cache
- ~/.composer-docker/cache:/root/.composer/cache:delegated
- /projects/yii-dev-tool/dev/yii-runner:/app/vendor/yiisoft/yii-runner
- /projects/yii-dev-tool/dev/yii-runner-http:/app/vendor/yiisoft/yii-runner-http
- /projects/yii-dev-tool/dev/yii-runner-console:/app/vendor/yiisoft/yii-runner-console
ports:
- '30080:80'