定制 zenigata/utility 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

zenigata/utility

最新稳定版本:0.2.4

Composer 安装命令:

composer require zenigata/utility

包简介

README 文档

README

⚠️ This project is in an early development stage. Feedback and contributions are welcome!

Lightweight collection of PHP utility classes to simplify common development tasks.

The library provides small, focused helpers and traits that reduce boilerplate when working with PSR standards, configuration files, reflection, and more. Each component is designed to be framework-agnostic, minimal, and easy to integrate into any PHP project.

Requirements

Installation

composer require zenigata/utility

Overview

Awareness

Traits that provide awareness for common dependencies, allowing classes to receive services such as containers, factories, or debug state without requiring dependency injection.

Helper

Collection of small utilities that simplify common tasks such as configuration loading, caching interoperability, file generation, and more.

  • CacheHelper for interacting with both PSR-6 and PSR-16 caches with a unified API. It hides the differences between the two standards, so you can use the same methods regardless of the underlying cache implementation.
  • ConfigLoader for lazily loading PHP configuration files using generators, ensuring minimal memory usage when working with multiple config files.
  • ReflectionResolver for instantiating classes with empty constructors using PHP reflection, useful when no dependency injection container is available.
  • StubRenderer for generating files from stub templates with placeholder replacement and automatic directory creation.

Testing

Simple test doubles designed to simplify unit testing when full implementations are unnecessary.

  • FakeContainer: in-memory implementation of PSR-11 ContainerInterface, useful for testing container-aware classes and manually registering dependencies.
  • FakeLogger: lightweight PSR-3 logger that records log messages in memory, allowing tests to inspect and assert logged output.

Contributing

Pull requests are welcome! For major changes, please open an issue first to discuss what you would like to change.

Keep the implementation minimal, focused, and well-documented, making sure to update tests accordingly.

See CONTRIBUTING for more information.

License

This library is licensed under the MIT license. See LICENSE for more information.

统计信息

  • 总下载量: 21
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-22