PHPackages                             pieceofcake2/datasources - 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. pieceofcake2/datasources

ActiveCakephp-plugin[Database &amp; ORM](/categories/database)

pieceofcake2/datasources
========================

CakePHP 2 Datasources Plugin

v2.0.0(7mo ago)01MITPHPPHP ^8.0CI passing

Since Oct 7Pushed 7mo agoCompare

[ Source](https://github.com/pieceofcake2/datasources)[ Packagist](https://packagist.org/packages/pieceofcake2/datasources)[ RSS](/packages/pieceofcake2-datasources/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelogDependencies (8)Versions (2)Used By (0)

CakePHP 2 datasources plugin
----------------------------

[](#cakephp-2-datasources-plugin)

[![GitHub License](https://camo.githubusercontent.com/48a13d09475d5bf3a86466b20bc1c8fee6d09cc986b8c59210aeb7db93d902b5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70696563656f6663616b65322f64617461736f75726365733f6c6162656c3d4c6963656e7365)](LICENSE)[![Packagist Version](https://camo.githubusercontent.com/060fb2e13bb4fa98ffffb164073d23402553c94291463e0e61ae93ae38997511/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70696563656f6663616b65322f64617461736f75726365733f6c6162656c3d5061636b6167697374)](https://packagist.org/packages/pieceofcake2/datasources)[![PHP](https://camo.githubusercontent.com/61efdc4f2b6b058d5f79fa6df6cc99135f3858d30ef7add69ae15a9dcc643303/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f70696563656f6663616b65322f64617461736f75726365732f7068703f6c6f676f3d706870266c6f676f436f6c6f723d253233464646464646266c6162656c3d504850266c6162656c436f6c6f723d25323337373742423426636f6c6f723d253233464646464646)](https://camo.githubusercontent.com/61efdc4f2b6b058d5f79fa6df6cc99135f3858d30ef7add69ae15a9dcc643303/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f70696563656f6663616b65322f64617461736f75726365732f7068703f6c6f676f3d706870266c6f676f436f6c6f723d253233464646464646266c6162656c3d504850266c6162656c436f6c6f723d25323337373742423426636f6c6f723d253233464646464646)[![CakePHP](https://camo.githubusercontent.com/5f1856d0b8572d4cab729e91ab26a6b2804a8f8cf1e1bbcb271c9396a614cec5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f70696563656f6663616b65322f64617461736f75726365732f70696563656f6663616b65322f63616b657068703f6c6f676f3d63616b65706870266c6f676f436f6c6f723d253233464646464646266c6162656c3d43616b65504850266c6162656c436f6c6f723d25323344333343343326636f6c6f723d253233464646464646)](https://camo.githubusercontent.com/5f1856d0b8572d4cab729e91ab26a6b2804a8f8cf1e1bbcb271c9396a614cec5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f70696563656f6663616b65322f64617461736f75726365732f70696563656f6663616b65322f63616b657068703f6c6f676f3d63616b65706870266c6f676f436f6c6f723d253233464646464646266c6162656c3d43616b65504850266c6162656c436f6c6f723d25323344333343343326636f6c6f723d253233464646464646)[![CI](https://camo.githubusercontent.com/0698ff625b59ccd28699f26747018d0704d9ef09eab4dd1d5b8c3df659ae794e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f70696563656f6663616b65322f64617461736f75726365732f43492e796d6c3f6c6162656c3d4349)](https://github.com/pieceofcake2/datasources/actions/workflows/CI.yml)[![Codecov](https://camo.githubusercontent.com/4897b52dfff09f270c1a85a8b22eb13b914f91f570b2d30b920d82105d6a3557/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f67682f70696563656f6663616b65322f64617461736f75726365733f6c6162656c3d436f766572616765)](https://codecov.io/gh/pieceofcake2/datasources)

**This is forked for CakePHP2.**

This plugin contains various datasources contributed by the core CakePHP team and the community.

### Already compatible Datasources:

[](#already-compatible-datasources)

- ArraySource
- CsvSource

**Note:** Only ArraySource and CsvSource are expected to work properly. Other datasources may not function correctly.

### Still Incompatible Datasources:

[](#still-incompatible-datasources)

- XmlrpcSource (tests require external server)
- Database/MysqlLog
- CouchdbSource
- LdapSource
- SoapSource
- Database/Adodb
- Database/Db2
- Database/Firebird
- Database/Odbc

### Using the datasources plugin

[](#using-the-datasources-plugin)

First download the repository and place it in `app/Plugin/Datasources` or on one of your plugin paths. You can then import and use the datasources in your App classes.

### Model validation

[](#model-validation)

Datasource plugin datasources can be used either through App::uses of by defining them in your database configuration

```
class DATABASE_CONFIG {
    public $mySource = array(
        'datasource' => 'Datasources.XmlrpcSource',
        ...
        );
    }
}
```

or

```
App::uses('XmlrpcSource', 'Datasources.Model/Datasource');
```

or, if using one of the pdo extended datasources,

```
class DATABASE_CONFIG {
    public $mySource = array(
        'driver' => 'Datasources.Database/Firebird',
        ...
        );
    }
}
```

Testing
-------

[](#testing)

### Running tests

[](#running-tests)

```
./vendor/bin/phpunit
```

### Testing LDAP datasource

[](#testing-ldap-datasource)

LDAP tests require a running LDAP server. You can start one using Docker Compose:

```
docker compose up -d
```

This will start:

- OpenLDAP server on port 389
- phpLDAPadmin on

You can access phpLDAPadmin to inspect the LDAP directory:

- URL:
- Login DN: `cn=admin,dc=cakephp,dc=org`
- Password: `password`

Contributing to datasources
---------------------------

[](#contributing-to-datasources)

If you have a datasource, or an idea for a datasource that could benefit the CakePHP community, please fork the project on github. Once you have forked the project you can commit your datasource class (and any test cases). Once you have pushed your changes back to github you can send a pull request, and your changes will be reviewed and merged in or feedback will be given.

Issues with datasources
-----------------------

[](#issues-with-datasources)

If you have issues with the datasources plugin, you can report them via [Github issues](https://github.com/pieceofcake2/datasources/issues)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance63

Regular maintenance activity

Popularity1

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~0 days

Total

2

Last Release

223d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/578548?v=4)[TSURU](/maintainers/ttsuru)[@ttsuru](https://github.com/ttsuru)

---

Top Contributors

[![predominant](https://avatars.githubusercontent.com/u/24568?v=4)](https://github.com/predominant "predominant (96 commits)")[![jrbasso](https://avatars.githubusercontent.com/u/26548?v=4)](https://github.com/jrbasso "jrbasso (47 commits)")[![ADmad](https://avatars.githubusercontent.com/u/142658?v=4)](https://github.com/ADmad "ADmad (15 commits)")[![Phally](https://avatars.githubusercontent.com/u/112639?v=4)](https://github.com/Phally "Phally (13 commits)")[![AD7six](https://avatars.githubusercontent.com/u/33387?v=4)](https://github.com/AD7six "AD7six (12 commits)")[![chinpei215](https://avatars.githubusercontent.com/u/7399393?v=4)](https://github.com/chinpei215 "chinpei215 (12 commits)")[![renan](https://avatars.githubusercontent.com/u/28046?v=4)](https://github.com/renan "renan (8 commits)")[![maurymmarques](https://avatars.githubusercontent.com/u/338086?v=4)](https://github.com/maurymmarques "maurymmarques (8 commits)")[![ceeram](https://avatars.githubusercontent.com/u/111448?v=4)](https://github.com/ceeram "ceeram (8 commits)")[![CauanCabral](https://avatars.githubusercontent.com/u/83092?v=4)](https://github.com/CauanCabral "CauanCabral (7 commits)")[![ttsuru](https://avatars.githubusercontent.com/u/578548?v=4)](https://github.com/ttsuru "ttsuru (7 commits)")[![lorenzo](https://avatars.githubusercontent.com/u/37621?v=4)](https://github.com/lorenzo "lorenzo (5 commits)")[![josegonzalez](https://avatars.githubusercontent.com/u/65675?v=4)](https://github.com/josegonzalez "josegonzalez (3 commits)")[![jippi](https://avatars.githubusercontent.com/u/22841?v=4)](https://github.com/jippi "jippi (3 commits)")[![Pagebakers](https://avatars.githubusercontent.com/u/32583?v=4)](https://github.com/Pagebakers "Pagebakers (3 commits)")[![longkey1](https://avatars.githubusercontent.com/u/58566?v=4)](https://github.com/longkey1 "longkey1 (2 commits)")[![ctgraham](https://avatars.githubusercontent.com/u/7001322?v=4)](https://github.com/ctgraham "ctgraham (2 commits)")[![angelxmoreno](https://avatars.githubusercontent.com/u/363479?v=4)](https://github.com/angelxmoreno "angelxmoreno (2 commits)")[![thatcode](https://avatars.githubusercontent.com/u/160156?v=4)](https://github.com/thatcode "thatcode (2 commits)")[![lipedjow](https://avatars.githubusercontent.com/u/413263?v=4)](https://github.com/lipedjow "lipedjow (2 commits)")

---

Tags

sqlitesqlserverdb2cakephpcouchdbldapodbcdatasourcessybasefirebirdcakephp2adodb

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[dibi/dibi

Dibi is Database Abstraction Library for PHP

5013.8M120](/packages/dibi-dibi)[aura/sql

A PDO extension that provides lazy connections, array quoting, query profiling, value binding, and convenience methods for common fetch styles. Because it extends PDO, existing code that uses PDO can use this without any changes to the existing code.

5632.5M43](/packages/aura-sql)[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)[ezsql/ezsql

Advance database access library. Make interacting with a database ridiculously easy. An universal interchangeable CRUD system.

86946.7k](/packages/ezsql-ezsql)[jv2222/ezsql

Advance database access library. Make interacting with a database ridiculously easy. An universal interchangeable CRUD system.

87311.3k2](/packages/jv2222-ezsql)

PHPackages © 2026

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