@@ -31,7 +31,7 @@ static function createConnectionURI($connectionDetails = array()) {
3131 $ seedList = implode (', ' , array_map (function ($ host ) use ($ port ) {
3232 return "$ host: $ port " ;
3333 }, is_array ($ host ) ? $ host : explode (', ' , $ host )));
34-
34+
3535 $ connectionURI = "mongodb:// "
3636 .((!empty ($ connectionDetails ['username ' ]) && !empty ($ connectionDetails ['password ' ]))
3737 ? "$ {connectionDetails['username ' ]}: $ {connectionDetails['password ' ]}@ "
@@ -69,14 +69,9 @@ public function get($type, $key)
6969 if (isset ($ document ['expire_at ' ])) {
7070 $ expireAt = $ document ['expire_at ' ];
7171 if ($ expireAt <= time ()) {
72- $ status = $ collection ->remove (array (
72+ $ collection ->remove (array (
7373 'session_id ' => $ key
7474 ));
75- if (!$ status ) {
76- SimpleSAML_Logger::error ("Failed to remove expired document $ type. $ key " );
77- } else {
78- SimpleSAML_Logger::info ("Removed expired document: $ type: $ key " );
79- }
8075
8176 return NULL ;
8277 }
@@ -113,25 +108,15 @@ public function set($type, $key, $value, $expire = null)
113108 if ($ document ) {
114109 $ document ['payload ' ] = serialize ($ value );
115110 $ document ['expire_at ' ] = $ expire ;
116- $ status = $ collection ->update (array (
111+ $ collection ->update (array (
117112 'session_id ' => $ key
118113 ), $ document );
119- if (!$ status ) {
120- SimpleSAML_Logger::error ("Failed to update document $ type. $ key with value: " . var_export ($ value , 1 ));
121- } else {
122- SimpleSAML_Logger::info ("Updated document: $ type: $ key " );
123- }
124114 } else {
125- $ status = $ collection ->insert (array (
115+ $ collection ->insert (array (
126116 'session_id ' => $ key ,
127117 'payload ' => serialize ($ value ),
128118 'expire_at ' => $ expire
129119 ));
130- if (!$ status ) {
131- SimpleSAML_Logger::error ("Failed to create document $ type. $ key with value: " . var_export ($ value , 1 ));
132- } else {
133- SimpleSAML_Logger::info ("Created document: $ type: $ key " );
134- }
135120 }
136121
137122 return $ expire ;
@@ -149,14 +134,9 @@ public function delete($type, $key)
149134 assert ('is_string($key) ' );
150135
151136 $ collection = $ this ->db ->{$ type };
152- $ status = $ collection ->remove (array (
137+ $ collection ->remove (array (
153138 'session_id ' => $ key
154139 ));
155- if (!$ status ) {
156- SimpleSAML_Logger::error ("Failed to delete document: $ type. $ key " );
157- } else {
158- SimpleSAML_Logger::info ("Deleted document: $ type: $ key " );
159- }
160140 }
161141
162142 /**
0 commit comments