You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which operating systems have you tested for this bug?
Linux
Which server did you use?
cli
Database
No response
What happened?
Run in a 'Resident Process Mode' such as swoole, a BaseConnection instance would never destruct after query database because of 'circular reference', which means memory leak.
Steps to Reproduce
Query database in a 'Resident Process Mode' such as swoole, echo something in it's __destruct method, nothing will output because the instance won't destruct at all.
Expected Output
The instance should be able to destruct.
Anything else?
Only two methods are used in Query instance: 'isWriteType' and 'escape', which seems could work as static methods. Why not set them as static methods and pass the full class name of BaseConnection instance to Query instance just like $query = new $queryClass(static::class);, then we can call those two methods like $this->dbClass::isWriteType($this->originalQueryString).
Another simpler suggestion is to clone the BaseConnection instance like $query = new $queryClass(clone $this);
The text was updated successfully, but these errors were encountered:
warmbook
added
the
bug
Verified issues on the current code behavior or pull requests that will fix them
label
Jan 8, 2025
@michalsn Out of context, i'm trying FrankenPHP in my project. But Boot in CI4 need rework to support worker like https://github.com/php-runtime/frankenphp-symfony
PHP Version
8.1
CodeIgniter4 Version
4.5.4
CodeIgniter4 Installation Method
Manual (zip or tar.gz)
Which operating systems have you tested for this bug?
Linux
Which server did you use?
cli
Database
No response
What happened?
Run in a 'Resident Process Mode' such as swoole, a BaseConnection instance would never destruct after query database because of 'circular reference', which means memory leak.
Steps to Reproduce
Query database in a 'Resident Process Mode' such as swoole, echo something in it's __destruct method, nothing will output because the instance won't destruct at all.
Expected Output
The instance should be able to destruct.
Anything else?
Only two methods are used in Query instance: 'isWriteType' and 'escape', which seems could work as static methods. Why not set them as static methods and pass the full class name of BaseConnection instance to Query instance just like
$query = new $queryClass(static::class);
, then we can call those two methods like$this->dbClass::isWriteType($this->originalQueryString)
.Another simpler suggestion is to clone the BaseConnection instance like
$query = new $queryClass(clone $this);
The text was updated successfully, but these errors were encountered: