-
Notifications
You must be signed in to change notification settings - Fork 338
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
Session is started by this module even in CLI mode #518
Comments
ping @Danielss89 |
@ojhaujjwal what happens in that case? failure? error? |
Generally, there is no error but I don't see any point in starting session in CLI mode. We may check if request is HttpRequest or CliRequest. public function isEmpty()
{
$request = $this->getServiceManager()->get('Request');
if (!$request instanceof HttpRequest) {
return true;
}
// previously the session was started here in CLI
if ($this->getStorage()->isEmpty()) {
return true;
}
$identity = $this->read();
if ($identity === null) {
$this->clear();
return true;
}
return false;
} |
@ojhaujjwal yes, but I'm wondering if this shouldn't simply go back to |
@Ocramius Yes. I don't know how but I think it will more easier if this is handled by |
@Danielss89 this is essentially a duplicate of #513 I've run into this issue myself with ZfcUser 1.x and I worked around it by creating a separate bootstrap file to use when running console commands with this addition above
|
ZfcUser\Authentication\Storage\Db
starts session whenisEmpty
method is called n session is not started. The problem appears when the current request is not HttpRequest (i.e. CliRequest). Is this an intended behaviour?The text was updated successfully, but these errors were encountered: