vdhicts/read-time
Composer 安装命令:
composer require vdhicts/read-time
包简介
Laravel package to determine the time required to read a text
README 文档
README
Laravel package to determine the read time of a text.
Requirements
This package requires at least Laravel 11+ and PHP 8.2 or newer.
Installation
You can install the package via composer:
composer require vdhicts/read-time
Usage
This package can be used multiple ways. When the content contains HTML, the HTML is stripped before calculating the read time.
Helper
The helper returns the amount of minutes (as integer) it should take for the reader to read the text.
read_time($text); read_time($text, $wordPerMinute);
Blade
The blade directive returns the amount of minutes (as integer) it should take for the reader to read the text.
@readTime($text) @readTime($text, $wordPerMinute)
Direct usage
The class offers a bit more functionality.
use Vdhicts\ReadTime\ReadTime; $readTime = new ReadTime($text); // OR $readTime = new ReadTime($text, $wordsPerMinute); $readTime->minutes(); // the amount of minutes (as integer) it should take to read $readTime->seconds(); // the amount of seconds (as integer) it should take to read $readTime->wordCount(); // the amount of words (as integer) found in the text
Custom configuration
Publish the configuration with:
php artisan vendor:publish --provider="Vdhicts\ReadTime\ReadTimeServiceProvider"
Tests
Unit tests are available in the tests folder. Run with:
composer test
When you want a code coverage report which will be generated in the build/report folder. Run with:
composer test-coverage
Contribution
Any contribution is welcome, but it should meet the PSR-12 standard and please create one pull request per feature/bug. In exchange, you will be credited as contributor on this page.
Security
If you discover any security related issues in this or other packages of Vdhicts, please email security@vdhicts.nl instead of using the issue tracker.
Support
If you encounter a problem with this package or has a question about it, feel free to open an issue on GitHub.
License
This package is open-sourced software licensed under the MIT license.
About Vdhicts
Vdhicts is the name of my personal company for which I work as freelancer. Vdhicts develops and implements IT solutions for businesses and educational institutions.
vdhicts/read-time 适用场景与选型建议
vdhicts/read-time 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 19.31k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2022 年 02 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「time」 「read」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 vdhicts/read-time 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vdhicts/read-time 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 vdhicts/read-time 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Tools to convert between .NET and PHP date formats
The NzoFileDownloaderBundle is a Symfony Bundle used to Download all types of files from servers and Web applications safely and with ease. You can also read/show the file content in the Web Browser.
PHP Library to read and write spreadsheet files (CSV, XLSX and ODS), in a fast and scalable way
Adds the EDTF data type to Wikibase
使用简单实用的语义化接口快速读写Excel文件
Date component is a set of methods to help with the manipulation of dates.
统计信息
- 总下载量: 19.31k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-02-06