manialib/formatting
Composer 安装命令:
composer require manialib/formatting
包简介
Manipulate styles in Maniaplanet strings.
README 文档
README
Manialib\Formatting is a PHP package for manipulating styles in Maniaplanet strings.
Learn more about Maniaplanet formatting characters on the wiki.
Beta
This is a work in progress. As long as we don't release a stable version, we might break stuff at any point. If this is a problem, feel free to open an issue and we'll try to help.
Features
- Strip styles from strings: links, colors, etc.
- Convert strings to other formats: HTML for now
Find out more in the change log.
Requirements
- PHP 8.1+
Installation
{
"require": {
"manialib/formatting": "^4.0"
}
}
Usage
Modify styles of a string:
Note the String fluent interface which allows to chain method calls
use Manialib\Formatting\ManiaplanetString; $nickname = '$l[https://github.com/manialib/formatting]$cfeg$fff๐u1 $666ツ$l'; $string = new ManiaplanetString($nickname); echo $string->stripColors()->stripLinks();
Will output:
g๐u1 ツ
Convert a string to HTML:
use Manialib\Formatting\ManiaplanetString; $string = new ManiaplanetString('$cfeg$fff๐u1 $666ツ'); echo $string->toHtml();
Will output:
<span style="color:#cfe;">g</span><span style="color:#fff;">๐u1 </span><span style="color:#666;">ツ</span>
Everything you need for using this should be documented in Manialib/Formatting/StringInterface.
Tests
$ php vendor/bin/phpunit
$ php vendor/bin/phpcs --standard=PSR2 src
Development guidelines
We follow best practices from the amazing PHP ecosystem. Warm kudos to Symfony, The PHP League, the PHP subreddit and many more for inspiration and challenging ideas.
- We adhere to the best-practices put forward by PHP The Right Way
- We comply to the standards of the PHP-FIG
- We distribute code via Packagist and Composer
- We manage version numbers with Semantic Versioning
- We keep a changelog
- We use
Manialib\as our PHP vendor namespace - We use
manialib/as our Packagist vendor namespace - We'll (try to) make documentation & tests :)
manialib/formatting 适用场景与选型建议
manialib/formatting 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10.64k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2014 年 11 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「ManiaPlanet」 「ShootMania」 「TrackMania」 「ManiaLib」 「Ubisoft」 「Nadeo」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 manialib/formatting 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 manialib/formatting 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 manialib/formatting 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
SDK for the ManiaPlanet Web Services API.
Plugin pack for manialive server controler
Generate a result page for TA cups
Fluent object interface for writing XML.
Autoloader, Compiler and a few Maniascript libraries to ease the developement of Maniascript applications.
Fluent object interface for writing Manialink
统计信息
- 总下载量: 10.64k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 22
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-11-12