Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[+BUGFIX] Fixed shareByDefault check

Changed check for $this->shareByDefault() in
Zend\ServiceManager\ServiceManager::get() to allow shared
instances that are explicitly defined as shared when shareByDefault is
set to false.

Resolves #3408
  • Loading branch information...
commit 8c7fab92c14d268207fad8b404c5ff438e39a250 1 parent 4661be5
Axel H. tux-rampage authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  library/Zend/ServiceManager/ServiceManager.php
3  library/Zend/ServiceManager/ServiceManager.php
View
@@ -453,7 +453,8 @@ public function get($name, $usePeeringServiceManagers = true)
));
}
- if ($this->shareByDefault() && (!isset($this->shared[$cName]) || $this->shared[$cName] === true)) {
+ if ((isset($this->shared[$cName]) && $this->shared[$cName] === true)
+ || (!isset($this->shared[$cName]) && $this->shareByDefault())) {
$this->instances[$cName] = $instance;
}
Please sign in to comment.
Something went wrong with that request. Please try again.