-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Issue with multiple gii runs from command line #5224
Comments
Most actions are not designed to support re-entry. You can work around this issue by creating a new instance of application. Will not fix it. |
Do you have any special advices about this approach, because when I create another instance in the console command...
Looks like my existing application also gets reconfigured and looses it controllerMap i.e. |
Because |
OK. Just wanted to note that this looks to quite some overhead to me, but most likely there are side-effects with re-running I don't see at the moment. PS: It's especially about gii batches, see here for an example to get a more complete picture. |
It turns out that this is more problematic than I thought. I cannot just clone the current application, because the references to the modules are still pointing to the same object. So I have to look for the appropriate console config files and create a whole new console application instance with all modules and components from scratch. Is there a nicer way to do this, eg. getting the current console config from the application? [edit]
|
Could you try again with the latest code? |
@qiangxue I tried it with the latest code, but I still get the same error. I was able to try the command line batches with larger schemas and I must say this has a huge(!) impact on performance for Yii2 on the command line. Creating an Couldn't we have |
You can reproduce the problem with the BatchController mentioned before. I had to introduce this (hopefully) temporary fix, but this created a really non-wanted dependency to the configuration locations. |
The
Module
class from gii rebuilds it's generators property.On the second run it takes the created object as a configuration, which throws an error:
Called like so:
Possible workaround, check if the generator is already an object:
The text was updated successfully, but these errors were encountered: