2017 © Pedro Peláez
 

library raw-session

RawSession provides application session service, including flash messages and is used by RawPHP framework and other applications.

image

rawphp/raw-session

RawSession provides application session service, including flash messages and is used by RawPHP framework and other applications.

  • Wednesday, December 24, 2014
  • by rawphp
  • Repository
  • 1 Watchers
  • 0 Stars
  • 320 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

RawSession - A Simple Session Wrapper Class for PHP Applications

Build Status Coverage Status, (*1)

Latest Stable Version Total Downloads Latest Unstable Version License, (*2)

Package Features

  • Easily manage sessions with start(), close(), destroy() and recreate()
  • Manage data persistence across requests with add(), get(), remove()

Installation

Composer

RawSession is available via Composer/Packagist., (*3)

Add "rawphp/raw-session": "0.*@dev" to the require block in your composer.json and then run composer install., (*4)

{
        "require": {
            "rawphp/raw-session": "0.*@dev"
        }
}

You can also simply run the following from the command line:, (*5)

composer require rawphp/raw-session "0.*@dev"

Tarball

Alternatively, just copy the contents of the RawSession folder into somewhere that's in your PHP include_path setting. If you don't speak git or just want a tarball, click the 'zip' button at the top of the page in GitHub., (*6)

Basic Usage

<?php

use RawPHP\RawSession\Session;

// optional configuration
$config = array(
    'auto_start' => FALSE,  // should the session be started automatically
    'strict'     => TRUE,   // throw exceptions if there are problems with the session
);

// create a new session instance
$session = new Session( );

// initialise
$session->init( $config );

// start session
$session->start( );

// get session ID
$id     = $session->getID( );

// get session status
$status = $session->getStatus( );

// add a value to the session
$session->add( 'user_id', 1 );

// get a value from the session
$userID = $session->get( 'user_id' );

// remove value from the session
$session->remove( 'user_id' );

// destroy the session
$session->destroy( );

// destroy and start a new session
$session->recreate( );

License

This package is licensed under the MIT. Read LICENSE for information on the software availability and distribution., (*7)

Contributing

Please submit bug reports, suggestions and pull requests to the GitHub issue tracker., (*8)

Changelog

22-09-2014

  • Tested with PHP 5.3.

20-09-2014

  • Replaced php array configuration with yaml

18-09-2014

  • Updated to work with the latest rawphp/rawbase package.

17-09-2014

  • Updated to work with the latest rawphp/rawbase package.

14-09-2014

  • Fixed bug in Session.php.

13-09-2014

  • Added the hook system

11-09-2014

  • Initial Code Commit

The Versions

24/12 2014

dev-master

9999999-dev http://rawphp.org

RawSession provides application session service, including flash messages and is used by RawPHP framework and other applications.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Tom Kaczocha

session