Close the session out before erasing all the fixtures.

Not closing the session before closing fixtures results in fatal errors
when using database sessions.

Fixes #3683
This commit is contained in:
mark_story 2013-03-08 20:55:44 -05:00
parent 3b7b322d41
commit 0ba1aa6d38

View file

@ -264,9 +264,15 @@ class CakeFixtureManager {
/** /**
* Drop all fixture tables loaded by this class * Drop all fixture tables loaded by this class
* *
* This will also close the session, as failing to do so will cause
* fatal errors with database sessions.
*
* @return void * @return void
*/ */
public function shutDown() { public function shutDown() {
if (session_id()) {
session_write_close();
}
foreach ($this->_loaded as $fixture) { foreach ($this->_loaded as $fixture) {
if (!empty($fixture->created)) { if (!empty($fixture->created)) {
foreach ($fixture->created as $ds) { foreach ($fixture->created as $ds) {