From d36226e530530cb7d024ad220cacd8a340a09a0d Mon Sep 17 00:00:00 2001 From: Dylan Van Brugghe Date: Mon, 29 Dec 2025 21:52:29 +0100 Subject: [PATCH 1/4] Enabled Xdebug debugging for VSCode --- .docker/99-xdebug.ini | 7 +++++++ .vscode/launch.json | 17 +++++++++++++++++ Dockerfile.dev | 1 + 3 files changed, 25 insertions(+) create mode 100644 .docker/99-xdebug.ini create mode 100644 .vscode/launch.json diff --git a/.docker/99-xdebug.ini b/.docker/99-xdebug.ini new file mode 100644 index 000000000..9e18c8890 --- /dev/null +++ b/.docker/99-xdebug.ini @@ -0,0 +1,7 @@ +[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 +xdebug.idekey=VSCODE \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..2a6d34f7d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,17 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Listen for XDebug on Docker", + "type": "php", + "request": "launch", + "port": 9003, + "pathMappings": { + "/var/www/koillection": "${workspaceRoot}" + } + } + ] +} \ No newline at end of file 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 From 91bac98391196277753ae68a12b2a927eb3c5754 Mon Sep 17 00:00:00 2001 From: Dylan Van Brugghe Date: Mon, 29 Dec 2025 22:49:56 +0100 Subject: [PATCH 2/4] Added ability to scrape price-field values --- src/Enum/DatumTypeEnum.php | 1 + src/Model/Scraper/ItemScraperImporter.php | 1 + src/Service/Scraper/HtmlScraper.php | 4 ++++ 3 files changed, 6 insertions(+) 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; } From 9342aba1b0abcbb07c5e34d36875f82d35bd665f Mon Sep 17 00:00:00 2001 From: Dylan Van Brugghe Date: Mon, 29 Dec 2025 23:15:21 +0100 Subject: [PATCH 3/4] Added .vscode to gitignore and removed xdebug idekey --- .docker/99-xdebug.ini | 3 +-- .gitignore | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.docker/99-xdebug.ini b/.docker/99-xdebug.ini index 9e18c8890..fe58b1883 100644 --- a/.docker/99-xdebug.ini +++ b/.docker/99-xdebug.ini @@ -3,5 +3,4 @@ xdebug.mode=develop,debug xdebug.start_with_request=yes xdebug.log=/tmp/xdebug.log xdebug.client_port=9003 -xdebug.client_host=host.docker.internal -xdebug.idekey=VSCODE \ No newline at end of file +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 ### From 3863dbe6de588ba3d4d3e120e8f63cc00a61c4a4 Mon Sep 17 00:00:00 2001 From: Dylan Van Brugghe Date: Mon, 29 Dec 2025 23:29:28 +0100 Subject: [PATCH 4/4] Removed launch.json after adding to gitignore --- .vscode/launch.json | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 .vscode/launch.json diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 2a6d34f7d..000000000 --- a/.vscode/launch.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - // Use IntelliSense to learn about possible attributes. - // Hover to view descriptions of existing attributes. - // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 - "version": "0.2.0", - "configurations": [ - { - "name": "Listen for XDebug on Docker", - "type": "php", - "request": "launch", - "port": 9003, - "pathMappings": { - "/var/www/koillection": "${workspaceRoot}" - } - } - ] -} \ No newline at end of file