PHPackages                             xtlsoft/xdo - 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. xtlsoft/xdo

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

xtlsoft/xdo
===========

A fast,light Data Object for PHP

v0.1.3-stable(8y ago)32151[1 issues](https://github.com/xtlsoft/XDO/issues)2MITPHPPHP &gt;=5.4.0

Since May 14Pushed 8y ago2 watchersCompare

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

READMEChangelog (3)DependenciesVersions (4)Used By (2)

XDO - PHP Data Object
=====================

[](#xdo---php-data-object)

Notice: This Project is no longer supported. Please see
------------------------------------------------------------------------------------------

[](#notice-this-project-is-no-longer-supported-please-see-httpsgithubcomxtlsoftnondb)

[![Latest Stable Version](https://camo.githubusercontent.com/1cecd6ab2f5ac1b13de6fda622b8f1aa57b63d717f57853ae3b19e6ae5bd30e4/68747470733a2f2f706f7365722e707567782e6f72672f78746c736f66742f78646f2f762f737461626c65)](https://packagist.org/packages/xtlsoft/xdo)[![Total Downloads](https://camo.githubusercontent.com/4d16ac3eebac374760ff5dcfd9d459fca891286ae768d772bd8bea0d365b383c/68747470733a2f2f706f7365722e707567782e6f72672f78746c736f66742f78646f2f646f776e6c6f616473)](https://packagist.org/packages/xtlsoft/xdo)[![License](https://camo.githubusercontent.com/8b43270536746011bd6941b9a8f6a82350b05d1d4ef0eefed2a64610776eadf2/68747470733a2f2f706f7365722e707567782e6f72672f78746c736f66742f78646f2f6c6963656e7365)](https://packagist.org/packages/xtlsoft/xdo)[![Need PHP Version](https://camo.githubusercontent.com/7a26d7ea8c44ac77ff383dcbdd30b065eb7993a7d0402d058facb07e7fd7c5ee/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d352e342b2d626c75652e737667)](https://php.net/)[![Build Status](https://camo.githubusercontent.com/34f96cd47dfbe1f9295f1ccf68e514ce5fd26b80a6b8720d49e693ccd1c8fbc8/68747470733a2f2f7472617669732d63692e6f72672f78746c736f66742f58444f2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/xtlsoft/XDO)

> XDO is a PHP Data Object includes Database, Cache and Upload.
> XDO 是一个 PHP 数据类，它包括了 数据库，缓存和上传。

### Author 作者

[](#author-作者)

The Author of XDO is Tianle Xu().
XDO 的作者是徐天乐()。

### Dependency 依赖项

[](#dependency-依赖项)

We only need PHP! (PHP&gt;=5.4) This is a portable software!
我们只需要PHP! (PHP&gt;=5.4) 这是一个绿色软件！

### Install 安装

[](#install-安装)

###### 1. Common

[](#1-common)

1. Install PHP.
2. Clone this project.
3. Move the `XDO-master` directory into `vendor/XDO`
4. add one line code to your PHP Script:

```
require_once("vendor/XDO/Autoload.php");

```

5. Enjoy!

###### 2. One-Key Script

[](#2-one-key-script)

> Note: Please install `wget` first.
> If you want to use this way to install XDO, please add a `PATH` env for PHP first.

1. Run the script

```
wget http://raw.githubusercontents.com/xtlsoft/XDO/files/XDO-install.php -O XDO-install.php && php ./XDO-install.php

```

2. add one line code to your PHP Script:

```
require_once("vendor/XDO/Autoload.php");

```

3. Enjoy!

###### 3. Use composer

[](#3-use-composer)

```
composer require xtlsoft/xdo:dev-master

```

---

###### 1. 通用

[](#1-通用)

1. 安装PHP。
2. Clone 这个项目。
3. 把`XDO-master`文件夹移动到`vendor`下并重命名为`XDO`
4. 向你的程序添加一行:

```
require_once("vendor/XDO/Autoload.php");

```

5. Enjoy!

###### 2. 一键脚本

[](#2-一键脚本)

> Note: 请先安装 `wget` 。
> 请先为PHP设置环境变量。

1. 运行脚本

```
wget http://raw.githubusercontents.com/xtlsoft/XDO/files/XDO-install.php -O XDO-install.php && php ./XDO-install.php

```

2. 向你的程序添加一行:

```
require_once("vendor/XDO/Autoload.php");

```

3. Enjoy!

###### 3. Use composer

[](#3-use-composer-1)

```
composer require xtlsoft/xdo:dev-master

```

### Usage 使用

[](#usage-使用)

- Install XDO.
- Include XDO class:

```
use XDO\XDO;

```

- Set a Data dir:

```
XDO::setDir("path/to/data");

```

> Please clone the `Data` branch into your project. Replace the `path/to/data` string into the path to the `Data` branch you cloned. It includes some sample Data.

- Create a Database object:

```
$db = XDO::Database("Test"); //"Test" is the ModelName. We include a Test Model in the `Data` branch.

```

- Do some tests:

```
$db->get("Config"); //Get the Data from Config table.
$db->get("Config.#1"); //Get the Data from #1 of Config Table
$db->get("Config.where[name=xtlsoft%]"); //Get the Data which its name match "\^xtlsoft[\s\S]*$\" in Config table.

```

- More: put,ins,del ::: Read our [document](https://xdo.1im.pw/docs/en)

---

- 安装 XDO.
- 引入 XDO 类:

```
use XDO\XDO;

```

- 设置一个 Data 目录:

```
XDO::setDir("path/to/data");

```

> 请 clone `Data` 分支。 把 `path/to/data` 替换成你 clone 的 `Data` 分支. 它包括一些测试数据。

- 创建一个 Database 实例:

```
$db = XDO::Database("Test"); //"Test" is the ModelName. We include a Test Model in the `Data` branch.

```

- 做一些测试:

```
$db->get("Config"); //Get the Data from Config table.
$db->get("Config.#1"); //Get the Data from #1 of Config Table
$db->get("Config.where[name=xtlsoft%]"); //Get the Data which its name match "\^xtlsoft[\s\S]*$\" in Config table.

```

- 更多方法: put,ins,del ::: 阅读我们的 [文档](https://xdo.1im.pw/docs/zh)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity50

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.

###  Release Activity

Cadence

Every ~43 days

Total

3

Last Release

3197d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0dbd34d2c8c98259a3e7bd7654b92b663eb0920a3c8259be852908ff6e581e14?d=identicon)[xtlsoft](/maintainers/xtlsoft)

---

Top Contributors

[![xtlsoft](https://avatars.githubusercontent.com/u/16159830?v=4)](https://github.com/xtlsoft "xtlsoft (29 commits)")

---

Tags

cachedatadatabasephpuploadwebdatadatabasecacheupload

### Embed Badge

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

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

###  Alternatives

[basho/riak

Official Riak client for PHP

159246.7k7](/packages/basho-riak)[openbuildings/jam

Small but feature rich ORM, has extensible models and builders, baked in upload functionality, supporting multiple backends (rackspace, ftp), polymorphic associations, form builders, nested forms, validators

32181.3k16](/packages/openbuildings-jam)[ytake/laravel-couchbase

Couchbase providers for Laravel

3051.9k](/packages/ytake-laravel-couchbase)[eighty8/laravel-seeder

Versioned, environment-based Seeders in Laravel

1857.1k](/packages/eighty8-laravel-seeder)[smrtr/mysql-version-control

A crude version control system for mysql written in php

221.4k](/packages/smrtr-mysql-version-control)[mammothphp/woollym

WoollyM: PHP Data Analysis Library

111.6k](/packages/mammothphp-woollym)

PHPackages © 2026

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