/interview-session-adapter

Create a session adapter to deal with PHP session

Primary LanguagePHP

Interview Session Adapter

From a given adapter type, apply it to PHP the core.

This is an interview code excercise to deal with session adapters on PHP.


The main goal here is to create multiple adapters to apply on session handler, interacting to required adapter independently after validating it existance and it sanity. The real usage it's not required here (eg: persist session data on DB/Redis, etc.) - the main goal is to write a real functional code.

Usage goal:

SessionHandler::register('files');
$_SESSION['foo'] = 'bar'; // should write on file
echo $_SESSION['foo']; // should return 'bar' from written file

// register weirdo adapter
SessionHandler::register('THIS_IS_A_DUMMY_ADAPTER'); // Exception thrown

Useful links:


©Beevo - 2019