PHPackages                             gthouret/bff - 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. gthouret/bff

ActiveLibrary

gthouret/bff
============

BFF: Fast and light PHP framework for getting things done

30[4 issues](https://github.com/gthouret/bff/issues)[1 PRs](https://github.com/gthouret/bff/pulls)PHP

Since Apr 12Pushed 3y ago1 watchersCompare

[ Source](https://github.com/gthouret/bff)[ Packagist](https://packagist.org/packages/gthouret/bff)[ RSS](/packages/gthouret-bff/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

bff
===

[](#bff)

###### A Light and fast PHP framework for getting things done

[](#a-light-and-fast-php-framework-for-getting-things-done)

**Config** - Config management for multiple environments, production is base environment and other environments can override or add to production's config values

**Db** - Create custom MySQL connections via MysqliFactory and PdoFactory by passing your config reference or get a default connection via `Service::pdo()` or `Service::mysqli()`

**Memcache** - Interact with Memcache a store

**TaggedMemcache** - Get and Set with tag sets; Invalidate caches by invalidating tags

**Queue** - Queue implementation (currently only a Redis backend implementation)

**Registry** - A global, labelled, singleton object store

**Service** - Instantiates singleton services into the registry on demand; Simple clean interface for accessing from anywhere

**Export** - Export data (log, csv) to files via Redis queues (Diferent exports are defined in the exporters array)

**Logger** - Wraps Export to format log messages and send to the right exporter

**Text** - Useful text functions

**Time** - Useful Time constants and functions

Example Usage
-------------

[](#example-usage)

### Set an item to cache

[](#set-an-item-to-cache)

```
use BFF\Service;

$user = [
    'name' => 'Joe Bloggs',
    'email' => 'joe@example.com'
];

$cache = Service::cache();
$cache->set('user-joebloggs', $user, Time::ONE_HOUR);
```

### Load custom app services

[](#load-custom-app-services)

```
use BFF\Registry;
use BFF\Service as BffService;

namespace App;

class Service extends BffService {
    const MYSERVICEA = 'myservicea';
    const MYSERVICEB = 'myserviceb';

    public function myservicea() : MyServiceA
    {
        if (!Registry::isset(Service::MYSERVICEA)) {
            $obj = new MyServiceA();
            Registry::set(Service::MYSERVICEA, $obj);
            return $obj;
        } else {
            return Registry::get(static::MYSERVICEA);
        }
    }

    public function myserviceb() : MyServiceB
    {
        if (!Registry::isset(Service::MYSERVICEB)) {
            $obj = new MyServiceB();
            Registry::set(Service::MYSERVICEB, $obj);
            return $obj;
        } else {
            return Registry::get(static::MYSERVICEB);
        }
    }
}
```

```
namespace App;

$myservicea = Service::myservicea();
$myservicea()->someAction();
```

###  Health Score

11

—

LowBetter than 0% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 Bus Factor1

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

### Community

Maintainers

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

---

Top Contributors

[![gthouret](https://avatars.githubusercontent.com/u/4047869?v=4)](https://github.com/gthouret "gthouret (37 commits)")

---

Tags

fastlightphpphp-frameworkunopinionated

### Embed Badge

![Health badge](/badges/gthouret-bff/health.svg)

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

PHPackages © 2026

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