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

#17676 - making the proxy instantiation compatible with ProxyManager 2.x by detecting proxy features#17919

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

Conversation

@Ocramius
Copy link
Contributor

QA
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#17676
LicenseMIT
Doc PR

Note: tests don't pass because the test asset being used does not respect the return type hints (PHP7) required for ProxyManager v2. Not sure if I should just hack around it, and use the PHP7 hints.

@OcramiusOcramiusforce-pushed thefix/#17676-proxy-manager-2-compatibility-in-container-dumper branch from0809f53 tof3d41d3CompareFebruary 24, 2016 18:44
@Ocramius
Copy link
ContributorAuthor

Failures seem to be unrelated with this diff.

$methodName ='get'.Container::camelize($id).'Service';
$proxyClass =$this->getProxyClassName($definition);

$generatedClass =$this->generateProxyClass($definition);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

this method internally now callsgetProxyClassName as well (like two lines above). This should be avoided.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Aware: my initial implementation was using aclass_exists() check, but that leads to compatibility hell later on (if I move the class, which is really internal anyway).

Since this is at dump-time only, it is not a big problem anyway. No I/O is happening due to this repeated call.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

just pass$proxyClass as optional argument togenerateProxyClass. its a private method anyway.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Not sure I follow...getProxyCode will still be called from an external scope

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It's not about getProxyCode but aboutgetProxyClassName being called twice.

@stof
Copy link
Member

I suggest applying this as a bugfix in older branches, as ProxyManager 2 is the only version being officially compatible with PHP 7 AFAIK

@Ocramius
Copy link
ContributorAuthor

1.x works with PHP7, but doesn't provide scalar- and return- type-hinting support, heh...

@stof
Copy link
Member

OK, then that's OK to include this feature in Symfony 3.1. It will be an incentive for people to upgrade their projects to Symfony 3 if they want to use lazy services together with PHP 7 features

@stof
Copy link
Member

@Ocramius please also update the composer.json of the component

@Ocramius
Copy link
ContributorAuthor

Thanks for the reminder!

@fabpot
Copy link
Member

Is it really a feature? Looks a bug fix to me. And in the linked ticket, some people seems to have this issue on 3.0 as well.

@Ocramius
Copy link
ContributorAuthor

@fabpot this is 100% a bugfix

@stof
Copy link
Member

Well, people have this issue because they install ProxyManager v2, while Symfony 3.0 does not support it. The question is whether this support is considered as a bug fix (and so should go in 2.3) or as a new feature (and so should stay in 3.1).

@xabbuh
Copy link
Member

If otherwise they can't use scalar type hints on PHP 7, it's a bugfix to me.

@robfrawley
Copy link
Contributor

Please merge this as a bug fix in the currently supported releases.

@stof,@fabpot: While I'm aware only 0.5 and 1.0 Proxy Manager releases are endorsed in the documentation, I assert support for 2.x should be treated as a bugfix as the previous releases never reached parity with many PHP 5.6.x/7.x language features (for example, variadics, scalar types hints, etc) while the 2.0 release is receiving these improvements (can you correct me if I am wrong in this regard@Ocramius).

Also, the 2.x code base is beautiful --- much appreciation for the amazing work by@Ocramius and other contributors to ProxyManager/zend-code/etc!

@fabpot
Copy link
Member

So, as 2.3 supports PHP 7, this is definitely a bug fix.@Ocramius Would you mind creating a PR on Symfony 2.3?

@Ocramius
Copy link
ContributorAuthor

@fabpot hmm, this code hasn't changed since the precambrian eon: can it be cherry-picked?

@Ocramius
Copy link
ContributorAuthor

Hmmm, no, never mind. Cherry-picking leads to conflicts. I'll try sending a new PR for 2.3 only

@fabpot
Copy link
Member

Resolving the conflicts should be relatively easy. I've done most of the work but then, you need to update the tests, and I gave up :(

@Ocramius
Copy link
ContributorAuthor

Yeah, all those horrible$container = $this due to PHP 5.3 compat :-\

@Ocramius
Copy link
ContributorAuthor

PR for 2.3 @#17947

fabpot added a commit that referenced this pull requestFeb 28, 2016
This PR was merged into the 2.3 branch.Discussion----------Fix -#17676 (backport#17919 to 2.3)| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#17676| License       | MIT| Doc PR        |This is a backport of#17919Commits-------0c6400a#17676 - making the proxy instantiation compatible with ProxyManager 2.x by detecting proxy features
@fabpot
Copy link
Member

Thank you@Ocramius.

fabpot added a commit that referenced this pull requestFeb 28, 2016
…oxyManager 2.x by detecting proxy features (Ocramius)This PR was submitted for the master branch but it was merged into the 3.0 branch instead (closes#17919).Discussion----------#17676 - making the proxy instantiation compatible with ProxyManager 2.x by detecting proxy features| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#17676| License       | MIT| Doc PR        |Note: tests don't pass because the test asset being used does not respect the return type hints (PHP7) required for ProxyManager v2. Not sure if I should just hack around it, and use the PHP7 hints.Commits-------a8f1a10#17676 - making the proxy instantiation compatible with ProxyManager 2.x by detecting proxy features
@fabpotfabpot closed thisFeb 28, 2016
This was referencedFeb 28, 2016
@robfrawley
Copy link
Contributor

Works perfect on Symfony 2.8.3 and 3.0.3 against PHP 7.0.3, including a few services that previously could not be lazy loaded against Proxy Manager <2.0.0 due to variadic methods and other new syntax challenges. As always, thanks for the amazing work@Ocramius and@fabpot and crazy quick turnaround on this!

holtkamp reacted with hooray emoji

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

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@Ocramius@stof@fabpot@xabbuh@robfrawley@Tobion@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp