sevenecks/string-utils
Composer 安装命令:
composer require sevenecks/string-utils
包简介
A collection of string utilities for PHP, loosely based on the LambdaMOO $string_utils package.
README 文档
README
A set of common string functions, loosely based on LambdaMOO $string_utils. It uses sevenecks/ansi to add color where applicable though you can pass your own colorizer in via dependency injection.
Installation
Via Composer
composer require sevenecks/string-utils
Usage
require_once __DIR__ . '/../vendor/autoload.php'; use SevenEcks\StringUtils\StringUtils; use SevenEcks\Ansi\Colorize; $su = new StringUtils; $test_string = 'This is a test'; // echo out test string $su->tell($test_string); $su->setLineLength(10); // echo out a string, ignores line len $su->tell($su->colorize->red("This is a test of a long red string!")); $su->setSplitMidWord(true); // echo using line length and color color $su->tell($su->colorize->red($su->wordWrap("This is a test of a long blue word wrapped string which breaks mid word!"))); $su->setSplitMidWord(false); // echo using length and color color $su->tell($su->colorize->blue($su->wordWrap("This is a test of a long blue word wrapped string which breaks at a word!"))); // set the line length break string to br instead of default of \n $su->setBreakString("<br />"); $su->tell($su->colorize->red($su->wordWrap("This is a test of a long red string!"))); $su->tell("Not colored."); // mass colorize a string wrapped by line $su->tell_lines($su->massColor($su->lineWrap("This is a test of a long line wrapped red strings!"), 'blue')); // break at specific linelen $su->tell_lines($su->lineWrap('123456789123456789123456789')); // formatting of left, right, and center $su->tell($su->left("TEST", 10) . $su->left("TEST1", 10)); $su->tell($su->right("TEST", 10) . $su->right("TEST1", 10)); $su->tell($su->center("TEST", 10) . $su->center("TEST1", 10)); // update line len $su->setLineLength(180); // center $su->tell($su->center("CENTER NO ARGS")); $su->tell($su->center("CENTER W/ ARGS", 30)); // alerts crits and warnings for debugging $su->alert("This is an alert!"); $su->warning("This is a warning"); $su->critical("This is critical!"); // using tostr to combine args into a string $su->tell($su->tostr($su->center("THIS EXAMPLE", 10), ' ', $su->center("USES TOSTR", 10), ' ', 1,2,3)); $su->tell($su->tostr('1',2,'3','asdf',['a', 'b' => 'c', 1]));
Change Log
Please see Change Log for more information.
License
The MIT License (MIT). Please see License File for more information.
sevenecks/string-utils 适用场景与选型建议
sevenecks/string-utils 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 6.6k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2017 年 12 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cli」 「console」 「command line」 「shell」 「string」 「formatting」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 sevenecks/string-utils 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sevenecks/string-utils 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 sevenecks/string-utils 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This class provides you with an easy-to-use interface to progress bars.
A Wrapper for exec and it's results
Symfony bundle to monitor and execute commands
A Laravel package to retrieve data from Google Search Console
Additional artisan commands for Laravel
Shell command module for PHP.
统计信息
- 总下载量: 6.6k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 17
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-12-12
