定制 o6web/pdo 二次开发

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

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

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2025-12-21