PhpBrew\Downloader\WgetCommandDownloader::process PHP Method

process() protected method

protected process ( string $url, $targetFilePath ) : boolean | string
$url string
return boolean | string
    protected function process($url, $targetFilePath)
    {
        $this->logger->info("Downloading {$url} via wget command");
        $proxy = '';
        if (!empty($this->options->{'http-proxy'})) {
            if (!empty($this->options->{'http-proxy-auth'})) {
                $proxy = sprintf('-e use_proxy=on -e http_proxy=%s', $this->options->{'http-proxy'});
            } else {
                $proxy = sprintf('-e use_proxy=on -e http_proxy=%s@%s', $this->options->{'http-proxy-auth'}, $this->options->{'http-proxy'});
            }
        }
        $quiet = $this->logger->isQuiet() ? '--quiet' : '';
        $continue = $this->enableContinueAt || $this->options->{'continue'} ? '-c' : '';
        Utils::system(sprintf('wget --no-check-certificate %s %s %s -N -O %s %s', $continue, $quiet, $proxy, escapeshellarg($targetFilePath), escapeshellarg($url)));
        return true;
    }