Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[VarDumper] Improve dump of AMQP* Object#21557

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:2.8fromlyrixx:caster-amqp
Feb 11, 2017

Conversation

@lyrixx
Copy link
Member

@lyrixxlyrixx commentedFeb 7, 2017
edited
Loading

QA
Branch?2.8
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

The release ofhttps://github.com/pdezwart/php-amqp/ 1.7.0alpha1
changed internally the handling of AMQP* object. So now when dumping
using var_dump(), many information are available. So many information
are displayed twice. This commit fixes this issue and keeps displaying basic
information for older versions of the lib.

Reference:


screenshot4

screenshot5

Shine-neko reacted with thumbs up emojijjsaunier reacted with hooray emoji
@stof
Copy link
Member

stof commentedFeb 7, 2017

shouldn't we rather avoid all the useless info instead of overwriting the existing ones ?

@nicolas-grekasnicolas-grekas added this to the2.8 milestoneFeb 7, 2017
@lyrixx
Copy link
MemberAuthor

shouldn't we rather avoid all the useless info instead of overwriting the existing ones ?

The things is: it's hard to know when property X or property Y has been added in the extension. So If we want to avoid overwriting, we should check for each property if it has been defined before.

WDYT?

@stof
Copy link
Member

stof commentedFeb 8, 2017

Well, you are switching the prefix globally anyway, which implies that they all changed together.

@lyrixx
Copy link
MemberAuthor

Indeed. But anyway$array += [] does not overwrite the initial value. So IMHO, it's not an issue. I just specifically, overwrite some properties, to enchance the display.

But just to be sure I understand, you propose something like that:

// Recent version of the extension already expose internal propertiesif (isset($a["\x00AMQPConnection\x00login"])) {$a += [                Caster::PREFIX_VIRTUAL.'isConnected' =>$c->isConnected(),            ];return$a;        }$prefix = Caster::PREFIX_VIRTUAL;// BC layer in the amqp libif (method_exists($c,'getReadTimeout')) {$timeout =$c->getReadTimeout();        }else {$timeout =$c->getTimeout();        }$a +=array($prefix.'isConnected' =>$c->isConnected(),$prefix.'login' =>$c->getLogin(),$prefix.'password' =>$c->getPassword(),$prefix.'host' =>$c->getHost(),$prefix.'vhost' =>$c->getVhost(),$prefix.'port' =>$c->getPort(),$prefix.'read_timeout' =>$timeout,        );return$a;

@lyrixx
Copy link
MemberAuthor

@stof I updated my PR according to your comments.

The release ofhttps://github.com/pdezwart/php-amqp/ 1.7.0alpha1changed internally the handlings of AMQP* object. So now when dumpingusing var_dump(), many information are availables. So many informationare displayed twice. This commit fixes this issue and keeps displaying basicinformation for older version of the lib.Reference:*https://pecl.php.net/package-info.php?package=amqp&version=1.7.0alpha1*php-amqp/php-amqp@314afbc (and next commits)
@stof
Copy link
Member

stof commentedFeb 8, 2017

👍

Btw, don't we need to update some tests ?

@lyrixx
Copy link
MemberAuthor

Btw, don't we need to update some tests ?

This part is not tested... :/

@nicolas-grekas
Copy link
Member

Thank you@lyrixx.

@nicolas-grekasnicolas-grekas merged commitc553352 intosymfony:2.8Feb 11, 2017
nicolas-grekas added a commit that referenced this pull requestFeb 11, 2017
This PR was merged into the 2.8 branch.Discussion----------[VarDumper] Improve dump of AMQP* Object| Q             | A| ------------- | ---| Branch?       | 2.8| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | ----The release ofhttps://github.com/pdezwart/php-amqp/ 1.7.0alpha1changed internally the handling of AMQP* object. So now when dumpingusing var_dump(), many information are available. So many informationare displayed twice. This commit fixes this issue and keeps displaying basicinformation for older versions of the lib.Reference:*https://pecl.php.net/package-info.php?package=amqp&version=1.7.0alpha1*php-amqp/php-amqp@314afbc (and next commits)---![screenshot4](https://cloud.githubusercontent.com/assets/408368/22700884/53ad5f68-ed5c-11e6-986b-bfdf91640060.png)![screenshot5](https://cloud.githubusercontent.com/assets/408368/22700890/580353c4-ed5c-11e6-8fc8-c101115b7001.png)Commits-------c553352 [VarDumper] Improve dump of AMQP* Object
@nicolas-grekasnicolas-grekas deleted the caster-amqp branchFebruary 11, 2017 11:33
@fabpotfabpot mentioned this pull requestFeb 17, 2017
@fabpotfabpot mentioned this pull requestMar 6, 2017
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

2.8

Development

Successfully merging this pull request may close these issues.

4 participants

@lyrixx@stof@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp