Browse files

Further asset manager fixes.

  • Loading branch information...
1 parent f201ce8 commit b54f4deb7e3ec2d3bbb8a04888e7111d99047d22 @trq trq committed Feb 7, 2013
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/Proem/Service/AssetManager.php
View
8 lib/Proem/Service/AssetManager.php
@@ -134,6 +134,12 @@ public function attach($name, $resolver = null, $single = false, $override = fal
$this->setParam('assets', $name, $name, $override);
}
+ // If we have a singleton, make sure it is only in
+ // the *instances* array and not within *aliases*.
+ if ($single && isset($this->aliases[$name])) {
+ unset($this->aliases[$name]);
+ }
+
return $this;
}
@@ -227,10 +233,12 @@ public function resolve($name, $params = [])
// Attempt to resolve by name.
$object = $this->autoResolve($name, $params);
$this->setParam('instances', $name, $object, true);
+ return $this->resolve($name);
} catch (\LogicException $e) {
try {
$object = $this->autoResolve($this->instances[$name], $params);
$this->setParam('instances', $name, $object, true);
+ return $this->resolve($name);
} catch (\LogicException $e) {
throw $e;
}

0 comments on commit b54f4de

Please sign in to comment.