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.1.7(5mo ago)7182.8k↓47.1%55[41 issues](https://github.com/modxcms/xpdo/issues)[19 PRs](https://github.com/modxcms/xpdo/pulls)2GPL-2.0+PHPPHP &gt;=7.2.5CI passing

Since Jan 22Pushed 1mo 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 1mo ago

READMEChangelogDependencies (3)Versions (19)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

55

—

FairBetter than 98% of packages

Maintenance70

Regular maintenance activity

Popularity48

Moderate usage in the ecosystem

Community35

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 89.4% 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 ~90 days

Recently: every ~113 days

Total

18

Last Release

71d ago

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

v3.1.0PHP &gt;=7.2.5

### 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 (666 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)")[![markwillis82](https://avatars.githubusercontent.com/u/388159?v=4)](https://github.com/markwillis82 "markwillis82 (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)")[![Bournwog](https://avatars.githubusercontent.com/u/5351806?v=4)](https://github.com/Bournwog "Bournwog (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)")[![Ibochkarev](https://avatars.githubusercontent.com/u/2138260?v=4)](https://github.com/Ibochkarev "Ibochkarev (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

[robmorgan/phinx

Phinx makes it ridiculously easy to manage the database migrations for your PHP app.

4.5k46.2M405](/packages/robmorgan-phinx)[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M191](/packages/spatie-laravel-backup)[getgrav/grav

Modern, Crazy Fast, Ridiculously Easy and Amazingly Powerful Flat-File CMS

15.4k84.1k1](/packages/getgrav-grav)[kimai/kimai

Kimai - Time Tracking

4.6k7.4k1](/packages/kimai-kimai)[doctrine/doctrine-orm-module

Laminas Module that provides Doctrine ORM functionality

4407.3M293](/packages/doctrine-doctrine-orm-module)[worksome/foggy

Foggy is a tool for making database dumps with some data removed/changed.

26571.7k1](/packages/worksome-foggy)

PHPackages © 2026

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