There the following line in enableCache():
$db->query('OPTIMIZE TABLE ' . $this->cache_table);
The problem here is, that $this->cache_table gets set later in the function (at the end of the "db" block).
To fix this, use:
$db->query('OPTIMIZE TABLE ' . $table);