This repository was archived by the owner on Jan 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
configuration. Change-Id: Ibd9309bf42c8992376849a1c5bbae05cd82e4c13
Change-Id: I568ec78485724be3ec68c0b754d9af95b3ea1b03
Change-Id: I071cf7b8e41d3f7f06f942650dc6f8a3d2215cba
method. Change-Id: I4a3bb387e4f63c5aa70519923ad3680c8ae5e5b0
method. Change-Id: Idf4802f8735a2333d927f5c6989e124c048e7854
Change-Id: I382bc52191f3202b47ecd7910a2ffb4108c7e78e
Change-Id: Ib47b1604675e5beef8945b57df9dfb28ddef3ffd
Change-Id: Ifb6241ff0d3799dbefdd9bd160e7f14c3ab68bf8
Change-Id: Ibd0e492df076b801cb91078753bfe40bf77f63c0
Change-Id: Ia85eab01106afa54e8156dadb9fece15d73e9ae8
Minor improvements in abstract factory methods. Change-Id: Ic6d1de0efede8780ff6d50126b98b50dee5fa5fb
Change-Id: Ib79a1e12bf93f53f44765ac2add526c3ccecfa6f
Change-Id: I32e556441e7ba46367b1a1a7485ab00e0cdcd6df
Change-Id: I93522febd9f4c61286a2bce36bf3a1333a54e1ae
fix php docblock : boolean should be bool Conflicts: library/Zend/Filter/File/RenameUpload.php library/Zend/Mvc/Controller/Plugin/FilePostRedirectGet.php library/Zend/Mvc/Controller/Plugin/FlashMessenger.php library/Zend/Mvc/Controller/Plugin/PostRedirectGet.php library/Zend/Mvc/Router/SimpleRouteStack.php
- linefeed
fix (bool) casting : add space and use (bool) instead of (boolean) to cast
@Ocramius ping me when this is no longer a WIP. :) |
Forward port zendframework#4117 Conflicts: tests/ZendTest/InputFilter/FactoryTest.php
Allow to change option creations for plugin manager
Allow to change option creations for plugin manager
@weierophinney I don't think this is WIP. I'm only concerned about the overhead of the additional call. I think we should inline some code like |
Closing. Noticed that it was PR-ed against master. Opened #4145 instead |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been working on this concept for some time, but this is basically a cleaned up version of #2995
Why do we need this?
The idea is to be able to build delegates of any existing service. This can be used to build "decorators" for service instantiation and for proxying.
Delegation
Imagine that you have a
DbConnection
and aLoggedDbConnection
object. ALoggedDbConnection
wraps around a "real"DbConnection
instance like following, but provides additional API that sends queries to a logger:Currently, our problem is that such a wrapper requires us to completely re-define the factory that instantiates
DbConnection
. There's no way to re-use logic from such a factory. We have to rewrite it and be aware of its internal logic:Proxying
We can proxy any service (with the assumption that we know its class name or implemented interface) and make it "lazy", so that its dependencies don't get instantiated when we request them. This allows us to build lightweight containers, as explained in https://github.com/Ocramius/ProxyManager/blob/master/docs/lazy-loading-value-holder.md. Also, we don't have to worry about how the original service is instantiated, since the original factory is still existing.
Example
In the following example, I've simply replaced the original service (instance of
stdClass
) with a new one that contains the original service in propertytab
:Implementation flaws
doCreate
, since I splittedcreate
to allow this kind of behaviordoCreate
is public, since I cannot use a closure and call->bindTo($this)
in PHP 5.3