mirror of
https://github.com/jbcr/core.git
synced 2026-04-26 01:58:15 +02:00
Use Symfony/HttpClient instead of Guzzle
This commit is contained in:
@@ -7,10 +7,10 @@ namespace Bolt\DataFixtures;
|
||||
use Bolt\Configuration\FileLocations;
|
||||
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
|
||||
use Doctrine\Common\Persistence\ObjectManager;
|
||||
use GuzzleHttp\Client;
|
||||
use Illuminate\Support\Collection;
|
||||
use Symfony\Component\Console\Helper\ProgressBar;
|
||||
use Symfony\Component\Console\Output\ConsoleOutput;
|
||||
use Symfony\Component\HttpClient\HttpClient;
|
||||
|
||||
class ImageFetchFixtures extends BaseFixture implements FixtureGroupInterface
|
||||
{
|
||||
@@ -67,9 +67,10 @@ class ImageFetchFixtures extends BaseFixture implements FixtureGroupInterface
|
||||
$url = $this->urls->random() . random_int(10000, 99999);
|
||||
$filename = 'image_' . random_int(10000, 99999) . '.jpg';
|
||||
|
||||
$client = new Client();
|
||||
$client = HttpClient::create();
|
||||
$resource = fopen($outputPath . $filename, 'w');
|
||||
$client->request('GET', $url, ['sink' => $resource]);
|
||||
fwrite($resource, $client->request('GET', $url)->getContent());
|
||||
fclose($resource);
|
||||
|
||||
$progressBar->advance();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user