Size: a a a

2020 August 15

AM

Alexander Makarov in Yii Framework 3
TradersVE
I'm not talking about canceling, but I want to start an app from scratch without any configuration. I'm going to assemble mine, I can't because the plugin will always bring all the configuration of all the packages.
In many cases, yes. We can avoid it and it would be a good thing, I think.

But we're not discussing that at the moment. We're moving providers but leaving their config in the application. Config won't be moved to whatever place.
источник

T

TradersVE in Yii Framework 3
Alexander Makarov
In many cases, yes. We can avoid it and it would be a good thing, I think.

But we're not discussing that at the moment. We're moving providers but leaving their config in the application. Config won't be moved to whatever place.
But it is the same problem, at first I wanted to move all providers to all packages, then I realized that we would have thousands of questions where the configuration of this comes from, and so I understood that it is a bad idea, because it hides the code of the configuration, which should be visible.
источник

AP

Arman Poghosyan in Yii Framework 3
TradersVE
I'm not talking about canceling, but I want to start an app from scratch without any configuration. I'm going to assemble mine, I can't because the plugin will always bring all the configuration of all the packages.
All configuration will be still in an app template, only some providers will be moved, which will still receive configuration from your files. As an example RouterProvider will just define all implementations for interfaces and how to construct Router, but it will still accept $routes array from you in your configuration file, it will just hide the details how the objects are built/constructed.
источник

T

TradersVE in Yii Framework 3
What if it would be great is to write the configuration of the service providers, in the separate folder of the composer-plugin, that if I would like, and from there I will assemble it to the container.
источник

Д

Дмитрий in Yii Framework 3
TradersVE
But it is the same problem, at first I wanted to move all providers to all packages, then I realized that we would have thousands of questions where the configuration of this comes from, and so I understood that it is a bad idea, because it hides the code of the configuration, which should be visible.
True.
источник

AP

Arman Poghosyan in Yii Framework 3
So you will have in your web config something like 'yiisoft/router-fastroute/router' => [ '__class' => Yiisoft\Yii\Web\RouterProvider::class, '__construct()' => [[$routes]]]
источник

Д

Дмитрий in Yii Framework 3
Arman Poghosyan
So you will have in your web config something like 'yiisoft/router-fastroute/router' => [ '__class' => Yiisoft\Yii\Web\RouterProvider::class, '__construct()' => [[$routes]]]
In case config appear more complex. Often will have to check code of the provider
источник

T

TradersVE in Yii Framework 3
I think a good solution would be to move the providers:

—> Config
   - All archives configs
   —> Components
       - Cache.
       - Logger.
       - PSR17.
источник

AP

Arman Poghosyan in Yii Framework 3
Дмитрий
In case config appear more complex. Often will have to check code of the provider
And you can just Ctrl click the provider to see what it does in your IDE.
источник

T

TradersVE in Yii Framework 3
@samdark check the msg I sent you
источник

AP

Arman Poghosyan in Yii Framework 3
TradersVE
I think a good solution would be to move the providers:

—> Config
   - All archives configs
   —> Components
       - Cache.
       - Logger.
       - PSR17.
They can just be in own root folder named 'providers' why nest it under config and especially 'component' folder?
источник

T

TradersVE in Yii Framework 3
Arman Poghosyan
They can just be in own root folder named 'providers' why nest it under config and especially 'component' folder?
for me individual packages are components or services of an application.
источник

AP

Arman Poghosyan in Yii Framework 3
TradersVE
for me individual packages are components or services of an application.
I would avoid 'component' naming, as component based framework is something different. It's more suitable for yii2
источник

AP

Arman Poghosyan in Yii Framework 3
Providers are just factories for the container
источник

T

TradersVE in Yii Framework 3
Arman Poghosyan
Providers are just factories for the container
and what is the product of the factory?
источник

AP

Arman Poghosyan in Yii Framework 3
Кстати yiisoft/di умеет делать не синглтоны?
источник

AP

Arman Poghosyan in Yii Framework 3
TradersVE
and what is the product of the factory?
In all our providers they just create definition for container, if you want a name, they are more a 'services' than 'components'
источник

DS

Dmitriy S in Yii Framework 3
Arman Poghosyan
Кстати yiisoft/di умеет делать не синглтоны?
У меня есть вариант с тегами, пока еще не запостил
источник

DS

Dmitriy S in Yii Framework 3
Arman Poghosyan
In all our providers they just create definition for container, if you want a name, they are more a 'services' than 'components'
May be "at all"? it is more common
источник

DS

Dmitriy S in Yii Framework 3
Arman Poghosyan
In all our providers they just create definition for container, if you want a name, they are more a 'services' than 'components'
yeah, this is more service then component, so you name it himself)
источник