Skip to content

Instantly share code, notes, and snippets.

View christiaangoossens's full-sized avatar
🚅
Always busy, quick like a train.

Christiaan Goossens christiaangoossens

🚅
Always busy, quick like a train.
View GitHub Profile
@christiaangoossens
christiaangoossens / RobustPDO.php
Last active December 8, 2019 14:01 — forked from cjthompson/RobustPDO.php
Extended PDO class that detects dropped connections and reconnects on all things that Eloquent ORM would also reconnect on.
<?php
class RobustPDO extends PDO
{
/** Call setAttribute to set the session wait_timeout value */
const ATTR_MYSQL_TIMEOUT = 100;
/** @var array */
protected $config = [];
/** @var bool For lazy connection tracking */