Commit e89082e3 by Taylor Otwell

fix possible problem in provider zip extraction.

parent 56ae5e9a
...@@ -30,7 +30,7 @@ abstract class Provider { ...@@ -30,7 +30,7 @@ abstract class Provider {
// we have a spot to do all of our bundle extration work. // we have a spot to do all of our bundle extration work.
$target = $work.'laravel-bundle.zip'; $target = $work.'laravel-bundle.zip';
File::put($target, file_get_contents($url)); File::put($target, $this->download($url));
$zip = new \ZipArchive; $zip = new \ZipArchive;
...@@ -54,4 +54,25 @@ abstract class Provider { ...@@ -54,4 +54,25 @@ abstract class Provider {
@unlink($target); @unlink($target);
} }
/**
* Download a remote zip archive from a URL.
*
* @param string $url
* @return string
*/
protected function download($url)
{
$remote = file_get_contents($url);
// If we were unable to download the zip archive correctly
// we'll bomb out since we don't want to extract the last
// zip that was put in the storage directory.
if ($remote === false)
{
throw new \Exception("Error downloading bundle [{$bundle}].");
}
return $remote;
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment