@param $driver

@throws NotSupportedDriverException
508444
private function setDriver($driver)
    {
        $allowedDrivers = [
            'apcu',
            'memcached',
            'pdo',
            'redis',
        ];

        if (!in_array($driver, $allowedDrivers)) {
            throw new NotSupportedDriverException($driver.' is not a supported driver.');
        }

        $this->driver = $driver;
    }
686975
public function loadDriver(string $key): DriverInterface
    {
        if (!$this->hasDriver($key)) {
            throw new DriverNotFoundException('Driver you are looking for doesn\'t exist. Make sure that ' . $key . ' driver is properly configured.');
        }

        return $this->drivers[$key]::install($this);
    }
599400
public static function setDriver($driver, $env = null)
    {
        $file = realpath(dirname(__FILE__)."/../drivers/$driver.php");
        if (!file_exists($file)) {
            Log::log("ERROR: Driver file $file does not exists");
            return null;
        }
        self::$_driver[self::selectEnvironment($env)] = $driver;
        include_once $file;
    }
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();
    }
1310624
public function driver( $driver )
	{
		$driver = CCCORE_NAMESPACE.'\\'.'CCConfig_'.ucfirst( $driver );
		
		if ( !class_exists( $driver ) ) 
		{
			throw new \InvalidArgumentException("CCConfig - Invalid driver '".$driver."'");
		}
		
		$this->_driver = new $driver;
	}
163864
public function get(string $key): DriverInterface
    {
        if (!$this->has($key)) {
            throw new DriverNotFoundException('Driver you are looking for doesn\'t exist. Make sure that ' . $key . ' driver is properly configured.');
        }

        return $this->drivers[$key]::install($this->appConfiguration);
    }
1342748
public static function setDriver($driver)
        {
            if (self::isDriverSupported($driver) == false) {
                throw new Exception('The selected database is not supported: "' . $driver . '".');
            }
            self::$driver = $driver;
        }
275892
protected function setup_driver( &$driver )
	{
		$driver->IsSMTP(); 
		$driver->Host = $this->config->host;
		
		// smtp auth?
		if ( $this->config->auth === true ) 
		{
			$driver->SMTPAuth = true;
			$driver->Username = $this->config->user;
			$driver->Password = $this->config->pass;
		}
		
		$driver->SMTPSecure = $this->config->encryption;
		$driver->Port = $this->config->port;
	}
611454
public static function unloadDriver($driver)
    {
        foreach (array_keys(self::$drivers, $driver) as $key) {
            unset(self::$drivers[$key]);
        }
    }
628255
public function remove(string $key): void
    {
        if (!$this->has($key)) {
            throw new DriverNotFoundException('Driver you are looking for doesn\'t exist. Make sure that ' . $key . ' driver is properly configured.');
        }

        unset($this->drivers[$key]);
    }
527824
public function appendToBackupDrivers($driver)
    {
        if ($driver instanceof Driver) {
            $driver = $driver->name;
        }
        if (!in_array($driver, $this->backupDrivers)) {
            array_push($this->backupDrivers, $driver);
        }
    }
852555
public function setDriver($driver) {

    	if(false === is_string($driver)) {
    		return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($driver)), E_USER_ERROR);
    	}

        if(false === class_exists($driver)) {

            $driver = __NAMESPACE__ . '\\Driver\\' . $driver;
        
            if(false === class_exists($driver)) {
        		return trigger_error(sprintf('Driver "%s" does not exists', $driver), E_USER_ERROR);
        	}
        }

        $this -> driver = $driver;

        return $this;
    }
11391
private void loadDriver(String driver) throws IOException {
        if (driver != null) {
            try {
                Class.forName(driver);
            } catch (ClassNotFoundException e) {
                throw new IOException(driver + " cannot be loaded, skipping scan of schema.", e);
            }
        }
    }
70250
public function setDriver($name)
    {
        $class = '\\Samurai\\Onikiri\\Driver\\' . ucfirst($name) . 'Driver';
        if (! class_exists($class)) throw new \InvalidArgumentException("No such driver. -> {$name}");
        
        $driver = new $class();
        $this->driver = $driver;
    }
1221955
protected function createDriver($driver)
    {
        $config = config("payments.{$driver}", null);
        if (is_string($config)) {
            return $this->createDriver($config);
        }
        if ($config === null) {
            throw new InvalidArgumentException("Driver [$driver] not supported.");
        }
        $provider = $config['provider'] ?? null;

        // We'll check to see if a creator method exists for the given driver. If not we
        // will check for a custom driver creator, which allows developers to create
        // drivers using their own customized driver creator Closure to create it.
        if (isset($this->customCreators[$provider])) {
            $config['shop'] = $driver;
            return tap(
                $this->callCustomCreator($provider, $config),
                function (PaymentProviderInterface $provider) use ($driver) {
                    $provider->setLogger(
                        new Logger($driver, [new RotatingFileHandler(storage_path("logs/{$driver}.log"))])
                    );
                }
            );
        }
        throw new InvalidArgumentException("Provider [$provider] not supported.");
    }
921291
public function removeFromBackupDrivers($driver)
    {
        if ($driver instanceof Driver) {
            $driver = $driver->name;
        }
        if (in_array($driver, $this->backupDrivers)) {
            $index = array_search($driver, $this->backupDrivers);
            array_splice($this->backupDrivers, $index, 1);
        }
    }
660887
protected function validateDriver($driver)
    {
        $interface = $this->interface();

        if (! (new ReflectionClass($driver))->implementsInterface($interface)) {
            throw new InvalidDriverException(get_class($driver)." does not implement {$interface}");
        }

        return $driver;
    }