mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-15 05:45:33 +08:00
@@ -8,6 +8,7 @@
|
||||
namespace yii\mongodb;
|
||||
|
||||
use Yii;
|
||||
use yii\base\ErrorHandler;
|
||||
use yii\base\InvalidConfigException;
|
||||
use yii\di\Instance;
|
||||
|
||||
@@ -49,6 +50,7 @@ class Session extends \yii\web\Session
|
||||
*/
|
||||
public $sessionCollection = 'session';
|
||||
|
||||
|
||||
/**
|
||||
* Initializes the Session component.
|
||||
* This method will initialize the [[db]] property to make sure it refers to a valid MongoDB connection.
|
||||
@@ -148,10 +150,11 @@ class Session extends \yii\web\Session
|
||||
['upsert' => true]
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
if (YII_DEBUG) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
// it is too late to log an error message here
|
||||
$exception = ErrorHandler::convertExceptionToString($e);
|
||||
// its too late to use Yii logging here
|
||||
error_log($exception);
|
||||
echo $exception;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user