PHPackages                             ihor/ouchbase - 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. [Database &amp; ORM](/categories/database)
4. /
5. ihor/ouchbase

ActiveLibrary[Database &amp; ORM](/categories/database)

ihor/ouchbase
=============

Object key/value mapper (OKVM) for Couchbase written in Zephir

4152C

Since Jun 15Pushed 11y ago2 watchersCompare

[ Source](https://github.com/Playsino/Ouchbase)[ Packagist](https://packagist.org/packages/ihor/ouchbase)[ RSS](/packages/ihor-ouchbase/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Ouchbase
========

[](#ouchbase)

Ouchbase is an object key/value mapper (OKVM) for Couchbase. It is written in [Zephir](https://github.com/phalcon/zephir) which allows you to write high performance PHP extensions without the headaches and timewastage of a C development cycle.

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

[](#installation)

Just clone Ouchbase repository and run `./install.sh`. If you have Zephir installed then you can execute `./build.sh.`

To install Ouchbase with composer add the following to your composer.json

```
"require": {
    "ihor/ouchbase": "0.1.*@dev"
},
"scripts": {
    "post-install-cmd": ["./vendor/ihor/ouchbase/install.sh"],
    "post-update-cmd": ["./vendor/ihor/ouchbase/install.sh"]
},

```

Usage
-----

[](#usage)

```
class TestEntity implements \Ouchbase\Entity
{
    private $id;

    public $property;

    public function __construct($id, $property)
    {
        $this->id = $id;
        $this->property = $property;
    }

    public function getId()
    {
        return $this->id;
    }

    public function getProperty()
    {
        return $this->property;
    }
}

class TestEntityRepository extends \Ouchbase\Repository
{
    public $keyPrefix = 'test:';

    protected $className = 'OuchbaseTest\TestEntity';

    public function findByProperty($property) { /** @todo */ }

    public function toObject($data)
    {
        return new TestEntity($data['id'], $data['property']);
    }

    public function toArray($entity)
    {
        return array(
            'id' => $entity->getId(),
            'property' => $entity->getProperty(),
        );
    }
}

$em = new \Ouchbase\EntityManager(new \Couchbase('localhost'));
$em->registerManagedEntityClass('TestEntity', 'TestEntityRepository');

$entity = new TestEntity('test-id', array('hello' => 'world'));

$em->persist($entity);
$em->flush();

$entity->property = array('world' => 'hello');
$em->flush();

$em->delete($entity);
$em->flush();

$entities = $em->getRepository('TestEntity')->findByProperty(42);
```

You can find more examples in test/OuchbaseTest/OuchbaseTest.php

Documentation
-------------

[](#documentation)

Please check stub.php to see Ouchbase API with documentation. Also use stub.php for autocompletion in your favourite IDE.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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/73abba5ca14b1bc26d004398d23618fd1c60431eb4ced639b1bc56cfb9db6391?d=identicon)[ihor](/maintainers/ihor)

---

Top Contributors

[![ihor](https://avatars.githubusercontent.com/u/490943?v=4)](https://github.com/ihor "ihor (41 commits)")

### Embed Badge

![Health badge](/badges/ihor-ouchbase/health.svg)

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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