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

include command debug for yii2 #490

Merged
merged 7 commits into from
Sep 4, 2022
Merged

Conversation

chicuongit913
Copy link
Contributor

Q A
Is bugfix?
New feature? ✔️ allow debug when execute command
Breaks BC?
Fixed issues

@samdark samdark added the pr:missing usecase It is not clear what is the use case for the pull request. label Jun 30, 2022
@samdark samdark added type:enhancement Enhancement and removed pr:missing usecase It is not clear what is the use case for the pull request. labels Sep 4, 2022
@yiisoft yiisoft deleted a comment from yii-bot Sep 4, 2022
@samdark samdark added this to the 2.1.20 milestone Sep 4, 2022
@samdark
Copy link
Member

samdark commented Sep 4, 2022

That's great PR 👍. But there are issues:

  1. When trying to view saved console request data, "Request", it ends up with "Calling unknown method: yii\console\Request::getHeaders()".
  2. At the requests index page, it's not prepared to display console return statuses so the color for 0 is red etc. 0 should be green.
  3. At the requests index page titles could be adjusted to reflect commands i.e. "URL/command" instead of "URL" etc.
  4. At the toolbar, "route" title could be either adjusted or, better, removed since it's not "Route" anymore.

@samdark samdark removed this from the 2.1.20 milestone Sep 4, 2022
@chicuongit913
Copy link
Contributor Author

That's great PR 👍. But there are issues:

  1. When trying to view saved console request data, "Request", it ends up with "Calling unknown method: yii\console\Request::getHeaders()".
  2. At the requests index page, it's not prepared to display console return statuses so the color for 0 is red etc. 0 should be green.
  3. At the requests index page titles could be adjusted to reflect commands i.e. "URL/command" instead of "URL" etc.
  4. At the toolbar, "route" title could be either adjusted or, better, removed since it's not "Route" anymore.

Fixed!

@samdark
Copy link
Member

samdark commented Sep 4, 2022

Awesome. Would you please add a line for CHANGELOG?

@samdark samdark added this to the 2.1.21 milestone Sep 4, 2022
@chicuongit913
Copy link
Contributor Author

added change log

@samdark samdark merged commit 88263a3 into yiisoft:master Sep 4, 2022
@samdark
Copy link
Member

samdark commented Sep 4, 2022

Thanks!

@chicuongit913
Copy link
Contributor Author

Hi Samdark, i just curious that when you will publish the tag 2.1.21?

@samdark
Copy link
Member

samdark commented Sep 6, 2022

Well, nothing's holding me from doing it right now :)

@samdark
Copy link
Member

samdark commented Sep 6, 2022

Done.

@chicuongit913
Copy link
Contributor Author

great, thanks

@nadar
Copy link
Contributor

nadar commented Sep 6, 2022

@chicuongit913 This is a great PR! Thank you. Now we are even able to debug queue jobs without pain! Thanks

@vadim-bulochnik
Copy link

Is there some documentation about how to perform commands debugging?

@nadar
Copy link
Contributor

nadar commented Sep 7, 2022

@vadim-bulochnik just add the debug toolbar to the console.php configuration and you are done.

@nadar
Copy link
Contributor

nadar commented Sep 7, 2022

@vadim-bulochnik
Copy link

@vadim-bulochnik just add the debug toolbar to the console.php configuration and you are done.

Yes, this is done. But how to use this debug toolbar in console? :) Sorry for stupid question.

@nadar
Copy link
Contributor

nadar commented Sep 7, 2022

Just as you normally would, via browser http://localhost/debug (or whatever setup you have) and you will see the console requests "flagged" as COMMAND (instead of GET, POST, etc.)

@vadim-bulochnik
Copy link

Just as you normally would, via browser http://localhost/debug (or whatever setup you have) and you will see the console requests "flagged" as COMMAND (instead of GET, POST, etc.)

Thanks, but I still can't see console requests. I have a feeling that for console need to setup another url for debug toolbar, because for example debug toolbar in backend application shows only logs from backend, and debug toolbar in frontend application - shows logs from frontend. Thus, I think should be a way to setup debug toolbar for console application, but not sure how.

@samdark
Copy link
Member

samdark commented Sep 7, 2022

Yes. For advanced template there are some adjustments needed so app writes its data to one of backend/frontend directories.

@vadim-bulochnik
Copy link

Yes. For advanced template there are some adjustments needed so app writes its data to one of backend/frontend directories.

Thanks for information! Will wait for improvements :)

@chicuongit913
Copy link
Contributor Author

chicuongit913 commented Oct 11, 2022 via email

@nadar
Copy link
Contributor

nadar commented Oct 11, 2022

@chicuongit913 it has been released already 2.1.21 September 06, 2022

@vadim-bulochnik
Copy link

@chicuongit913 it has been released already 2.1.21 September 06, 2022

Yes, but this version doesn't include commands debug support for advanced template.

@samdark
Copy link
Member

samdark commented Oct 12, 2022

It's easy to add yourself in console app bootstrap.

@vadim-bulochnik
Copy link

It's easy to add yourself in console app bootstrap.

I didn't manage to find corresponding configuration of Debug module for this.

@vadim-bulochnik
Copy link

It's easy to add yourself in console app bootstrap.

Do you mean this param?
/** * @var string the directory storing the debugger data files. This can be specified using a path alias. */ public $dataPath = '@runtime/debug';

@samdark
Copy link
Member

samdark commented Oct 12, 2022

Yes.

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

Successfully merging this pull request may close these issues.

4 participants