PHP code example of pskuza / php_user
1. Go to this page and download the library: Download pskuza/php_user library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
pskuza / php_user example snippets
sh
php composer.phar
php
ser\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