v2board/app/Utils/CacheKey.php

21 lines
493 B
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 = [
'EMAIL_VERIFY_CODE' => '邮箱验证吗',
'LAST_SEND_EMAIL_VERIFY_TIMESTAMP' => '最后一次发送邮箱验证码时间',
'SERVER_STAT' => '节点统计信息'
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
}