Downloading driver.

@param $client

@return bool|string
3312
protected function download($client)
    {
        $resource = base_path('vendor/bin/driver-file');

        if (is_file(base_path("vendor/bin/{$this->getFileName()}"))) {
            if (!$this->confirm(ucfirst($this->argument('driver')).' web driver file already exists. Would you still like to download it?')) {
                return false;
            }
        }

        $this->info("Downloading {$this->driver} web driver for {$this->userOS}...");

        $resource .= $this->getExtension();

        // Downloading Driver
        $client->request('get', $this->getConfig()['url'], [
            'save_to' => \GuzzleHttp\Psr7\stream_for(fopen($resource, 'w')),
        ]);

        return $resource;
    }
1076066
public function driver($name = null)
    {
        $name = $name ?: $this->getDefaultDriver();

        if (isset($this->drivers[$name])) {
            return $this->drivers[$name];
        }

        return $this->drivers[$name] = $this->resolve($name);
    }
1301523
public function setHttpClient(Client $client = null)
    {
        if ($client === null) {
            $client = new Client(
                HttpClientDiscovery::find(),
                MessageFactoryDiscovery::find()
            );
        }
        $this->client = $client;
        return $this;
    }
591216
public function setClient(Client $client)
    {
        // Assign the client.
        $this->client = $client;
        $this->client->setDefaultOption('headers', ['Content-Type' => 'application/json']);

        // Allow chaining.
        return $this;
    }
596007
protected function createClient($client)
    {
        try {
            new \ReflectionClass($client);
        } catch (\ReflectionException $e) {
            throw new FoundationException(sprintf("Could not load class '%s'.", $client), null, $e);
        }

        $client_instance = new $client();

        return $client_instance;
    }
384485
public function createClientUrl($client)
    {
        $this->autoRender = false;
        $url = $this->getBaseAuthUrl();
        $url[$this->clientIdGetParamName] = $client->getId();

        return Url::to($url);
    }
885884
public function setClient(\Yurun\Swoole\SharedMemory\Client\Client $client)
    {
        $this->client = $client;

        return $this;
    }
983770
protected function configureClient(Client $client, array $settings)
    {
        $configuredClient = $client ?: new Client();

        // Set authentication, if necessary:
        if (!empty($settings['httpUser']) && !empty($settings['httpPass'])) {
            $configuredClient->setAuth($settings['httpUser'], $settings['httpPass']);
        }

        // Set up assorted client options from $settings array:
        $configuredClient->setOptions($this->getClientOptions($settings));

        return $configuredClient;
    }
205392
private function downloadFile($source)
    {
        $tmpFile = tempnam(sys_get_temp_dir(), 'maxmind_geoip2_');
        if (strpos($source, 'tar.gz') !== false) {
            @rename($tmpFile, $tmpFile.'.tar.gz');
            $tmpFile .= '.tar.gz';
        }

        if (!@copy($source, $tmpFile)) {
            return false;
        }

        return $tmpFile;
    }
61971
public function getDriverName(): string {
		$classNameInfo = explode('\\', get_class($this->driver));
		return strtolower(end($classNameInfo));
	}
802898
public function getGuzzle()
    {

        if ($this->guzzle)
            return $this->guzzle;

        $this->guzzle = new Client();

        return $this->guzzle;

    }
438430
protected function createLaravelDriver(): Sdk\Client
    {
        return \tap($this->createHttpClient(), function ($client) {
            if (isset($this->config['client_id']) || isset($this->config['client_secret'])) {
                $client->setClientId($this->config['client_id'])
                        ->setClientSecret($this->config['client_secret']);
            }

            if (isset($this->config['access_token'])) {
                $client->setAccessToken($this->config['access_token']);
            }
        });
    }
1061098
function hasClient($clientName)
    {
        if (! isset($this->clients[$clientName]) ) {
            // Lookup for lazy client options
            try {
                $exists = true;
                $this->getClient($clientName);
            } catch (\Exception $e) {
                $exists = false;
            }

            return $exists;
        }

        $exists = array_key_exists($clientName, $this->lazyClientOptions);
        return $exists;
    }
942539
public function removeClient(\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Client\Client $client)
    {
        return $this->clients->removeElement($client);
    }
1138734
public function setClient($client)
    {
        if ($client instanceof Client && $this->client != $client) {
            $this->configureDefaults($client->getMessageDefaults(), true);
        }

        $this->client = $client;

        return $this;
    }
492039
public function download()
    {
        foreach ($this->children as $child) {
            if ($child instanceof DownloadableClientInterface) {
                return $child->download();
            }
        }

        throw MissingDownloadableClientsException::create();
    }
228765
public function createClient() {
        $this->client = $this->getKernel()->getContainer()->get('test.client');
        $client = $this->client;
        return $client;
    }