PHP code example of wudege / token-assistant
1. Go to this page and download the library: Download wudege/token-assistant 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/ */
wudege / token-assistant example snippets
$config = array(
'host' => '127.0.0.1',
'port' => 6379,
'database' => 0,
);
$userId = 9527;
$client = new \Predis\Client($config);
$dispatcher = new \TokenAssistant\TokenDispatcher($client);
$token = $dispatcher->assign($userId);