t4g/ha-proxy
Composer 安装命令:
composer require t4g/ha-proxy
包简介
Basic HAProxy Split R/W implementation for PDO
README 文档
README
##Introduction
This project exposes the following namespaces for use in your custom use:
- CSI\Drivers\PDO\HAProxy
EXAMPLE
For Vanilla FW
use CSI\Drivers\PDO
$proxy = new HAProxy();
$proxy->CreatMaster('mysql:host=MASTER_DB_HOST;dbname=MASTER_DB_NAME','MASTER_DB_USER','MASTER_DB_PASSWORD');
$proxy->CreateReadonly( 'mysql:host=readonly_DB_HOST;dbname=readonly_DB_NAME','readonly_DB_USER','readonly_DB_PASSWORD');
// Framework::setup($proxy);
For PDO override
use CSI\Drivers\PDO\HAProxy as PDO;
or:
if ($dsn instanceof PDO || $dsn instanceof HAProxy) {
This line happens twice on current RedBean v3.0.1, on lines 29 and 1937 on rb.php file. Repalce both.
or:
$SOME_PDO ...
$SOME_PDO = new HAProxy($SOME_PDO);
$SOME_PDO->CreateReadonly( 'mysql:host=readonly_DB_HOST;dbname=readonly_DB_NAME','readonly_DB_USER','readonly_DB_PASSWORD');
\PDO $SOME_PDO ...
Limitations
HAProxy supports the simplest MySQL Replication setup, where you have a Master, and a readonly.
Contributors & Authors
@t4g @mauricoder
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-08-18