PHPackages                             xibosignage/support - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. xibosignage/support

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

xibosignage/support
===================

Support functions used throughout the Xibo Signage Platform

v0.4(2mo ago)13.6k↑67.9%6[1 PRs](https://github.com/xibosignage/support/pulls)MITPHPPHP &gt;=8.1CI failing

Since Jan 25Pushed 2mo ago4 watchersCompare

[ Source](https://github.com/xibosignage/support)[ Packagist](https://packagist.org/packages/xibosignage/support)[ Docs](https://xibosignage.com)[ RSS](/packages/xibosignage-support/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (4)Dependencies (19)Versions (8)Used By (0)

Xibo Support Library
====================

[](#xibo-support-library)

A PHP utility library providing foundational support classes for the [Xibo Digital Signage Platform](https://xibosignage.com). Consumed by Xibo CMS and related services as a Composer package.

Modules
-------

[](#modules)

### Sanitizer

[](#sanitizer)

Type-safe, validated input access. Pass an associative array of raw input (e.g. from a HTTP request) and retrieve values as the expected type:

```
$san = (new RespectSanitizer())->setCollection($request->getParams());

$id      = $san->getInt('id');
$name    = $san->getString('name');
$body    = $san->getHtml('body');       // Symfony HtmlSanitizer — preserves safe tags
$enabled = $san->getCheckbox('active');
$date    = $san->getDate('from', ['dateFormat' => 'Y-m-d']);
```

All getters accept an `$options` array for defaults, custom Respect\\Validation rules, and configurable exception throwing (`throw`, `throwClass`, `throwMessage`).

**Note:** `getString` uses `strip_tags` (removes all tags, does not encode entities). `getHtml` uses Symfony HtmlSanitizer and is the correct choice when HTML content must be preserved safely.

### Validator

[](#validator)

Standalone boolean validation using Respect\\Validation, separate from sanitization:

```
$v = new RespectValidator();
$v->int('42');            // true
$v->double('3.14');       // true
$v->string('hello', ['Length' => [1, 100]]); // true
```

### Exception

[](#exception)

Seventeen domain exceptions extending `GeneralException`, each with a fixed HTTP status code and a `generateHttpResponse(ResponseInterface)` method that writes a JSON error body:

ExceptionStatus`AuthenticationRequiredException`401`AccessDeniedException`403`NotFoundException`404`DuplicateEntityException`409`InvalidArgumentException`422Everything else500### Nonce

[](#nonce)

CSRF protection built on bcrypt-hashed nonces stored via `StorageServiceInterface`:

```
// Create and persist
$nonce = $nonceService->create($entityId, 'upload', 300);
$nonceService->persist($nonce);
$token = $nonce->getCompleteNonce(); // "plaintextNonce:::lookup"

// Verify later
$verified = $nonceService->getSplitVerified($token, 'upload');
```

`CsrfMiddleware` is a PSR-7 middleware that validates `X-XSRF-TOKEN` headers (or a body parameter) on POST/PUT/DELETE requests against a session-stored token.

### Database

[](#database)

`PdoStorageService` is a PDO/MySQL wrapper with named connection pooling, automatic transaction management on writes, reconnect handling (MySQL error 2006), and deadlock retry logic (errors 1213/1205, max 2 retries):

```
$db->insert('INSERT INTO t (name) VALUES (:name)', [':name' => 'x']);
$db->commitIfNecessary();

$rows = $db->select('SELECT * FROM t WHERE id = :id', [':id' => 1]);

// Deadlock-safe write with automatic retry
$db->updateWithDeadlockLoop('UPDATE t SET val = :v WHERE id = :id', [...]);
```

### Monolog

[](#monolog)

- **`RocketChatHandler`** — posts log records to a Rocket.Chat inbound webhook. Colour-coded by level (red ≥ ERROR, yellow = WARNING, green ≥ INFO, grey = DEBUG).
- **`ProxyIpProcessor`** — adds the real client IP to each log record by inspecting `X_FORWARDED_FOR`, `HTTP_X_FORWARDED_FOR`, `CLIENT_IP`, and `REMOTE_ADDR` in that order.

Installation
------------

[](#installation)

```
composer require xibosignage/support
```

Optional dependencies (required for specific modules):

```
composer require nesbot/carbon          # RespectSanitizer::getDate()
composer require respect/validation     # RespectSanitizer and RespectValidator
composer require monolog/monolog        # RocketChatHandler and ProxyIpProcessor
```

Development
-----------

[](#development)

```
composer install
composer test          # run PHPUnit test suite
composer test:coverage # run with Clover coverage report (requires Xdebug)
composer lint          # PHPCS code style check
```

###  Health Score

48

—

FairBetter than 93% of packages

Maintenance86

Actively maintained with recent releases

Popularity27

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.9% 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

Every ~517 days

Total

4

Last Release

67d ago

### Community

Maintainers

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

---

Top Contributors

[![dasgarner](https://avatars.githubusercontent.com/u/10400067?v=4)](https://github.com/dasgarner "dasgarner (59 commits)")[![PeterMis](https://avatars.githubusercontent.com/u/12148978?v=4)](https://github.com/PeterMis "PeterMis (13 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/xibosignage-support/health.svg)

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

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[illuminate/broadcasting

The Illuminate Broadcasting package.

7127.2M208](/packages/illuminate-broadcasting)[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)

PHPackages © 2026

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