Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

ServiceManager - fix AbstractFactories performance and service waiting #5237

Merged
merged 1 commit into from
Oct 23, 2013
Merged

ServiceManager - fix AbstractFactories performance and service waiting #5237

merged 1 commit into from
Oct 23, 2013

Conversation

turrsis
Copy link
Contributor

@turrsis turrsis commented Oct 7, 2013

When ServiceManager get service, it call canCreateFromAbstractFactory 3 times and check all abstract factories 3 times. And after this check all abstract factories for creating service. In total : 4 cycles for all abstract factories and 4 call abstractFactory::canCreateServiceWithName for each factory.

#4285 is litle wrong - see ServiceManagerTest::testWaitingAbstractFactory(). Second call of $this->serviceManager->has('SomethingThatCanBeCreated') was failed, but the service already exists.

@turrsis
Copy link
Contributor Author

turrsis commented Oct 7, 2013

Who can say - why tests for php 5.3.3 is failed?

@Ocramius
Copy link
Member

@turrsis don't worry about it - that's php-cs-fixer that stopped supporting PHP 5.3.3

@@ -700,35 +686,34 @@ public function has($name, $checkAbstractFactories = true, $usePeeringServiceMan
* @param string $rName
* @return bool
*/
public function canCreateFromAbstractFactory($cName, $rName)
protected function canCreateFromAbstractFactory($cName, $rName)
Copy link
Member

Choose a reason for hiding this comment

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

This is a BC break.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what is the sence of publshing this function?
maybe mark this is deprecated?

Copy link
Member

Choose a reason for hiding this comment

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

@turrsis maybe it was wrong as public in first place, but we can't change it in 2.x anyways

weierophinney added a commit that referenced this pull request Oct 23, 2013
…ractFactories(4285)

ServiceManager - fix AbstractFactories performance and service waiting
weierophinney added a commit that referenced this pull request Oct 23, 2013
- Return from conditional
- Promote else
weierophinney added a commit that referenced this pull request Oct 23, 2013
@weierophinney weierophinney merged commit 8a7390d into zendframework:develop Oct 23, 2013
@ghost ghost assigned weierophinney Oct 23, 2013
weierophinney added a commit that referenced this pull request Nov 1, 2013
weierophinney added a commit to zendframework/zend-servicemanager that referenced this pull request May 15, 2015
…ix/serviceManager-trollAbstractFactories(4285)

ServiceManager - fix AbstractFactories performance and service waiting
weierophinney added a commit to zendframework/zend-servicemanager that referenced this pull request May 15, 2015
- Return from conditional
- Promote else
weierophinney added a commit to zendframework/zend-servicemanager that referenced this pull request May 15, 2015
weierophinney added a commit to zendframework/zend-servicemanager that referenced this pull request May 15, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants