public function createConnector(array $config)
{
if (!isset($config['driver'])) {
throw new Exception('A driver must be specified.');
}
switch ($config['driver']) {
case 'mysql':
return new MySqlConnector();
case 'pgsql':
return new PostgresConnector();
case 'sqlite':
return new SQLiteConnector();
case 'filesystem':
return new FileSystemConnector();
}
throw new Exception("Unsupported driver [{$config['driver']}]");
}