protected function _enable($exts)
{
if (!empty($exts) && $this->_capability('ENABLE')) {
$c = $this->_capability();
$todo = array();
// Only enable non-enabled extensions.
foreach ($exts as $val) {
if (!$c->isEnabled($val)) {
$c->enable($val);
$todo[] = $val;
}
}
if (!empty($todo)) {
$cmd = $this->_command('ENABLE')->add($todo);
$cmd->on_error = function () use($todo, $c) {
/* Something went wrong... disable the extensions. */
foreach ($todo as $val) {
$c->enable($val, false);
}
};
$this->_cmdQueue[] = $cmd;
}
}
}