o6web/pdo
最新稳定版本:1.0.0
Composer 安装命令:
composer require o6web/pdo
包简介
Extension of the base PHP PDO class with some added shortcuts and built-in logging
README 文档
README
Extension of the base PHP PDO class with some added shortcuts and built-in logging for use with O6 Web Properties projects. This was originally part of an internal package. We've opened it up in case it proves helpful for anyone else but future development will be based on O6's needs.
Usage
use o6web\PDO\Connection; use o6web\PDO\ConnectionCollection; use o6web\PDO\PDO; // Build a collection of connections $connections = []; $connections['read'] = new Connection('read', $readDsn, $readUser, $readPassword, $readOptions); $connections['write'] = new Connection('write', $writeDsn, $writeUser, $writePassword, $writeOptions) $connectionCollection = new ConnectionCollection($connections); // Get a collection from the connection $pdo = $connectionCollection->get('read')->getConnection(); // Instantiate a single PDO connection $pdo = new PDO($dsn, $user, $password, $options); // Optional: Set a logger on the connection $pdo->setLogger($logger);
Installation
Simply add a dependency on o6web/pdo to your composer.json file if you use Composer to manage the dependencies of your project:
composer require o6web/pdo
Although it's recommended to use Composer, you can actually include the file(s) any way you want.
License
PDO is MIT licensed.
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2025-12-21