getMessage()); } function test(Closure $function) { $function(); } /** Replaces [] with driver-specific quotes */ function reformat($s) { global $config; if (is_array($s)) { if (isset($s[$config['system']])) { return $s[$config['system']]; } $s = $s[0]; } if ($config['system'] === 'mysql') { return strtr($s, '[]', '``'); } elseif ($config['system'] === 'postgre') { return strtr($s, '[]', '""'); } elseif (in_array($config['system'], ['odbc', 'sqlite', 'sqlsrv'])) { return $s; } else { trigger_error("Unsupported driver $config[system]", E_USER_WARNING); } }