-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MongoDB Session class #1944
MongoDB Session class #1944
Conversation
if (YII_DEBUG) { | ||
echo $e->getMessage(); | ||
} | ||
// it is too late to log an error message here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't we log a message here? Also stacktrace should be printed additionally to the message.
Maybe a workaround like this is applicable here: https://github.com/yiisoft/yii2/blob/master/framework/mail/BaseMessage.php#L43 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. This is the part of DbSession code adapted for MongoDB.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will add a separate issue for this then. #1946 to be fixed in general, so you can merge this PR without change.
rest looks good to me :) |
$query = new Query; | ||
$row = $query->from($this->sessionCollection) | ||
->where(['id' => $oldID]) | ||
->one($this->db); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that there is better to use count()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
row is used in code afterwards. count is not sufficient.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly! My mistake :(
Add mongo db session storage.
Migrated from #1920