X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FSession%2FDatabaseSessionHandler.php;h=9bb1180ec1956aa6d1d8d2127c52e1464f41aeba;hb=64847e7cc8ca8f157cae4994c71b93df28624d6f;hp=d0887d112328179229cf4fe6eed57ab0184d5101;hpb=cfa68c52b9117616fa95a4639ad74e7d220d193d;p=friendica.git diff --git a/src/Core/Session/DatabaseSessionHandler.php b/src/Core/Session/DatabaseSessionHandler.php index d0887d1123..9bb1180ec1 100644 --- a/src/Core/Session/DatabaseSessionHandler.php +++ b/src/Core/Session/DatabaseSessionHandler.php @@ -3,18 +3,15 @@ namespace Friendica\Core\Session; use Friendica\BaseObject; +use Friendica\Core\Logger; use Friendica\Core\Session; use Friendica\Database\DBA; use SessionHandlerInterface; -require_once 'boot.php'; -require_once 'include/dba.php'; -require_once 'include/text.php'; - /** * SessionHandler using database * - * @author Hypolite Petovan + * @author Hypolite Petovan */ class DatabaseSessionHandler extends BaseObject implements SessionHandlerInterface { @@ -25,7 +22,7 @@ class DatabaseSessionHandler extends BaseObject implements SessionHandlerInterfa public function read($session_id) { - if (!x($session_id)) { + if (empty($session_id)) { return ''; } @@ -34,7 +31,7 @@ class DatabaseSessionHandler extends BaseObject implements SessionHandlerInterfa Session::$exists = true; return $session['data']; } - logger("no data for session $session_id", LOGGER_TRACE); + Logger::log("no data for session $session_id", Logger::TRACE); return ''; } @@ -49,6 +46,7 @@ class DatabaseSessionHandler extends BaseObject implements SessionHandlerInterfa * @param string $session_id Session ID with format: [a-z0-9]{26} * @param string $session_data Serialized session data * @return boolean Returns false if parameters are missing, true otherwise + * @throws \Exception */ public function write($session_id, $session_data) {