pieceofcake2/datasources

CakePHP 2 Datasources Plugin

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 115

Type:cakephp-plugin

pkg:composer/pieceofcake2/datasources

v2.0.0 2025-10-07 21:14 UTC

This package is auto-updated.

Last update: 2025-10-07 21:14:49 UTC


README

GitHub License Packagist Version PHP CakePHP CI Codecov

This is forked for CakePHP2.

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

Already compatible Datasources:

  • ArraySource
  • CsvSource

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

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

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

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

Running tests

./vendor/bin/phpunit

Testing LDAP datasource

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

docker compose up -d

This will start:

You can access phpLDAPadmin to inspect the LDAP directory:

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

If you have issues with the datasources plugin, you can report them via Github issues