pskuza/php_user

Basic php user class.

v0.14 2017-06-30 10:41 UTC

This package is not auto-updated.

Last update: 2024-12-08 05:13:56 UTC


README

Build Status StyleCI

Install

php composer.phar require "pskuza/php_user"

Basic usage and what works

<?php

require('vendor/autoload.php');

use php_user\user;

//for memcached as cache
//check doctrine/cache on how to use the others
$memcached = new Memcached();
$memcached->addServer('127.0.0.1', 11211);
$cacheDriver = new \Doctrine\Common\Cache\MemcachedCache();
$cacheDriver->setMemcached($memcached);

//for mysql session storage
//check pdo for other connection handlers
$db = \ParagonIE\EasyDB\Factory::create(
    'mysql:host=127.0.0.1;dbname=notdev',
    'notroot',
    'averysecurerandompassword'
);

$session = new php_session\session($db, $cacheDriver);

session_set_save_handler($session, true);

$user = new php_user\user($session, $db);

//for more up to date usage see tests/UserMysql.php