PHP code example of putyy / php-kv
1. Go to this page and download the library: Download putyy/php-kv 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/ */
putyy / php-kv example snippets
class UserInfo extends \Pt\Kv\RedisKv
{
// protected static $prefix = "test";
// protected static $project = "wecaht";
protected static $tail = "user_info";
}
var_dump(UserInfo::getKey(["uid"]));
var_dump(UserInfo::getHashKey(["uid"]));
var_dump(UserInfo::getListKey());
var_dump(UserInfo::getSetKey());
var_dump(UserInfo::getSSetKey());
class UserInfo extends \Pt\Kv\RedisKv
{
// protected static $prefix = "test";
protected static $project = "wecaht";
protected static $tail = "user_info";
}
var_dump(UserInfo::getKey(["uid"]));
var_dump(UserInfo::getHashKey(["uid"]));
var_dump(UserInfo::getListKey());
var_dump(UserInfo::getSetKey());
var_dump(UserInfo::getSSetKey());
class UserInfo extends \Pt\Kv\RedisKv
{
protected static $prefix = "test";
// protected static $project = "wecaht";
protected static $tail = "user_info";
}
var_dump(UserInfo::getKey(["uid"]));
var_dump(UserInfo::getHashKey(["uid"]));
var_dump(UserInfo::getListKey());
var_dump(UserInfo::getSetKey());
var_dump(UserInfo::getSSetKey());
class UserInfo extends \Pt\Kv\RedisKv
{
// protected static $prefix = "test";
// protected static $project = "wecaht";
// protected static $tail = "user_info";
}
var_dump(UserInfo::getKey(["uid"]));
var_dump(UserInfo::getHashKey(["uid"]));
var_dump(UserInfo::getListKey());
var_dump(UserInfo::getSetKey());
var_dump(UserInfo::getSSetKey());
shell
composer