Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

Create a session adapter to deal with PHP session

Notifications You must be signed in to change notification settings

joubertredrat-tests/beevo-dev-test

 
 

Repository files navigation

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

About

Create a session adapter to deal with PHP session

Resources

Stars

Watchers

Forks

Languages

  • PHP 100.0%