clippy/std
Composer 安装命令:
composer require clippy/std
包简介
TODO
README 文档
README
Clippy is a CLI framework for scripting in PHP -- i.e. creating short, task-specific, standalone commands. It is heavily based on mnapoli/silly.
Scripting is a different domain than, say, full business applications.
- In some ways, scripting is more modest: a full business application may have a wide variety of entities, screens, commands, and authors. Dependencies and conventions among these various components must be reconciled. By contrast, a script is generally focused on smaller tasks and has wider latitude to mix and match libraries and conventions.
- In other ways, scripting is more stringent: the naming/structure/metadata should be quite thin to allow quick improvisation, and it should be easy+safely to frequently call out to other CLI commands. By contrast, a full business app has more value built-in -- so it needs more structure to differentiate its internal components, and it doesn't need to call-out as frequently.
Note: To simplify the workflows for dependency management, the examples use pogo. pogo should be installed in the PATH.
Alternatively, you can rework the examples - instead, create a new composer package for each script and run composer require <package>:<version> has needed.
Example
#!/usr/bin/env pogo <?php #!require clippy/std: ~0.2.0 namespace Clippy; $c = clippy()->register(plugins()); $c['app']->main('yourName [--lang=]', function ($yourName, $lang, $io) { $messages = [ 'de' => "Hallo, <comment>$yourName</comment>!", 'en' => "Hello, <comment>$yourName</comment>!", 'es' => "!Hola <comment>$yourName</comment>!", 'fr' => "Salut, <comment>$yourName</comment>!", ]; $io->writeln($messages[$lang] ?? $messages['en']); });
Which one would execute as
$ ./greeter.php world
Hello, world!
$ ./greeter.php Alice --lang=fr
Salut, Alice!
For more discussion and improvement of the example, see docs/tutorial.md.
Documenation:
- Technical synopsis - Summary of key libraries, services, structure
- Tutorial - Walk through a few examples
- Plugins - Plugin mechanism
- Reference - List of functions and services in the standard edition
clippy/std 适用场景与选型建议
clippy/std 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 96.35k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 12 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 clippy/std 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 clippy/std 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 96.35k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 9
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-12-08