millipress/millirules
最新稳定版本:v0.6.0
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
- snake_case Convention: Consistent naming throughout the API
- PHP 7.4+ Compatible: Works with modern PHP versions
Installation
composer require millipress/millirules
Quick Start
use MilliRules\Rules; // Simple HTTP rule Rules::create('api_check') ->when()->request_url('/api/*') ->then()->custom( 'run_check', function($context) { // Your action here }) ->register();
Documentation
See the /docs directory for detailed documentation.
License
GPL-2.0-or-later
统计信息
- 总下载量: 498
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2025-11-28