You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
756 B
39 lines
756 B
<?php
|
|
namespace App\Libs;
|
|
|
|
use SSDB;
|
|
use SimpleSSDB;
|
|
class SsdbClient
|
|
{
|
|
public $SSDB;
|
|
|
|
//public function __construct()
|
|
//{
|
|
// $host = env('SSDB_HOST');
|
|
// $port = env('SSDB_PORT');
|
|
//
|
|
// try{
|
|
// $SSDB = new SimpleSSDB($host, $port);
|
|
// $SSDB->auth(env('SSDB_AUTH'));
|
|
// }catch(\Exception $e){
|
|
// dd($e);
|
|
// }
|
|
//}
|
|
|
|
|
|
|
|
public static function client($host=null,$port=null)
|
|
{
|
|
$host = $host??env('SSDB_HOST');
|
|
$port = $port??env('SSDB_PORT');
|
|
|
|
try{
|
|
$SSDB = new SimpleSSDB($host, $port);
|
|
$SSDB->auth(env('SSDB_AUTH'));
|
|
}catch(\Exception $e){
|
|
dd($e);
|
|
}
|
|
|
|
return $SSDB;
|
|
}
|
|
}
|