diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2012-12-09 13:43:06 -0600 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2012-12-09 13:43:06 -0600 |
commit | 84284a9ccee7d5ccc658c3d1f751a5254b3b9175 (patch) | |
tree | 7188b647d6b631428e870a3975210960f05e6974 /phpBB/includes/notification | |
parent | 357a4facf6a5b026c507b54dc8c35b20207e80e0 (diff) | |
download | forums-84284a9ccee7d5ccc658c3d1f751a5254b3b9175.tar forums-84284a9ccee7d5ccc658c3d1f751a5254b3b9175.tar.gz forums-84284a9ccee7d5ccc658c3d1f751a5254b3b9175.tar.bz2 forums-84284a9ccee7d5ccc658c3d1f751a5254b3b9175.tar.xz forums-84284a9ccee7d5ccc658c3d1f751a5254b3b9175.zip |
[ticket/11103] Use scope: prototype
This lets us clean up the mess that was in load_object(), but requires
scope: prototype to be added to the service definitions for all types
or methods!
PHPBB3-11103
Diffstat (limited to 'phpBB/includes/notification')
-rw-r--r-- | phpBB/includes/notification/manager.php | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/phpBB/includes/notification/manager.php b/phpBB/includes/notification/manager.php index 4c25fa72f0..22f8f58783 100644 --- a/phpBB/includes/notification/manager.php +++ b/phpBB/includes/notification/manager.php @@ -779,24 +779,6 @@ class phpbb_notification_manager */ protected function load_object($object_name) { - // Here we cannot just use ContainerBuilder->get(name) - // The reason for this is because get handles services - // which are initialized once and shared. Here we need - // separate new objects because we pass around objects - // that store row data in each object, which would lead - // to over-writing of data if we used get() - - $parameterBag = $this->phpbb_container->getParameterBag(); - $definition = $this->phpbb_container->getDefinition($object_name); - $arguments = $this->phpbb_container->resolveServices( - $parameterBag->unescapeValue($parameterBag->resolveValue($definition->getArguments())) - ); - $r = new \ReflectionClass($parameterBag->resolveValue($definition->getClass())); - - $object = null === $r->getConstructor() ? $r->newInstance() : $r->newInstanceArgs($arguments); - - $object->set_notification_manager($this); - - return $object; + return $this->phpbb_container->get($object_name); } } |