Create and set the REST driver to be used.

@param string $restDriver REST driver class name
427907
private function setRestDriver($restDriver)
    {
        $namespace = '\\' . __NAMESPACE__ . '\\RestClient\\';
        $driver = $namespace . $restDriver;
        $parent = $namespace . 'DriverInterface';

        if (
            empty($restDriver)
            || !class_exists($driver)
            || !is_subclass_of($driver, $parent)
        ) {
            throw new InvalidArgumentException('rest driver', $driver);
        }

        // create a new REST Driver
        $this->restDriver = new $driver();
        if (isset($this->url)) {
            $this->restDriver->setHost($this->url);
        }
    }
329348
protected function setup_driver( &$driver )
	{
		if ( !is_null( $this->config->path ) )
		{
			$driver->Sendmail = $this->config->path;
		}
	}
932404
protected function createDriver($driver)
    {
        if (isset($this->customCreators[ $driver ])) {
            return $this->callCustomCreator($driver);
        }

        return $this->buildCustomProvider($driver);
    }
454139
protected function createDriver($driver, array $settings = [], $resolve = true)
    {
        $class = $this->getNamespace() . '\\' . studly_case($driver) . $this->getClassSuffix();

        // 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[$driver])) {
            return $this->callCustomCreator($driver, $settings);
        } elseif (class_exists($class)) {
            $instance = $this->container->make($class);

            if ($resolve) {
                return $instance->resolve($settings);
            }

            return $instance;
        }

        throw new DriverNotFound("Driver [$driver] not supported.");
    }
838180
public function createDriver() : Driver
    {
        $classname = '\ntentan\atiaa\drivers\\'.Text::ucamelize($this->config['driver']).'Driver';

        return new $classname($this->config);
    }
1065515
public function driver(string $driver)
    {
        if (isset($this->drivers[$driver])) {
            $provider = $driver . 'Provider';
            if (method_exists($this, $provider)) {
                return $this->$provider();
            }

            return new $this->drivers[$driver](
                $this->getRequest(),
                $this->config,
                $this->getSession()
            );
        }

        if (class_exists($driver)) {
            $driver = new $driver(
                $this->getRequest(),
                $this->config,
                $this->getSession()
            );

            if ($driver instanceof Two\AbstractProvider) {
                return $driver;
            }
        }

        throw new \InvalidArgumentException("Driver not supported.");
    }
933307
protected function createDriver($driver)
    {
        try {
            return parent::createDriver($driver);
        } catch (Exception $e) {
            if ($newDriver = $this->nextDriver($driver)) {
                return $this->createDriver($newDriver);
            }
            throw $e;
        }
    }
948355
public function addMatcherDriver(MatcherDriver $driver): void
    {
        if (!in_array($driver, $this->drivers, true)) {
            $this->drivers[] = $driver;

            if ($driver->isAvailable()) {
                foreach ($driver->matcherClassNames() as $className) {
                    $this->driverIndex[$className] = $driver;
                }
            }
        }
    }
947180
private function setDriver($driver = null, $config = null)
    {
        $driver = $driver ?: ($this->driver ?: 'Local');
        $config = $config ?: ($this->driverConfig ?: 'Local');
        $class = strpos($driver, '\\') ? $driver : 'PHPCasts\\Uploads\\Driver\\' . ucfirst(strtolower($driver));
        $this->uploader = new $class($config);
        if (!$this->uploader) {
            throw new ConfigException('upload driver not exist!');
        }
    }
323119
public function startMinkSession($driver = '')
    {
        $this->stopMinkSession();
        $this->currentMinkDriver = $driver ? $driver : $this->currentMinkDriver;

        $driverInterface = $this->_getMinkDriver($this->currentMinkDriver);
        self::$minkSession = new \Behat\Mink\Session($driverInterface);
        self::$minkSession->start();
    }
513152
public function driver($driver = null)
    {
        $driver = $driver ?: $this->getDefaultDriver();

        if (! isset($this->drivers[$driver])) {
            $this->drivers[$driver] = $this->createDriver($driver);
        }

        return $this->drivers[$driver];
    }
852110
public static function initialize()
    {
        self::$_restClient = new RestClient();
        self::$_config = new Config(null, self::$_restClient);
        self::$_restClient->setHttpParam('address', self::$_config->get('base_url'));
        self::$_manager = new Manager(self::$_restClient, self::$_config);
        Entity::setManager(self::$_manager);
    }
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;
	}
1067430
public static function setDriver(string $driver)
    {
        if ( ! self::isValidDriver($driver)) {
            throw new \InvalidArgumentException("invalid session driver '$driver'");
        }

        self::$driver = $driver;
    }
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.");
    }
293896
public function setDriver(array $params = [])
    {
        $driverName = !empty($params['driver']) ? $params['driver'] : 'local';

        $this->driver = new $driverName($params);
    }
708533
public function setDefaultDriverName($name)
    {
        $name = strtolower($name);

        if (!isset($this->drivers[$name])) {
            throw new \InvalidArgumentException(sprintf('Driver "%s" is not registered.', $name));
        }

        $this->defaultDriverName = $name;
    }