Skip to content
Snippets Groups Projects
Commit a550906b authored by Riikka Kalliomäki's avatar Riikka Kalliomäki Committed by Demian Katz
Browse files

Return value from save callback

parent 0afe051e
No related merge requests found
......@@ -65,11 +65,12 @@ class Database extends AbstractBase
* @param string $sess_id The current session ID
* @param string $data The session data to write
*
* @return void
* @return bool
*/
public function write($sess_id, $data)
{
$this->getTable('Session')->writeSession($sess_id, $data);
return true;
}
/**
......@@ -101,4 +102,4 @@ class Database extends AbstractBase
{
$this->getTable('Session')->garbageCollect($sess_maxlifetime);
}
}
\ No newline at end of file
}
......@@ -106,7 +106,7 @@ class File extends AbstractBase
* @param string $sess_id The current session ID
* @param string $data The session data to write
*
* @return void
* @return bool
*/
public function write($sess_id, $data)
{
......@@ -115,7 +115,7 @@ class File extends AbstractBase
$return = fwrite($fp, $data);
fclose($fp);
if ($return !== false) {
return;
return true;
}
}
// If we got this far, something went wrong with the file output...
......@@ -123,6 +123,7 @@ class File extends AbstractBase
// outside of the context of exception handling, so all we can do is
// echo a message.
echo 'Cannot write session to ' . $sess_file . "\n";
return false;
}
/**
......
......@@ -95,7 +95,7 @@ class Memcache extends AbstractBase
* @param string $sess_id The current session ID
* @param string $data The session data to write
*
* @return void
* @return bool
*/
public function write($sess_id, $data)
{
......@@ -120,4 +120,4 @@ class Memcache extends AbstractBase
// Perform Memcache-specific cleanup:
return $this->getConnection()->delete("vufind_sessions/{$sess_id}");
}
}
\ No newline at end of file
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment