millipress/millirules
Composer 安装命令:
composer require millipress/millirules
包简介
A declarative rule engine for PHP that turns complex conditional logic into readable when-then rules. Features a fluent builder API, lazy-loaded context for performance, smart operator inference, and works seamlessly in pure PHP or WordPress.
README 文档
README
A flexible, framework-agnostic rule evaluation engine for PHP 7.4+.
Overview
MilliRules is a powerful rule engine that allows you to define complex conditional logic using a fluent API. It's designed to be framework-agnostic while providing specialized support for HTTP and WordPress environments.
Features
- Fluent API: Build complex rules with an intuitive, chainable syntax
- Framework Agnostic: Core engine works with any PHP application
- Lazy-Loaded Context: On-demand loading of context data for optimal performance
- HTTP Support: Built-in conditions for request handling
- WordPress Integration: Native support for WordPress queries and context
- Extensible: Easy to add custom conditions and actions
- Flexible Naming: Use snake_case or camelCase —
when_all()andwhenAll()both work - PHP 7.4+ Compatible: Works with PHP 7.4+, PHP 8.0+ recommended
Installation
composer require millipress/millirules
Quick Start
use MilliRules\Rules; // Simple HTTP rule Rules::create('api_check') ->when() ->request_url('/api/*') ->then() ->custom( 'auth-check', function($context) { // Your action here }) ->register();
Documentation
See the full documentation for detailed guides and API reference.
License
GPL-2.0-or-later
millipress/millirules 适用场景与选型建议
millipress/millirules 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.65k 次下载、GitHub Stars 达 16, 最近一次更新时间为 2025 年 11 月 28 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 millipress/millirules 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 millipress/millirules 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4.65k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 11
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2025-11-28