v2board/app/Utils/CacheKey.php

31 lines
1.1 KiB
PHP
Raw Normal View History

2020-01-11 13:36:52 +08:00
<?php
namespace App\Utils;
class CacheKey
{
2020-03-13 14:32:36 +08:00
CONST KEYS = [
2020-11-19 21:21:21 +08:00
'EMAIL_VERIFY_CODE' => '邮箱验证码',
'LAST_SEND_EMAIL_VERIFY_TIMESTAMP' => '最后一次发送邮箱验证码时间',
2020-07-03 15:24:10 +08:00
'SERVER_V2RAY_ONLINE_USER' => '节点在线用户',
'SERVER_V2RAY_LAST_CHECK_AT' => '节点最后检查时间',
2021-03-24 15:04:09 +08:00
'SERVER_V2RAY_LAST_PUSH_AT' => '节点最后推送时间',
2020-06-11 21:50:18 +08:00
'SERVER_TROJAN_ONLINE_USER' => 'trojan节点在线用户',
2020-08-13 21:36:59 +08:00
'SERVER_TROJAN_LAST_CHECK_AT' => 'trojan节点最后检查时间',
2021-03-24 15:04:09 +08:00
'SERVER_TROJAN_LAST_PUSH_AT' => 'trojan节点最后推送时间',
2020-10-04 14:21:09 +08:00
'SERVER_SHADOWSOCKS_ONLINE_USER' => 'ss节点在线用户',
'SERVER_SHADOWSOCKS_LAST_CHECK_AT' => 'ss节点最后检查时间',
2021-03-24 15:04:09 +08:00
'SERVER_SHADOWSOCKS_LAST_PUSH_AT' => 'ss节点最后推送时间',
2020-09-23 23:15:43 +08:00
'TEMP_TOKEN' => '临时令牌',
'LAST_SEND_EMAIL_REMIND_TRAFFIC'
2020-03-13 14:32:36 +08:00
];
2020-01-11 13:36:52 +08:00
2020-03-13 14:37:28 +08:00
public static function get(string $key, $uniqueValue)
2020-03-13 14:32:36 +08:00
{
if (!in_array($key, array_keys(self::KEYS))) {
abort(500, 'key is not in cache key list');
}
return $key . '_' . $uniqueValue;
}
2020-01-11 13:36:52 +08:00
}