定制 pieceofcake2/datasources 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pieceofcake2/datasources

最新稳定版本:v2.0.0

Composer 安装命令:

composer require pieceofcake2/datasources

包简介

CakePHP 2 Datasources Plugin

README 文档

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

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 113
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-10-07