From fb98119d4009f21943eb719f765e43588ee18012 Mon Sep 17 00:00:00 2001 From: Leandro Mangini Antunes Date: Thu, 27 Feb 2014 10:17:02 -0300 Subject: [PATCH] Fixed bug to employ just one session method Using the function getSession() when you add just one of the available session methods you get the following error: Warning: array_shift() expects parameter 1 to be array, string given in [...]/src/EpiSession.php on line 58. So i just added one fix that verify if EpiSession:employ() is really an array. Hope you merge this request. --- src/EpiSession.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EpiSession.php b/src/EpiSession.php index ff001da..9536a18 100644 --- a/src/EpiSession.php +++ b/src/EpiSession.php @@ -55,7 +55,7 @@ public function set($key = null, $value = null); function getSession() { $employ = EpiSession::employ(); - $class = array_shift($employ); + $class = is_array($employ) ? array_shift($employ) : $employ; if($employ && class_exists($class)) return EpiSession::getInstance($class, $employ); elseif(class_exists(EpiSession::PHP))