[wp-trac] [WordPress Trac] #33926: Improve WordPress Compatibility with HHVM
WordPress Trac
noreply at wordpress.org
Mon Sep 21 20:00:31 UTC 2015
#33926: Improve WordPress Compatibility with HHVM
--------------------------+------------------------
Reporter: wjywbs | Owner: pento
Type: defect (bug) | Status: reviewing
Priority: normal | Milestone: 4.4
Component: General | Version: trunk
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+------------------------
Comment (by wjywbs):
Replying to [comment:3 pento]:
> For [attachment:33926-db.patch]:
>
> * When we're using `mysqli`, we need to be checking `$this->dbh
instanceof mysqli`, not `empty( $this->dbh )`.
Thanks for your review. I tested that using `$this->dbh instanceof mysqli`
would cause the error of `Undefined property: wpdb::$dbh` because dbh is
unset.
> * In `::query()`, why is HHVM throwing a fatal error if the connection
has gone away? If the query fails due to a 2006 error (MySQL server has
gone away), then it'll reconnect and retry the query. We do it this way so
that we're not doing a `mysqli_ping()` for every query, just the ones that
fail due to the server going away - HHVM should be able to handle this.
In tests/phpunit/tests/db.php, `test_db_reconnect()` calls `unset(
$wpdb->dbh )`, so `@mysqli_query( $this->dbh, $query )` runs in
`_do_query()`. Since $this->dbh is empty, HHVM will throw a catchable
fatal error. The empty db handle must be checked before running
`_do_query`.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/33926#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list