diff --git a/src/Composer/Downloader/AbstractDownloader.php b/src/Composer/Downloader/AbstractDownloader.php deleted file mode 100644 index 3104be3f5..000000000 --- a/src/Composer/Downloader/AbstractDownloader.php +++ /dev/null @@ -1,37 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Downloader; - -use Composer\Package\PackageInterface; - -/** - * @author Jordi Boggiano - * @author Benjamin Eberlei - */ -abstract class AbstractDownloader -{ - protected function downloadFile($url, $path) - { - $file = fopen($url, "rb"); - if ($file) { - $newf = fopen($path, "wb"); - if ($newf) { - while (!feof($file)) { - fwrite($newf, fread($file, 1024 * 8), 1024 * 8); - } - fclose($newf); - } - fclose($file); - } - } -} \ No newline at end of file diff --git a/src/Composer/Downloader/PearDownloader.php b/src/Composer/Downloader/PearDownloader.php index 1cce75632..8f3645e6a 100644 --- a/src/Composer/Downloader/PearDownloader.php +++ b/src/Composer/Downloader/PearDownloader.php @@ -32,13 +32,13 @@ class PearDownloader extends AbstractDownloader } $tmpName = tempnam(sys_get_temp_dir(), ''); - $this->downloadFile($package->getSourceUrl(), $tmpName); + copy($package->getSourceUrl(), $tmpName); if (!file_exists($tmpName)) { throw new \UnexpectedValueException($package->getName().' could not be saved into '.$tmpName.', make sure the' .' directory is writable and you have internet connectivity.'); } - + $cwd = getcwd(); chdir($path); system('tar xzf '.escapeshellarg($tmpName));