Skip to content
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

Merged
merged 1 commit into from
Jan 13, 2014
Merged

Conversation

klimov-paul
Copy link
Member

Add mongo db session storage.

Migrated from #1920

if (YII_DEBUG) {
echo $e->getMessage();
}
// it is too late to log an error message here
Copy link
Member

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 ?

Copy link
Member Author

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.

Copy link
Member

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.

@cebe
Copy link
Member

cebe commented Jan 13, 2014

rest looks good to me :)

$query = new Query;
$row = $query->from($this->sessionCollection)
->where(['id' => $oldID])
->one($this->db);

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()

Copy link
Member

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.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly! My mistake :(

klimov-paul added a commit that referenced this pull request Jan 13, 2014
@klimov-paul klimov-paul merged commit bf537af into yiisoft:master Jan 13, 2014
@ghost ghost assigned klimov-paul Jan 13, 2014
@klimov-paul klimov-paul deleted the mongodb-session branch June 17, 2014 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants