krowinski / php-mysql-replication

Pure PHP Implementation of MySQL replication protocol. This allow you to receive event like insert, update, delete with their data and raw SQL queries.
MIT License
323 stars 98 forks source link

Let's `Config` static properties to non-static. #94

Closed Moln closed 10 months ago

Moln commented 2 years ago

I will try use it combine swoole for connect multiple replications. Let's Config static properties to non-static will be better.

$config = (new ConfigBuilder())
    ->withUser('root')
    ->withHost('192.168.1.10')
    ->withPort(3306)
    ->withPassword('123456')
    ->build();

$config2 = (new ConfigBuilder())
    ->withUser('root')
    ->withHost('192.168.1.11')
    ->withPort(3306)
    ->withPassword('123456')
    ->build();

var_dump($config->getHost()); //192.168.1.11

Expected Result.

Output: 192.168.1.10

Actual Result.

Output: 192.168.1.11

krowinski commented 10 months ago

Hi, I can change this but I think you will unable to run consume in one php process.

krowinski commented 10 months ago

done in #104