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

Use Dii in console application #10

Closed
amashigeseiji opened this issue Nov 20, 2020 · 0 comments
Closed

Use Dii in console application #10

amashigeseiji opened this issue Nov 20, 2020 · 0 comments

Comments

@amashigeseiji
Copy link
Collaborator

Dii in console application

CConsoleCommand は CConsoleCommandRunner::createCommand でインスタンス化される。このメソッド中で CConsoleCommand を直接 new している箇所は下記の行のみです。

https://github.com/yiisoft/yii/blob/master/framework/console/CConsoleCommandRunner.php#L170

ここで Dii:createComponent によって初期化するように修正すれば、consoleアプリケーションにおいてもDiiを利用できる。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant