Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

performSaveHandlerUpdate #118

Merged
merged 12 commits into from
Aug 11, 2019
Merged

performSaveHandlerUpdate #118

merged 12 commits into from
Aug 11, 2019

Conversation

dennybrandes
Copy link
Contributor

@dennybrandes dennybrandes commented Jun 30, 2019

	- check is string before calling locateRegisteredSaveHandlers()
@dennybrandes dennybrandes changed the title performSaveHandlerUpdate performSaveHandlerUpdate #117 Jun 30, 2019
@dennybrandes dennybrandes changed the title performSaveHandlerUpdate #117 performSaveHandlerUpdate Jun 30, 2019
Copy link
Member

@michalbundyra michalbundyra left a comment

Choose a reason for hiding this comment

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

@dennybrandes First I was quite confused by these changes, and then I've changed view in github pr - to splitted and ignore whitespaces and all became clear.

LGTM, just small two comments.

src/Config/SessionConfig.php Outdated Show resolved Hide resolved
}

if ((! class_exists($phpSaveHandler)
|| ! (in_array(SessionHandlerInterface::class, class_implements($phpSaveHandler)))
Copy link
Member

Choose a reason for hiding this comment

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

I see this condition was like that before, but I think it can be simplify by using is_a method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried, but unit tests are not working after change. Need to investigate more. I will do it in another MR.

Copy link
Member

Choose a reason for hiding this comment

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

Have you tried is_a($phpSaveHandler, SessionHandlerInterface::class, true) ?
I've seen you've tried instanceof but this is not gonna work.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried with is_a but that will break unit tests. Maybe we can fix it in another PR/issue.

Copy link
Member

@michalbundyra michalbundyra Jul 19, 2019

Choose a reason for hiding this comment

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

I've checked and it works for me:

            if (! class_exists($phpSaveHandler)
                || ! is_a($phpSaveHandler, SessionHandlerInterface::class, true)
            ) {

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, Thanks. Its changed

@dennybrandes
Copy link
Contributor Author

@webimpress can you check again please? :-)


if (! class_exists($phpSaveHandler)
|| ! (in_array(SessionHandlerInterface::class, class_implements($phpSaveHandler)))

Copy link
Member

Choose a reason for hiding this comment

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

Remove empty line above, please

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the empty line

$this->phpErrorMessage
implode(', ', $knownHandlers),
SessionHandlerInterface::class,
SessionHandlerInterface::class
Copy link
Member

Choose a reason for hiding this comment

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

Above line can be removed, too many params.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed it

@dennybrandes
Copy link
Contributor Author

@webimpress i added my change now to changelog, but maybe you need to change the release date there :-)

@michalbundyra michalbundyra self-assigned this Aug 10, 2019
@michalbundyra michalbundyra added this to the 2.8.6 milestone Aug 10, 2019
michalbundyra added a commit that referenced this pull request Aug 11, 2019
michalbundyra added a commit that referenced this pull request Aug 11, 2019
michalbundyra added a commit that referenced this pull request Aug 11, 2019
@michalbundyra michalbundyra merged commit 31475cb into zendframework:master Aug 11, 2019
michalbundyra added a commit that referenced this pull request Aug 11, 2019
@michalbundyra
Copy link
Member

Thanks, @dennybrandes !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants