From b081288188bb1744c9d7bd075aa5936e0ccbb9c4 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 14 Nov 2014 22:44:25 -0500 Subject: Use Pimple instead of Core\Registry and add Monolog for logging --- app/Auth/Base.php | 20 ++++++++++---------- app/Auth/RememberMe.php | 5 ++--- 2 files changed, 12 insertions(+), 13 deletions(-) (limited to 'app/Auth') diff --git a/app/Auth/Base.php b/app/Auth/Base.php index e174ff8f..e3a1c88c 100644 --- a/app/Auth/Base.php +++ b/app/Auth/Base.php @@ -3,7 +3,7 @@ namespace Auth; use Core\Tool; -use Core\Registry; +use Pimple\Container; /** * Base auth class @@ -26,34 +26,34 @@ abstract class Base protected $db; /** - * Registry instance + * Container instance * * @access protected - * @var \Core\Registry + * @var Pimple\Container */ - protected $registry; + protected $container; /** * Constructor * * @access public - * @param \Core\Registry $registry Registry instance + * @param Pimple\Container $container */ - public function __construct(Registry $registry) + public function __construct(Container $container) { - $this->registry = $registry; - $this->db = $this->registry->shared('db'); + $this->container = $container; + $this->db = $this->container['db']; } /** * Load automatically models * * @access public - * @param string $name Model name + * @param string $name Model name * @return mixed */ public function __get($name) { - return Tool::loadModel($this->registry, $name); + return Tool::loadModel($this->container, $name); } } diff --git a/app/Auth/RememberMe.php b/app/Auth/RememberMe.php index 380abbed..2585e96c 100644 --- a/app/Auth/RememberMe.php +++ b/app/Auth/RememberMe.php @@ -4,7 +4,6 @@ namespace Auth; use Core\Request; use Core\Security; -use Core\Tool; /** * RememberMe model @@ -311,7 +310,7 @@ class RememberMe extends Base $expiration, BASE_URL_DIRECTORY, null, - Tool::isHTTPS(), + Request::isHTTPS(), true ); } @@ -344,7 +343,7 @@ class RememberMe extends Base time() - 3600, BASE_URL_DIRECTORY, null, - Tool::isHTTPS(), + Request::isHTTPS(), true ); } -- cgit v1.2.3