Added:
- FileSystemManager.php refactoring of all write/read actions on filesystem Deleted: - old ToolbarManager.php
This commit is contained in:
@@ -13,17 +13,6 @@ use Symfony\Component\DomCrawler\Crawler;
|
||||
|
||||
class HtmlScraper extends AbstractScraper
|
||||
{
|
||||
private Client $client;
|
||||
|
||||
public function __construct(
|
||||
string $projectDir,
|
||||
EventDispatcherInterface $eventDispatcher,
|
||||
EntityManagerInterface $entityManager
|
||||
) {
|
||||
parent::__construct($projectDir, $eventDispatcher, $entityManager);
|
||||
$this->client = new Client();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
* @throws GuzzleException
|
||||
@@ -64,7 +53,7 @@ class HtmlScraper extends AbstractScraper
|
||||
}
|
||||
|
||||
$cbzFilePath = $this->generateCbzPath($manga, $chapter);
|
||||
$this->createCbzFile($tempDir, $pageData, $cbzFilePath);
|
||||
$this->createCbzFile($pageData, $cbzFilePath);
|
||||
|
||||
$chapter->setCbzPath($cbzFilePath);
|
||||
$this->entityManager->persist($chapter);
|
||||
@@ -144,7 +133,7 @@ class HtmlScraper extends AbstractScraper
|
||||
private function fetchHtml(string $url): string
|
||||
{
|
||||
try {
|
||||
$response = $this->client->get($url, [
|
||||
$response = $this->httpClient->get($url, [
|
||||
'http_errors' => true,
|
||||
'allow_redirects' => false
|
||||
]);
|
||||
|
||||
Reference in New Issue
Block a user