openswoole / ext-openswoole

Programmatic server for PHP with async IO, coroutines and fibers
https://openswoole.com
Apache License 2.0
808 stars 51 forks source link

in v22.0.0 Fatal error: Uncaught Error: Class 'OpenSwoole\Database\MySQLiPool' not found #289

Closed XDRiVE888 closed 1 year ago

XDRiVE888 commented 1 year ago

Theres no mysqli connection pool in openswoole v22.0.0 and displays Fatal error: Uncaught Error: Class 'OpenSwoole\Database\MySQLiPool' not found.

doubaokun commented 1 year ago

Please check:

https://github.com/openswoole/openswoole/blob/master/example/src/Coroutine/RedisPool.php

https://github.com/openswoole/openswoole/tree/master/core/src/Coroutine/Client

https://github.com/openswoole/openswoole/blob/master/core/src/Coroutine/Pool/ClientPool.php

XDRiVE888 commented 1 year ago

I did not understand anything. Explain to me, Swoole\Database\MySQLiPool is no longer supported? Why is this not mentioned in the updates? Made some kind of mess with these renames and fuss with classes. Revert Swoole\Database\MySQLiPool back as I don't see a viable alternative to this function.

doubaokun commented 1 year ago

Example added at: https://github.com/openswoole/openswoole/blob/master/example/src/Coroutine/MysqliClientPool.php

XDRiVE888 commented 1 year ago

I tried something similar yesterday, but when calling new OpenSwoole\Core\Coroutine\Client\MysqliConfig(), it gave me an error about the absence of this class. It seems that in the native form in version v22 this class is not present. I haven't tried adding require_once DIR . '/../../vendor/autoload.php'; I think it's worth bringing back MySQLiPool which worked fine in version 4 until your new OpenSwoole\Core\Coroutine\Pool\ClientPool api is documented and available by default without adding any require_once.

doubaokun commented 1 year ago

You can use v4.12.1 if you don’t want to use v22

XDRiVE888 commented 1 year ago

Being left without updates is not a good prospect, at the same time an update that works worse than the previous version sounds even worse.