-
Notifications
You must be signed in to change notification settings - Fork 141
Closed
Description
通过数组setTree或者文件的方式都不是很高效,建议支持可以Cache HashMap对象
SensitiveHelper.php 修改
public function getTree() {
return $this->wordTree;
}
public function setTreeByCache(HashMap $tree)
{
$this->wordTree = $tree;
return $this;
}
调用
$handle = SensitiveHelper::init();
// 写缓存
file_put_contents('tree.cache', serialize($handle->getTree()));
// 使用缓存
$handle->setTreeByCache(unserialize(file_get_contents('tree.cache')));
Metadata
Metadata
Assignees
Labels
No labels