cyrill / sucre-session
0.0.3
2015-02-09 09:19 UTC
Requires
- php: >=5.4.0
Requires (Dev)
- mikey179/vfsstream: >=1.2.0
- mockery/mockery: dev-master@dev
- phpunit/phpunit: 4.5.*
This package is not auto-updated.
Last update: 2025-01-18 16:31:12 UTC
README
Sucre/Session is simple loosely-coupled PHP $_SESSION wrapper.
Requirement
- PHP 5.4 or later
Installation
Download the composer.phar
.
$ curl -s http://getcomposer.org/installer | php
Run Composer: php composer.phar require "cyrill/sucre-session"
Usage
<?php reqire __DIR__.'/composer/autoload.php'; use Sucre\Session; Session::init($regenerate = true); // start session Session::set('foo', 'bar'); // $_SESSION['foo'] = 'bar'; Session::get('foo'); // returns 'bar' Session::setFlash('foofoo', 'barbar'); Session::getFlash('foofoo'); // returns 'barbar' Session::generateId(); Session::destroy();
How to test?
Sucre\Session is tested by PHPUnit.
Run composer composer install --dev
.
All you have to do is to run phpunit
.
License
The MIT License