@param string $driver

@throws \Exception
552666
public static function checkForPdoDriver($driver)
    {
        if (!extension_loaded('PDO')) {
            throw new \Exception("Required PDO extension is not installed or loaded.");
        }

        // see overrides for specific driver checks
        $drivers = \PDO::getAvailableDrivers();
        if (!in_array($driver, $drivers)) {
            throw new \Exception("Required PDO driver '$driver' is not installed or loaded properly.");
        }
    }
593081
public static function driver(string $driver, AbstractRepository $repository): RepositoryDriver
    {
        switch ($driver) {
            case 'eloquent':
                return new Eloquent($repository);
            default:
                throw new InvalidArgumentException("Driver [{$driver}] not found");
        }
    }
404064
public function driver($driver = null)
    {
        $driver = $driver ?: $this->getDefaultDriver();

        if (is_null($driver)) {
            throw new InvalidArgumentException(sprintf('Unable to resolve NULL driver for [%s].', get_called_class()));
        }

        // If the given driver has not been created before, we will create the instances
        // here and cache it so we can return it next time very quickly. If there is
        // already a driver created by this name, we'll just return that instance.
        if (! isset($this->drivers[$driver])) {
            $this->drivers[$driver] = $this->createDriver($driver);
        }

        return $this->drivers[$driver];
    }
1140102
private function determineDriver($file)
    {
        $exception = new InvalidArgumentException(
            "Cannot initialize the configuration driver. I could not determine ".
            "the correct driver class."
        );

        if (is_null($file) || !is_string($file)) {
            throw $exception;
        }

        $nameDivision = explode('.', $file);
        $extension = strtolower(end($nameDivision));

        if (!array_key_exists($extension, $this->extensionToDriver)) {
            throw $exception;
        }

        return $this->extensionToDriver[$extension];
    }
714207
private function startServer($driver = null)
    {
        if (! $driver) {
            $driver = $this->driver;
        }

        $this->info(sprintf('Starting %s server on: %s:%d', $this->option('driver'), $this->host, $this->port));

        $this->createServerInstance();

        $this->{'start'.$driver}()->run();
    }
1337851
public function setDriver($driver)
    {
        $availableDrivers = array(DataGridInterface::ARRAY_DRIVER, DataGridInterface::ORM_DRIVER);
        
        if (!in_array($driver, $availableDrivers)){
            throw new \InvalidArgumentException(sprintf('Driver %s is not available.', $driver));
        }
        
        $this->driver = $driver;
        
        return $this;
    }
413211
public function driver(?string $driver = null): self
    {
        $driver = $driver ? $driver : $this->app->make('config')->get('microservice-client.client');

        $connections = array_keys($this->app->make('config')->get('microservice-client.clients'));
        if (! in_array($driver, $connections, true)) {
            throw new DomainException("The Driver[{$driver}] not exists");
        }

        $this->driver = $driver;

        return $this;
    }
1167851
public function map($configuration)
	{
		foreach ($this->mappers as $mapper)
			if ($mapper->isAppropriateFor($configuration))
				return $mapper->map($configuration);

		throw new Exception("Driver {$configuration['driver']} unsupported by package at this time.");
	}
777054
protected function createDriver($driver)
    {
        if (isset($this->initialDrivers[$driver])) {
            $provider = $this->initialDrivers[$driver];
            $provider = __NAMESPACE__.'\\Providers\\'.$provider.'Provider';

            return $this->buildProvider($provider, $this->formatConfig($this->config->get($driver)));
        }

        if (isset($this->customCreators[$driver])) {
            return $this->callCustomCreator($driver);
        }

        throw new InvalidArgumentException("Driver [$driver] not supported.");
    }
869625
public function addClassListeners($instance)
    {
        if (!$this->driver) {
            throw Exception::noDriver();
        }
        
        foreach ($this->driver->getListenersForClass($instance) as $listener) {
            $this->addListener($listener['event'], array($instance, $listener['method']));
        }
    }
1160911
public function setCache($cache)
    {
        if ($cache instanceof Cache ||
            (class_exists('\Doctrine\Common\Cache\CacheProvider') && $cache instanceof \Doctrine\Common\Cache\CacheProvider)
        ) {
            $this->cache = $cache;
            return;
        }

        throw new \Exception('Cache not supported');
    }
327032
protected function createDriver($driver)
    {
        $name = "orchestra.publisher.{$driver}";

        if (! $this->app->bound($name)) {
            throw new RuntimeException("Unable to resolve [{$driver}] publisher");
        }

        return $this->app->make($name);
    }
391193
private function registerDriver($driver, array $configs)
    {
        $this->extend($driver, function () use ($configs) {
            return new $configs['driver'](
                $this->app, Arr::get($configs, 'options', [])
            );
        });
    }
152723
public void setDriverClassName(String driver)
    {
        try
        {
            this.driver = (Driver) Class.forName(driver).newInstance();
        }
        catch (Exception e)
        {
            throw new RuntimeException("Unable to load driver: " + driver, e);
        }
    }
1028829
public function updateDriver($driver, array $settings = [])
    {
        $this->validateDriver($driver);
        $this->driversToUpdate[$driver] = $settings;
    }
610178
public void setDriver(Driver driver) {
    this.driver = driver;
    try {
      DriverManager.registerDriver(driver);
    } catch (SQLException e) {
      throw new GenException(Message.DOMAGEN9001, e, e);
    }
  }
511366
public function driver( $driver = null )
	{
		$driver = strtolower( $driver ?: $this->getDefaultDriver() );

		// If the given driver has not been created before, we will create the instances
		// here and cache it so we can return it next time very quickly. If there is
		// already a driver created by this name, we'll just return that instance.
		if ( !array_key_exists( $driver, $this->drivers ) )
			$this->drivers[$driver] = $this->createDriver( $driver );

		return $this->drivers[$driver];
	}