pieceofcake2/datasources
最新稳定版本:v2.0.0
Composer 安装命令:
composer require pieceofcake2/datasources
包简介
CakePHP 2 Datasources Plugin
关键字:
README 文档
README
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:
- OpenLDAP server on port 389
- phpLDAPadmin on http://localhost:8080
You can access phpLDAPadmin to inspect the LDAP directory:
- URL: http://localhost:8080
- Login DN:
cn=admin,dc=cakephp,dc=org - Password:
password
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
其他信息
- 授权协议: MIT
- 更新时间: 2025-10-07