From 925b0ba2e56117e3bbe2947d7938ed35815efa1a Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 16 Aug 2014 13:59:37 -0700 Subject: Authentication backends refactoring --- app/Core/Tool.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/Core/Tool.php') diff --git a/app/Core/Tool.php b/app/Core/Tool.php index 1a2e9904..85b684e2 100644 --- a/app/Core/Tool.php +++ b/app/Core/Tool.php @@ -34,8 +34,11 @@ class Tool public static function loadModel(Registry $registry, $name) { - $class = '\Model\\'.ucfirst($name); - $registry->$name = new $class($registry); + if (! isset($registry->$name)) { + $class = '\Model\\'.ucfirst($name); + $registry->$name = new $class($registry); + } + return $registry->shared($name); } } -- cgit v1.2.3