2017 © Pedro Peláez
 

library php-token-manager

PHP library used to secure web ressources (files, images, streams, ...) with simple token system.

image

gbrousse/php-token-manager

PHP library used to secure web ressources (files, images, streams, ...) with simple token system.

  • Wednesday, November 4, 2015
  • by gbrousse
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

php-token-manager Build Status Coverage Status

Total Downloads Latest Stable Version, (*1)

Secure your web ressources (files, images, streams, ...) with simple token system., (*2)

Installation

Install the latest version with, (*3)

$ composer require gbrousse/php-token-manager

Basic usage

get a token

<?php

use TokenManager\TokenManager; 

// Setup
$options = array(
    'dir' => 'directory/where/stock/tokens',
    'prefix' => 'prefix_of_tokens_files',
    'salt' => 'salt',
    'hash' => 'md5', // hash use to generate token
    'maxTimeout' => 7200, //max lifetime for a token
    'maxTimeout' => 600, //min lifetime for a token
); 
$TokenMgr = new TokenManager($options);

// Get token
$token = $TokenMgr->get();

If you use a single configuration for the tokens, modify the attributes of the class instead of using options array., (*4)

Verify a token

<?php

use TokenManager\TokenManager; 


// Setup
$options = array(
    'dir' => 'directory/where/stock/tokens',
    'prefix' => 'prefix_of_tokens_files',
    'salt' => 'salt',
    'hash' => 'md5', // hash use to generate token
    'maxTimeout' => 7200, //max lifetime for a token
    'maxTimeout' => 600, //min lifetime for a token
); 
$TokenMgr = new TokenManager($options);

// Verify token validity
if($TokenMgr->isValid($token)){
    // action to do if token is OK
} 

If you use a single configuration for the tokens, modify the attributes of the class instead of using options array., (*5)

Examples

About

Requirements

  • php-token-manager works with PHP 5.3 or above.

Submitting bugs and feature requests

Bugs and feature request are tracked on GitHub, (*6)

Author

Gregory Brousse - pro@gregory-brousse.fr - http://gregory-brousse.fr, (*7)

License

php-token-manager is licensed under the LGPL-3.0 License - see the LICENSE file for details, (*8)

The Versions

04/11 2015

dev-master

9999999-dev https://github.com/gbrousse/php-token-manager

PHP library used to secure web ressources (files, images, streams, ...) with simple token system.

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3

 

The Development Requires

04/11 2015

v1.0.1-rc

1.0.1.0-RC https://github.com/gbrousse/php-token-manager

PHP library used to secure web ressources (files, images, streams, ...) with simple token system.

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3

 

The Development Requires

02/11 2015

v1.0.0-rc

1.0.0.0-RC https://github.com/gbrousse/php-token-manager

PHP library used to secure web ressources (files, images, streams, ...) with simple token system.

  Sources   Download

LGPL-3.0

The Requires

  • php >=5.3

 

The Development Requires