diff --git a/.docker/99-xdebug.ini b/.docker/99-xdebug.ini new file mode 100644 index 000000000..fe58b1883 --- /dev/null +++ b/.docker/99-xdebug.ini @@ -0,0 +1,6 @@ +[xdebug] +xdebug.mode=develop,debug +xdebug.start_with_request=yes +xdebug.log=/tmp/xdebug.log +xdebug.client_port=9003 +xdebug.client_host=host.docker.internal \ No newline at end of file diff --git a/.gitignore b/.gitignore index 2129d25c8..72896dade 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ docker-compose.yml !public/tmp/.gitkeep /.idea/* +/.vscode/* ###> lexik/jwt-authentication-bundle ### /config/jwt/* ###< lexik/jwt-authentication-bundle ### diff --git a/Dockerfile.dev b/Dockerfile.dev index 545d085a9..8ded0137b 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -44,6 +44,7 @@ RUN apt-get update && \ php8.4-zip \ php8.4-fpm \ php8.4-intl \ + php8.4-xdebug \ nodejs && \ corepack enable && \ #Install composer dependencies diff --git a/src/Enum/DatumTypeEnum.php b/src/Enum/DatumTypeEnum.php index 5c9186e0f..b052ba6a4 100755 --- a/src/Enum/DatumTypeEnum.php +++ b/src/Enum/DatumTypeEnum.php @@ -101,6 +101,7 @@ class DatumTypeEnum self::TYPE_COUNTRY, self::TYPE_LINK, self::TYPE_IMAGE, + self::TYPE_PRICE, ]; public const array AVAILABLE_FOR_SEARCH = [ diff --git a/src/Model/Scraper/ItemScraperImporter.php b/src/Model/Scraper/ItemScraperImporter.php index c2515f762..c81943c7c 100644 --- a/src/Model/Scraper/ItemScraperImporter.php +++ b/src/Model/Scraper/ItemScraperImporter.php @@ -36,6 +36,7 @@ public function toScrapper(): Scraper $scraper->setName($data['name'] ?? null); $scraper->setNamePath($data['namePath'] ?? null); $scraper->setImagePath($data['imagePath'] ?? null); + $scraper->setPricePath($data['pricePath'] ?? null); $scraper->setUrlPattern($data['urlPattern'] ?? null); $scraper->setType(ScraperTypeEnum::TYPE_ITEM); diff --git a/src/Service/Scraper/HtmlScraper.php b/src/Service/Scraper/HtmlScraper.php index f2b034fd4..0ae655960 100644 --- a/src/Service/Scraper/HtmlScraper.php +++ b/src/Service/Scraper/HtmlScraper.php @@ -162,6 +162,10 @@ protected function formatValues(?array $values, string $type, $scraping): ?strin return $this->guessHost($values[0], $scraping); } + if ($type === DatumTypeEnum::TYPE_PRICE) { + return $values[0]; + } + return null; }