chromabits/nucleus
最新稳定版本:v0.4.9
Composer 安装命令:
composer require chromabits/nucleus
包简介
Some core PHP utilities
README 文档
README
DEPRECATED: This package is no longer maintained. It has been replaced by https://github.com/sellerlabs/nucleus.
Nucleus

A standalone PHP utility library. Inspired heavily by similar projects like libphutil. Currently used in personal and work projects. Designed to make working wth PHP a little bit nicer and predictable.
Requires HHVM 3.6 or PHP 5.6
Goal
- Provide a consistent API for common operations.
- Gather the most useful bits and snippets under one library.
- Strong emphasis on strict type checking (e.g.
float !== integer). - Functional programming ideas and concepts are welcome (I'm new to this).
Core pieces
While Nucleus has a bunch of random crap in it, there are some useful classes worth mentioning:
- Spec: A multi-purpose constraint checking framework that can be easily extended.
- Validator: Built upon Spec, the Validator component provides an interface for generating UX-friendly messages for a SpecResult.
- Impersonator: A constructor dependency automocker. Useful for testing classes that have many external dependencies and projects that heavily use container dependency injection.
- View: An set of classes and utilities for generating clean and safe HTML/Text. It sort of looks like XHP without the XML or de-sugarized React.js code.
- Std, Arr, and others: We all know the PHP standard library is a mess. There are many failed attempts to fix this out there. This is another one of those attempts. I've created a few classes with a bunch of static aliases that attempt to improve upon it. Yes, there is a performance penalty (validation + at least one more function call), but it makes many operations more predictable and safer.
Building documentation
cd docs
pip install -r requirements.txt
make html
Contributing
Pull requests are accepted on GitHub. Bug fixes and small improvements are welcome. Big ideas will be reviewed and discussed.
Code Standard: PSR-2 with some additions. See https://github.com/chromabits/standard for more details.
Security
If you discover any security related issues, please email ed+security@chromabits.com instead of using the issue tracker.
License
This code is licensed under the MIT license. See LICENSE for more information.
chromabits/nucleus 适用场景与选型建议
chromabits/nucleus 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 20.1k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2015 年 01 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 chromabits/nucleus 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 chromabits/nucleus 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 20.1k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 6
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-12