PHPackages                             casbin/workerman-redis-watcher - 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. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. casbin/workerman-redis-watcher

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

casbin/workerman-redis-watcher
==============================

Workerman Redis watcher for PHP-Casbin.

v1.0.0(4y ago)452Apache-2.0PHP

Since Nov 9Pushed 1y ago2 watchersCompare

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

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Workerman Redis watcher for PHP-Casbin
======================================

[](#workerman-redis-watcher-for-php-casbin)

[![Latest Stable Version](https://camo.githubusercontent.com/ef38eec65602abf03277fad164c23ed3f681900b0563c29b8c761790040e71b9/68747470733a2f2f706f7365722e707567782e6f72672f63617362696e2f776f726b65726d616e2d72656469732d776174636865722f762f737461626c65)](https://packagist.org/packages/casbin/workerman-redis-watcher)[![Total Downloads](https://camo.githubusercontent.com/6d6c7f6ccb3fdfc71498a140625f9c8b0b009c86a58c99b612b282fa6a0f9af4/68747470733a2f2f706f7365722e707567782e6f72672f63617362696e2f776f726b65726d616e2d72656469732d776174636865722f646f776e6c6f616473)](https://packagist.org/packages/casbin/workerman-redis-watcher)[![License](https://camo.githubusercontent.com/aa38798ce4c9935dd2290d67134b0293ce74135a0aeee20799386cb9fafd687d/68747470733a2f2f706f7365722e707567782e6f72672f63617362696e2f776f726b65726d616e2d72656469732d776174636865722f6c6963656e7365)](https://packagist.org/packages/casbin/workerman-redis-watcher)

[Workerman Redis](https://github.com/walkor/redis) watcher for [PHP-Casbin](https://github.com/php-casbin/php-casbin), [Casbin](https://casbin.org/) is a powerful and efficient open-source access control library.

### Installation

[](#installation)

Via [Composer](https://getcomposer.org/).

```
composer require casbin/workerman-redis-watcher

```

### Usage

[](#usage)

```
require dirname(__FILE__) . '/../vendor/autoload.php';

use Casbin\Enforcer;
use CasbinWatcher\WorkermanRedis\Watcher;
use Workerman\Worker;

$worker = new Worker();
$worker->count = 2;
$worker->onWorkerStart = function () {

    // Initialize the Watcher.
    $watcher = new Watcher([
        'host' => '127.0.0.1',
        'password' => '',
        'port' => 6379,
        'database' => 0,
    ]);

    // Initialize the Enforcer.
    $enforcer = new Enforcer("path/to/model.conf", "path/to/policy.csv");

    $enforcer->setWatcher($watcher);

    // Set callback, sets the callback function that the watcher will call,
    // When the policy in DB has been changed by other instances.
    // A classic callback is $enforcer->loadPolicy().
    $watcher->setUpdateCallback(function () use ($enforcer) {
        echo "Now should reload all policies." . PHP_EOL;
        $enforcer->loadPolicy();
    });
};

Worker::runAll();
```

### Getting Help

[](#getting-help)

- [php-casbin](https://github.com/php-casbin/php-casbin)

### License

[](#license)

This project is licensed under the [Apache 2.0 license](LICENSE).

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance30

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

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

1643d ago

### Community

Maintainers

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

---

Top Contributors

[![leeqvip](https://avatars.githubusercontent.com/u/35752209?v=4)](https://github.com/leeqvip "leeqvip (3 commits)")[![Dobmod](https://avatars.githubusercontent.com/u/33273950?v=4)](https://github.com/Dobmod "Dobmod (1 commits)")[![Tinywan](https://avatars.githubusercontent.com/u/14959876?v=4)](https://github.com/Tinywan "Tinywan (1 commits)")

---

Tags

aclpermissionrbacwatcherworkermancasbin

### Embed Badge

![Health badge](/badges/casbin-workerman-redis-watcher/health.svg)

```
[![Health](https://phpackages.com/badges/casbin-workerman-redis-watcher/health.svg)](https://phpackages.com/packages/casbin-workerman-redis-watcher)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[casbin/casbin

a powerful and efficient open-source access control library for php projects.

1.3k1.4M54](/packages/casbin-casbin)[casbin/laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.

324339.9k4](/packages/casbin-laravel-authz)[casbin/webman-permission

webman casbin permission plugin

523.4k2](/packages/casbin-webman-permission)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[casbin/think-authz

An authorization library that supports access control models like ACL, RBAC, ABAC for ThinkPHP.

27918.5k6](/packages/casbin-think-authz)

PHPackages © 2026

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