hidehalo/emoji
Composer 安装命令:
composer require hidehalo/emoji
包简介
filtes emoji symbols for you
README 文档
README
If you want help with parse and store emoji symbol characters,you could think about use this library :)
Features
- Detected emoji symbols only
- Replace emoji symbols to other texts and turn it back
- Zero dependence
- Lightweight and fast
Install
$composer require hidehalo/emoji
Usage
Parser
require vendor/autoload.php; use Hidehalo\Emoji\Parser; $parser = new Parser(); $parser->parse($contents);
Converter
# if you want to replace those emoji symbols to ohter marked texts # and has ability to turn those back, # it has a built-in Protocol and Converter could do this # and $decoded will equals $raw,it is real very simple use Hidehalo\Emoji\Converter; $converter = new Converter($parser); $encoded = $converter->encode($raw); $decoded = $converter->decode($encoded); # filter emojis use Hidehalo\Emoji\Protocol\Filter; $clean = $converter->encode($raw, new Filter);
Custom protocol
Maybe you want to impl your custom convert protocol,you can make it through implements ProtocolInterface
use Hidehalo\Emoji\Protocol\ProtocolInterface as Protocol; use Hidehalo\Emoji\Protocol\PatternAwareTrait; class CustomProto implments Protocol { use PatternAwareTrait; protected $format = "FORMAT"; protected $pattern = "/FORMAT/"; public function encode($contents) { //your impls } public function decode($contents) { //your impls } } $customProto = new CustomProto; $customEncoded = $converter->encode($raw, $customProto); $customDecoded = $converter->decode($customDecoded, $customProto);
Testing
$./vendor/bin/phpunit
License
The MIT License (MIT). Please see License File for more information.
hidehalo/emoji 适用场景与选型建议
hidehalo/emoji 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 158.25k 次下载、GitHub Stars 达 31, 最近一次更新时间为 2016 年 09 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 hidehalo/emoji 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hidehalo/emoji 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 158.25k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 32
- 点击次数: 19
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-09-06