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

Commit

Permalink
Merge branch 'hotfix/3'
Browse files Browse the repository at this point in the history
Close #3
  • Loading branch information
mwillbanks committed Jul 23, 2015
2 parents 86957ac + 550ceca commit 0e7061c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 53 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,8 @@ All notable changes to this project will be documented in this file, in reverse

### Fixed

- [#3](https://github.com/zendframework/zend-session/pull/3) Utilize
SaveHandlerInterface vs. our own.

- [#2](https://github.com/zendframework/zend-session/pull/2) detect session
exists by use of *PHP_SESSION_ACTIVE*
48 changes: 3 additions & 45 deletions src/SaveHandler/SaveHandlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,55 +9,13 @@

namespace Zend\Session\SaveHandler;

use SessionHandlerInterface;

/**
* SaveHandler Interface
*
* @see http://php.net/session_set_save_handler
*/
interface SaveHandlerInterface
interface SaveHandlerInterface extends SessionHandlerInterface
{
/**
* Open Session - retrieve resources
*
* @param string $savePath
* @param string $name
*/
public function open($savePath, $name);

/**
* Close Session - free resources
*
*/
public function close();

/**
* Read session data
*
* @param string $id
*/
public function read($id);

/**
* Write Session - commit data to resource
*
* @param string $id
* @param mixed $data
*/
public function write($id, $data);

/**
* Destroy Session - remove data from resource for
* given session id
*
* @param string $id
*/
public function destroy($id);

/**
* Garbage Collection - remove old session data older
* than $maxlifetime (in seconds)
*
* @param int $maxlifetime
*/
public function gc($maxlifetime);
}
9 changes: 1 addition & 8 deletions src/SessionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -443,13 +443,6 @@ protected function setSessionCookieLifetime($ttl)
*/
protected function registerSaveHandler(SaveHandler\SaveHandlerInterface $saveHandler)
{
return session_set_save_handler(
[$saveHandler, 'open'],
[$saveHandler, 'close'],
[$saveHandler, 'read'],
[$saveHandler, 'write'],
[$saveHandler, 'destroy'],
[$saveHandler, 'gc']
);
return session_set_save_handler($saveHandler);
}
}

0 comments on commit 0e7061c

Please sign in to comment.