mirror of
https://github.com/ProxyPanel/ProxyPanel.git
synced 2026-04-11 23:19:05 +00:00
Changed 系统参数将使用redis Cache储存,减少查表
This commit is contained in:
@@ -3,16 +3,29 @@
|
||||
namespace Tests\Unit;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Redis;
|
||||
|
||||
class ExampleTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testBasicTest()
|
||||
{
|
||||
$this->assertTrue(true);
|
||||
}
|
||||
class ExampleTest extends TestCase {
|
||||
/**
|
||||
* A basic test example.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testBasicTest() {
|
||||
try{
|
||||
//create redis instance
|
||||
$redis = new Redis();
|
||||
//connect with server and port
|
||||
$redis->connect('localhost', 6379);
|
||||
//set value
|
||||
$redis->set('website', 'www.phpflow.com');
|
||||
//get value
|
||||
$website = $redis->get('website');
|
||||
//print www.phpflow.com
|
||||
echo $website;
|
||||
|
||||
}catch(Exception $ex){
|
||||
echo $ex->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user