PHPackages                             decisionrules/decisionrules-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. decisionrules/decisionrules-php

ActiveLibrary[API Development](/categories/api)

decisionrules/decisionrules-php
===============================

Simple library for connecting your app to your DecisionRules.io

v3.0.0(3y ago)140MITPHPPHP &gt;=5.3.0

Since Dec 20Pushed 3y ago1 watchersCompare

[ Source](https://github.com/decisionrules/decisionrules-php)[ Packagist](https://packagist.org/packages/decisionrules/decisionrules-php)[ Docs](https://github.com/decisionrules/decisionrules-php)[ RSS](/packages/decisionrules-decisionrules-php/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (4)Used By (0)

Summary
=======

[](#summary)

[Decisionrules.io](https://decisionrules.io/) library that allows you to integrate DecisionRules Solver and Management API to you application as easily as possible. SDK allow you to solve all rule types that are available, CRUD operations on all rule types, rules status management and rule tags management.

> VERSION 3 IS NEW MAJOR VERSION OF THIS SDK AND IT IS STRONGLY RECOMMENDED, DUE TO DEPRECATION OF OLDER VERSIONS.

Installation
============

[](#installation)

You can simply integrate [SDK](https://packagist.org/packages/decisionrules/decisionrules-php#dev-main) to your project via NPM package manager.

Defining Custom domain
======================

[](#defining-custom-domain)

Custom domain is special class that is designed for those who uses DecisionRules in private cloud or as on-premise. Class takes up to 3 arguments.

Domain argument is name of desired domain, protocol is HTTP or HTTPS and port is TCP/IP port.

If port is not defined in the class constructor it is set to default value by protocol value, 80 for HTTP and 443 for HTTPS.

```
$customDomain = new  CustomDomain("localhost", Protocols::HTTP, 8080);
```

Using Solver API
================

[](#using-solver-api)

Solver class takes up to 2 arguments that are `api key`(can be generated on dashboard), `custom domain` object. Class exposes two methods: solveRule and solveRuleFlow.

```
use DecisionRules\Solver;
use DecisionRules\Enums\SolverStrategy;

public function awesomeSolver(){
	$ruleId = "MY_RULE_ID";
	$solver = new Solver($apiKey);
	$request = (object) array('data'=> array('input_attribute'=> 'value'));
	return $solver->solveRule($ruleId, $request, SolverStrategy::STANDARD);
}
```

Using Management API
====================

[](#using-management-api)

Management class takes on argument, management api key. Class exposes number of methods listed below.

- getRule - get rule by itemId and version\*
- createRule - create rule by spaceId and ruleData
- updateRule - updates rule by itemId, newRuleData and version\*
- deleteRule - deletes rule by itemId and version
- getSpaceItems - get space items that belongs to management api key
- getRuleFlow - get rule by itemId and version\*
- createRuleFlow - create ruleflow in space that belongs to management api key
- updateRuleFlow - updates ruleflowby itemId, newRuleflowData and version\*
- deleteRuleFlow - deletes ruleflow by itemId and version
- exportRuleFlow - exports ruleflow by itemId and version\*
- importRuleFlow - import ruleflow as a new ruleflow or new version of existing ruleflow or override existing ruleflow.
- changeRuleStatus - changes rule status
- changeRuleFlowStatus - changes ruleflow status
- getRulesByTags - gets rule by tag.
- updateTags - update tags on rule or ruleflow
- deleteTags - delete tags on rule or ruleflow

> \* = optional argument

Example usage
-------------

[](#example-usage)

```
use DecisionRules\Management;

public  manageRules(){
	$managementKey = "MY_MANAGEMENT_KEY";
	$manager = new Management($managementKey);
	return $manager->getRule($ruleId, 1);
}
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1442d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b75c8575e79a80a6b34d8e7ce29c34f2ceb9f78eb7aca3bc6a70772891cde754?d=identicon)[DecisionRules](/maintainers/DecisionRules)

---

Tags

ruleenginerule-engineDecisionRules

### Embed Badge

![Health badge](/badges/decisionrules-decisionrules-php/health.svg)

```
[![Health](https://phpackages.com/badges/decisionrules-decisionrules-php/health.svg)](https://phpackages.com/packages/decisionrules-decisionrules-php)
```

###  Alternatives

[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[facebook/php-business-sdk

PHP SDK for Facebook Business

90821.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

74513.7M114](/packages/meilisearch-meilisearch-php)[google/common-protos

Google API Common Protos for PHP

173103.7M50](/packages/google-common-protos)[hubspot/api-client

Hubspot API client

23914.2M16](/packages/hubspot-api-client)[nicoswd/php-rule-parser

Rule Engine - Rule Parser &amp; Evaluator

13078.6k7](/packages/nicoswd-php-rule-parser)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
