It is the third day I try to find mysqlnd plugin use cases for the Succeed with Plugins webinar on October, 26th. Not being innovative or creative today, I looked into a classic: client fail over. As a trained and talented reader, you won’t be shocked to see 54 lines of PECL/mysqlnd_uh hacking today.
class __mysqlnd_conn_failover extends MysqlndUhConnection {
private $fail_over_errno = array(
2002 => "Can't connect to local MySQL server through socket '%s' (%d)",
2003 => "Can't connect to MySQL server on '%s' (%d)",
2004 => "Unknown MySQL server host '%s' (%d)",
2006 => "MySQL server has gone away",
2013 => "Lost connection to MySQL server during query"
);
private $fail_over_servers = array(
array("host" => …[Read more]