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

Make setSaveHandler() only callable once #179

Open
joshua-bn opened this issue Jan 5, 2021 · 0 comments
Open

Make setSaveHandler() only callable once #179

joshua-bn opened this issue Jan 5, 2021 · 0 comments

Comments

@joshua-bn
Copy link

Running EcomDev_PhpUnit with E_ALL on PHP 7.4 (modified version of OpenMage) and my tests are complaining with this error:

Error: Warning: session_set_save_handler(): Cannot change save handler when headers already sent  in app/code/community/Cm/RedisSession/Model/Session.php on line 51

That's setSaveHandler() being called multiple times. I changed this locally by just putting the call in the constructor. Since it never gets created outside of the getResourceSingleton() calls, this works. Since this repo doesn't have control over those areas, it could instead set a property and check that: private $isSessionSaveHandlerSet = false and then check if it is true/false in the setSaveHandler() method. If it is already set, do nothing.

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

No branches or pull requests

1 participant