Download the PHP package axguowen/redis-client without Composer

On this page you can find all versions of the php package axguowen/redis-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package redis-client

PHP Redis 客户端管理器

一个简单的 PHP Redis 客户端连接管理工具

安装

composer require axguowen/redis-client

使用

配置连接

use \axguowen\facade\RedisClient;

// Redis服务器配置信息设置(全局有效)
RedisClient::setConfig([
    // 默认连接本机
    'default' => 'localhost',
    // 连接配置
    'connections' => [
        // 本机连接参数
        'localhost' => [
            // 主机
            'host'              => '127.0.0.1',
            // 端口
            'port'              => 6379,
            // 密码
            'password'          => '',
            // 数据库索引
            'select'            => 0,
            // 超时时间
            'timeout'           => 0,
            // 是否是长链接
            'persistent'        => false,
            // 部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
            'deploy'            => 0,
            // 读写是否分离 主从式有效
            'rw_separate'       => false,
            // 读写分离后 主服务器数量
            'master_num'        => 1,
            // 指定从服务器序号
            'slave_no'          => '',
            // 有数据写入后自动读取主服务器
            'read_master'       => false,
            // 是否需要断线重连
            'break_reconnect'   => false,
            // 断线标识字符串
            'break_match_str'   => [],
            // 键名构建器类
            'builder'           => '',
        ],
        // 其它主机连接参数
        'other' => [
            // 主机
            'host' => '192.168.0.2',
            // 端口
            'port' => 6379,
            // 密码
            'password' => 'XXXXXX',
            // 数据库索引
            'select' => 0,
            // 超时时间
            'timeout' => 1
        ],
    ]
]);

简单使用

use \axguowen\facade\RedisClient;
// 默认本机
$ping = RedisClient::ping();
// 连接其它服务器
$pingOther = RedisClient::connect('other')->ping();

// set方法
$setKey = RedisClient::set('mykey', 'myvalue');
// 连接其它服务器
$setKeyOther = RedisClient::connect('other')->set('mykey', 'myvalue');

使用键名构造器

use \axguowen\facade\RedisClient;

$mykey = RedisClient::key('mykey');

// 设置值
$mykey->set('myvalue');
$value = $mykey->get();
var_dump($value);

// 将当前值改成其它值
$mykey->set('othervalue');
$value = $mykey->get();
var_dump($value);

All versions of redis-client with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
ext-redis Version *
psr/log Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package axguowen/redis-client contains the following files

Loading the files please wait ...