<?php
/*
* Redis Cache
*/
class cache
{
private $redis = null;//only this class
private $mysql = null;
public function __construct($host, $port, $username, $password, $database)
{
if (!class_exists('Redis'))
return false;
try
{
$this->redis = new Redis();
$this->redis->connect($host, $port, '0.2');//timeout 200ms
$this->redis->auth("{$username}-{$password}-{$database}");
}
catch (RedisException $error)
{
return false;
//var_dump($error);
}
}
public function get($key)
{
return $this->redis->get($key);
}
public function set($key, $value, $express=0)
{
if ($express)
return $this->redis->setex($key, $express, $value);
else
return $this->redis->set($key, $value);
}
public function delete($key)
{
return $this->redis->delete($key);
}
}
95Shop可以免费下载使用,是一款仿醉品商城网店系统,内置SEO优化,具有模块丰富、管理简洁直观,操作易用等特点,系统功能完整,运行速度较快,采用ASP.NET(C#)技术开发,配合SQL Serve2000数据库存储数据,运行环境为微软ASP.NET 2.0。95Shop官方网站定期开发新功能和维护升级。可以放心使用! 安装运行方法 1、下载软件压缩包; 2、将下载的软件压缩包解压缩,得到we
0
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号