2017 © Pedro Peláez
 

library session

A simple key-value storage class

image

vakata/session

A simple key-value storage class

  • Thursday, March 1, 2018
  • by vakata
  • Repository
  • 1 Watchers
  • 0 Stars
  • 599 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 13 % Grown

The README.md

session

Latest Version on Packagist ![Software License][ico-license], (*1)

A simple key-value storage class. used for configurations and extended in vakata/session., (*2)

Install

Via Composer, (*3)

``` bash $ composer require vakata/session, (*4)


## Usage Using the `$_SESSION` superglobal is perfectly fine and works well with this class. ``` php $session = new \vakata\session\Session(); // autostarts session and applies useful defaults $session->get('value'); // same as $_SESSION['value']; $session->set('val.ue', 2); // same as $_SESSION['val'] = [ 'ue' => 1 ]; $session->del('value'); // same as unset($_SESSION['value']); // optionally sessions can be stored in a database $sessionDB = new \vakata\session\Session( true, // autostart new \vakata\sessions\handler\SessionDatabase( new \vakata\database\DB('mysqli://user:pass@host/database'), 'table' ) ); // optionally sessions can be stored in memcached / filecache / database $sessionDB = new \vakata\session\Session( true, // autostart new \vakata\sessions\handler\SessionCache( new \vakata\cache\Memcache(), 'namespace' // this allows easy clearing ) );

For more on setting, getting and deleting values read here: https://github.com/vakata/kvstore, (*5)

For more on the database class read here: https://github.com/vakata/database, (*6)

For more on the memcached class read here: https://github.com/vakata/cache, (*7)

Testing

bash $ composer test, (*8)

Contributing

Please see CONTRIBUTING for details., (*9)

Security

If you discover any security related issues, please email github@vakata.com instead of using the issue tracker., (*10)

Credits

License

The MIT License (MIT). Please see License File for more information., (*11)

The Versions

04/12 2015