PHPackages                             xpdo/xpdo - 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. xpdo/xpdo

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

xpdo/xpdo
=========

A PDO-based Object/Relational Bridge Library

v3.2.0(2mo ago)7286.1k↓76.2%55[39 issues](https://github.com/modxcms/xpdo/issues)[15 PRs](https://github.com/modxcms/xpdo/pulls)2GPL-2.0+PHPPHP &gt;=8.1CI passing

Since Jan 22Pushed 2mo ago17 watchersCompare

[ Source](https://github.com/modxcms/xpdo)[ Packagist](https://packagist.org/packages/xpdo/xpdo)[ Docs](http://www.xpdo.org/)[ RSS](/packages/xpdo-xpdo/feed)WikiDiscussions 3.x Synced 2d ago

READMEChangelog (1)Dependencies (8)Versions (20)Used By (2)

xPDO O/RB v3
============

[](#xpdo-orb-v3)

[![Build Status](https://github.com/modxcms/xpdo/workflows/CI/badge.svg?branch=3.x)](https://github.com/modxcms/xpdo/workflows/CI/badge.svg?branch=3.x)

xPDO is an ultra-light object-relational bridge library for PHP. It is a standalone library and can be used with any framework or DI container.

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

[](#installation)

xPDO can be installed in your project via composer:

```
composer require xpdo/xpdo

```

Usage
-----

[](#usage)

The `\xPDO\xPDO` class is the main point of access to the framework. Provide a configuration array describing the connection(s) you want to establish when creating an instance of the class.

```
require __DIR__ . '/../vendor/autoload.php';

$xpdoMySQL = \xPDO\xPDO::getInstance('aMySQLDatabase', [
    \xPDO\xPDO::OPT_CACHE_PATH => __DIR__ . '/../cache/',
    \xPDO\xPDO::OPT_HYDRATE_FIELDS => true,
    \xPDO\xPDO::OPT_HYDRATE_RELATED_OBJECTS => true,
    \xPDO\xPDO::OPT_HYDRATE_ADHOC_FIELDS => true,
    \xPDO\xPDO::OPT_CONNECTIONS => [
        [
            'dsn' => 'mysql:host=localhost;dbname=xpdotest;charset=utf8',
            'username' => 'test',
            'password' => 'test',
            'options' => [
                \xPDO\xPDO::OPT_CONN_MUTABLE => true,
            ],
            'driverOptions' => [],
        ],
    ],
]);

$xpdoSQLite = \xPDO\xPDO::getInstance('aSQLiteDatabase', [
    \xPDO\xPDO::OPT_CACHE_PATH => __DIR__ . '/../cache/',
    \xPDO\xPDO::OPT_HYDRATE_FIELDS => true,
    \xPDO\xPDO::OPT_HYDRATE_RELATED_OBJECTS => true,
    \xPDO\xPDO::OPT_HYDRATE_ADHOC_FIELDS => true,
    \xPDO\xPDO::OPT_CONNECTIONS => [
        [
            'dsn' => 'sqlite:path/to/a/database',
            'username' => '',
            'password' => '',
            'options' => [
                \xPDO\xPDO::OPT_CONN_MUTABLE => true,
            ],
            'driverOptions' => [],
        ],
    ],
]);
```

###  Health Score

60

—

FairBetter than 98% of packages

Maintenance72

Regular maintenance activity

Popularity47

Moderate usage in the ecosystem

Community35

Small or concentrated contributor base

Maturity75

Established project with proven stability

 Bus Factor1

Top contributor holds 89.3% 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 ~86 days

Recently: every ~121 days

Total

19

Last Release

86d ago

PHP version history (3 changes)v3.0.0PHP &gt;=5.6

v3.1.0PHP &gt;=7.2.5

3.x-devPHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/232812?v=4)[Jason Coward](/maintainers/opengeek)[@opengeek](https://github.com/opengeek)

![](https://www.gravatar.com/avatar/1a83f08e1f6768cb234b7cac87522c576813f77a981ba6761ebcb075c8f23152?d=identicon)[ianbrind](/maintainers/ianbrind)

---

Top Contributors

[![opengeek](https://avatars.githubusercontent.com/u/232812?v=4)](https://github.com/opengeek "opengeek (670 commits)")[![Mark-H](https://avatars.githubusercontent.com/u/312944?v=4)](https://github.com/Mark-H "Mark-H (13 commits)")[![theboxer](https://avatars.githubusercontent.com/u/845220?v=4)](https://github.com/theboxer "theboxer (11 commits)")[![mkschell](https://avatars.githubusercontent.com/u/121744?v=4)](https://github.com/mkschell "mkschell (10 commits)")[![rtripault](https://avatars.githubusercontent.com/u/300920?v=4)](https://github.com/rtripault "rtripault (6 commits)")[![rexterkate-adwise](https://avatars.githubusercontent.com/u/74508631?v=4)](https://github.com/rexterkate-adwise "rexterkate-adwise (6 commits)")[![JoshuaLuckers](https://avatars.githubusercontent.com/u/1268085?v=4)](https://github.com/JoshuaLuckers "JoshuaLuckers (3 commits)")[![Bournwog](https://avatars.githubusercontent.com/u/5351806?v=4)](https://github.com/Bournwog "Bournwog (3 commits)")[![electrickite](https://avatars.githubusercontent.com/u/3449824?v=4)](https://github.com/electrickite "electrickite (3 commits)")[![bezumkin](https://avatars.githubusercontent.com/u/1257284?v=4)](https://github.com/bezumkin "bezumkin (3 commits)")[![markwillis82](https://avatars.githubusercontent.com/u/388159?v=4)](https://github.com/markwillis82 "markwillis82 (3 commits)")[![Ibochkarev](https://avatars.githubusercontent.com/u/2138260?v=4)](https://github.com/Ibochkarev "Ibochkarev (3 commits)")[![Jako](https://avatars.githubusercontent.com/u/148371?v=4)](https://github.com/Jako "Jako (3 commits)")[![alroniks](https://avatars.githubusercontent.com/u/303498?v=4)](https://github.com/alroniks "alroniks (2 commits)")[![ExcaliburKG](https://avatars.githubusercontent.com/u/5450781?v=4)](https://github.com/ExcaliburKG "ExcaliburKG (2 commits)")[![Flygenring](https://avatars.githubusercontent.com/u/3658033?v=4)](https://github.com/Flygenring "Flygenring (2 commits)")[![pbowyer](https://avatars.githubusercontent.com/u/89852?v=4)](https://github.com/pbowyer "pbowyer (1 commits)")[![hansek](https://avatars.githubusercontent.com/u/378835?v=4)](https://github.com/hansek "hansek (1 commits)")[![gvozdb](https://avatars.githubusercontent.com/u/6847636?v=4)](https://github.com/gvozdb "gvozdb (1 commits)")[![sdrenth](https://avatars.githubusercontent.com/u/7802465?v=4)](https://github.com/sdrenth "sdrenth (1 commits)")

### Embed Badge

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

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[nelmio/api-doc-bundle

Generates documentation for your REST API from attributes

2.4k67.4M263](/packages/nelmio-api-doc-bundle)[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6942.5M420](/packages/drupal-core-recommended)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)

PHPackages © 2026

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