marc1706/ phpbb-text-shortener
用于缩短phpBB 3.2.x版帖子文本的库
v0.3.0
2023-02-07 19:46 UTC
Requires
- php: >=7.1.3
Requires (Dev)
- phpunit/phpunit: ^7.0
- symfony/yaml: ~3.4
README
关于
phpbb-text-shortener 是一个PHP库,用于将phpBB 3.3.x版的帖子文本缩短到指定的长度。
需求
此库需要PHP 7.1.3或更高版本才能运行。
安装
建议使用composer安装此库。只需将以下片段添加到您的composer.json文件中
"require": {
"marc1706/phpbb-text-shortener": "~0.2"
},
用法
创建一个文本缩短实例
$shortener = new \Marc1706\TextShortener\Shortener();
从数据库获取帖子的数据库表示形式并将其传递给缩短器(例如,长度为200个字符)
$shortener->setText($postText)
->shortenText(200);
自动测试
该库正在使用单元测试进行测试,以防止可能出现的问题。