Skip to content

Commit

Permalink
feat: split downloading data and rendering page into separate scripts
Browse files Browse the repository at this point in the history
Related: #2
  • Loading branch information
JanWennrich committed Oct 19, 2024
1 parent c363178 commit bb0f8a6
Show file tree
Hide file tree
Showing 15 changed files with 219 additions and 65 deletions.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
build-page:
$(MAKE) clean
$(MAKE) download-bgg-data
$(MAKE) generate-html

download-bgg-data:
php download-bgg-data.php
generate-html:
$(MAKE) clean
mkdir build
php generate-html.php > build/index.html
php generate-html.php
cp -r assets/* build/
clean:
rm -rf build
1 change: 1 addition & 0 deletions assets/boardgames-owned.serialized.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
O:42:"JanWennrich\BoardGames\BoardgameCollection":44:{i:0;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:34:"Adventure Games: Expedition Azcana";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/1eAiUKQz8FzuqokQEKNn8Q__thumb/img/xE9uQkxgc_Rj59BtbP8TLzlS0RQ=/fit-in/200x150/filters:strip_icc()/pic6881571.jpg";}i:1;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:30:"Adventure Games: Im Nebelreich";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/hokAc4M0sSShWHlWRU3wNQ__thumb/img/fBoTEFy9dnrIJ_ry57Iezenpnxg=/fit-in/200x150/filters:strip_icc()/pic6482624.jpg";}i:2;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:32:"Adventure Games: Monochrome Inc.";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/43pBOAx1RiVj4CB9twXErw__thumb/img/0FemvM2YohBC0RZGQfc7s5c2Of4=/fit-in/200x150/filters:strip_icc()/pic4597112.jpg";}i:3;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:28:"Adventure Games: The Dungeon";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/YdQ2gMORorqOgEecLAm-cA__thumb/img/wmgERsyZjtOyBnOAFaC0ttZwV0Y=/fit-in/200x150/filters:strip_icc()/pic7056314.jpg";}i:4;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:36:"Adventure Games: The Gloom City File";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/voSgOcpYelkNfpmeQWgOAA__thumb/img/D_RMRpF340Etb0KMgfkM4wmPRE4=/fit-in/200x150/filters:strip_icc()/pic6630213.jpg";}i:5;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:40:"Adventure Games: The Grand Hotel Abaddon";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/dKRPsLgTrkFVAwUqU4BBqQ__thumb/img/u2VDEylxdcE3AJlrVL3iWzYatFQ=/fit-in/200x150/filters:strip_icc()/pic6210950.jpg";}i:6;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:36:"Adventure Games: The Volcanic Island";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/8fchTYyEfkzZ9ZWj8xsVPQ__thumb/img/3JkrMAzE8RNk0hkXdKS6tfwNVqc=/fit-in/200x150/filters:strip_icc()/pic5145286.jpg";}i:7;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:13:"Black Stories";s:12:"thumbnailUrl";s:140:"https://cf.geekdo-images.com/NPnm8Pz2-uvMsbeptOX0fw__thumb/img/DusuyQ7kHboKxDKt70GOvbsEck8=/fit-in/200x150/filters:strip_icc()/pic208686.jpg";}i:8;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:28:"Black Stories: Movie Edition";s:12:"thumbnailUrl";s:140:"https://cf.geekdo-images.com/zE5k42_3u83WePAvuvB2ZA__thumb/img/3byVSPNU9LaEzqh8ObS1InweAfA=/fit-in/200x150/filters:strip_icc()/pic628264.jpg";}i:9;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:23:"Cartaventura: Hollywood";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/DpgHUfAV1ccLT8hl-6v63Q__thumb/img/owUNNZwgCV9oA0ZPEH2EDkrsFLk=/fit-in/200x150/filters:strip_icc()/pic7042265.jpg";}i:10;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:21:"Cartaventura: Vinland";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/oF6c53g6uloTuY8l2o19Fg__thumb/img/lkksBKC3VcYmd2f4HjaH3JkzAjE=/fit-in/200x150/filters:strip_icc()/pic6630228.jpg";}i:11;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:13:"Cartographers";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/GifbnAmsA4lfEcDkeaC9VA__thumb/img/TTxZzwbna07hMcPQ0xaFtT10egE=/fit-in/200x150/filters:strip_icc()/pic4397932.png";}i:12;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:8:"Cascadia";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/MjeJZfulbsM1DSV3DrGJYA__thumb/img/tVSFjSxYEcw7sKj3unIIQV8kxoc=/fit-in/200x150/filters:strip_icc()/pic5100691.jpg";}i:13;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:5:"CATAN";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/W3Bsga_uLP9kO91gZ7H8yw__thumb/img/8a9HeqFydO7Uun_le9bXWPnidcA=/fit-in/200x150/filters:strip_icc()/pic2419375.jpg";}i:14;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:16:"CATAN: Seafarers";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/yO6X6iObEb7PtECKCagMKg__thumb/img/sADKPjQ9M3aZgwONMdYvPgmme6c=/fit-in/200x150/filters:strip_icc()/pic2420293.jpg";}i:15;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:7:"Cracked";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/Id0oqQ8eTK4ilrNB51UN-A__thumb/img/-fnR2W99CmeSK1mshgiKLRVx-CY=/fit-in/200x150/filters:strip_icc()/pic4953267.jpg";}i:16;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:11:"Do De Li Do";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/KKL-2QVDa4wa7he4iR28iw__thumb/img/RDmrT9YBcQwViIfnWFy8CR3xs-0=/fit-in/200x150/filters:strip_icc()/pic3240504.jpg";}i:17;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:25:"Dominion (Second Edition)";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/4dmyKfqQm_uxA1-chh4JeQ__thumb/img/Td5CxjO0ZTIbwHNhk2ETEy1qYyg=/fit-in/200x150/filters:strip_icc()/pic3187001.jpg";}i:18;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:18:"Dominion: Nocturne";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/V7tSsQGq_ADFByx5dvTb7w__thumb/img/x_S9T5ktKnDfH4sJG7FUlkz3o-M=/fit-in/200x150/filters:strip_icc()/pic3677538.jpg";}i:19;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:12:"Encyclopedia";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/sL-5ZjHTK3EUJDiv0tlilg__thumb/img/fVuKUiBB4TdNM7_q8KGFasCIuDc=/fit-in/200x150/filters:strip_icc()/pic6515523.png";}i:20;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:46:"Exit: The Game – The Professor's Last Riddle";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/0EcFnlbxRBajJkTqTdYhrg__thumb/img/oig4cEskzOBMNo_AQz5Rhb2q758=/fit-in/200x150/filters:strip_icc()/pic7233514.jpg";}i:21;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:17:"Exploding Kittens";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/N8bL53-pRU7zaXDTrEaYrw__thumb/img/3tH4pIc1Udzkd0tXc6MgVQ59BC0=/fit-in/200x150/filters:strip_icc()/pic2691976.png";}i:22;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:14:"Fantasy Realms";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/A7IOpPt-lHrMYsbRmxXWdQ__thumb/img/XoD3fXgApfY7-dfYyFeE6FVkbfY=/fit-in/200x150/filters:strip_icc()/pic6177962.jpg";}i:23;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:10:"Final Girl";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/TUtzY-F7gKTIKm9y8e1AQw__thumb/img/CVgcWusAt0oVteoy0XYmsFmhfQY=/fit-in/200x150/filters:strip_icc()/pic6520382.jpg";}i:24;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:35:"Final Girl: Carnage at the Carnival";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/iEGnWjR-7V4dcnN-c6-GJQ__thumb/img/x9kQ9OcO0dC_jL5dHofu0Ywe3-w=/fit-in/200x150/filters:strip_icc()/pic7486293.jpg";}i:25;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:11:"Halli Galli";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/gm-LiZvjkluOeKqPvuUjDg__thumb/img/eTHCJERXOmqmzJP-b0QQCChDhn8=/fit-in/200x150/filters:strip_icc()/pic8223481.jpg";}i:26;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:12:"ISS Vanguard";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/1ySeZNVkVwTvqykMGtHFFQ__thumb/img/pXp7JQo64YalithQyDM7tufyasA=/fit-in/200x150/filters:strip_icc()/pic7245199.jpg";}i:27;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:12:"Jungle Speed";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/pb553nZgH3akaF24MzT7nA__thumb/img/Clb-hjbKmSJcl6U6UJMqAz0Kxy0=/fit-in/200x150/filters:strip_icc()/pic4659199.jpg";}i:28;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:7:"Kayanak";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/WM7QkJWaWue1BZDUOX4LQQ__thumb/img/EnUyl_vpGRYu9rysrKDWM_tDqgc=/fit-in/200x150/filters:strip_icc()/pic1793211.jpg";}i:29;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:16:"Legends of Andor";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/IO8_BYKeofnWy8DIjo2RRg__thumb/img/pMbV-KGyO3D9U6hnBzNRfylZvto=/fit-in/200x150/filters:strip_icc()/pic2606106.jpg";}i:30;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:21:"The Lord of the Rings";s:12:"thumbnailUrl";s:140:"https://cf.geekdo-images.com/oWttjfs235Zh7jLGWO7_Hg__thumb/img/D8T2cKo8fiipSbw4vNNP9hNbZ0g=/fit-in/200x150/filters:strip_icc()/pic479124.jpg";}i:31;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:7:"Malefiz";s:12:"thumbnailUrl";s:140:"https://cf.geekdo-images.com/K7Y8l0NtpKVxiO8c1h3KSw__thumb/img/bWQOrZtgu4t5xx4uFb82Uc0f_oU=/fit-in/200x150/filters:strip_icc()/pic276070.jpg";}i:32;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:24:"Monopoly: Sankt Augustin";s:12:"thumbnailUrl";s:0:"";}i:33;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:12:"My First UNO";s:12:"thumbnailUrl";s:139:"https://cf.geekdo-images.com/J3A5pcnWEDIE-4L4VlC15Q__thumb/img/ZxUfE9sxI1Ptree81n6ccUff28Y=/fit-in/200x150/filters:strip_icc()/pic39522.jpg";}i:34;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:14:"Mysterium Park";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/U2CYPYgIEC1cLF45Rh0UGw__thumb/img/bTRB0-Qnb-tvrYxN3vJJZRBEZ1s=/fit-in/200x150/filters:strip_icc()/pic5581038.jpg";}i:35;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:8:"Phase 10";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/jvHGs95ShI8VEhDBdxKs6w__thumb/img/mjMr9BgjDUiz1ITatBLPOMe-QOw=/fit-in/200x150/filters:strip_icc()/pic7621070.png";}i:36;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:14:"Rolling Realms";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/5TZ5YfDo_r9vNNvWTl_pzw__thumb/img/oKM1pAH4fCa7LCNluCqr9qNOq4M=/fit-in/200x150/filters:strip_icc()/pic6313647.jpg";}i:37;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:8:"Spot it!";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/AKdJV9CBlZBxH87EAfZ85A__thumb/img/MMvB9deDa-BgXcwyWIUsKleqbbU=/fit-in/200x150/filters:strip_icc()/pic7807049.jpg";}i:38;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:18:"Team Work Original";s:12:"thumbnailUrl";s:140:"https://cf.geekdo-images.com/LU0hePAznzHv41UlYLTykA__thumb/img/fFxE5whFKOfuVk-t9RSdmkWvpQg=/fit-in/200x150/filters:strip_icc()/pic916260.jpg";}i:39;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:16:"Trails of Tucana";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/y8ifesXfHobUtIgnSuC0DA__thumb/img/y5rGQUFTGETcIg9HSfuGnHkD234=/fit-in/200x150/filters:strip_icc()/pic4860701.jpg";}i:40;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:6:"Unfair";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/RQvdby3WmdROu05YFuxnqQ__thumb/img/RRVq0hk9d5X9QbshiIBeWXCdmSA=/fit-in/200x150/filters:strip_icc()/pic4717882.jpg";}i:41;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:33:"The Werewolves of Miller's Hollow";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/rZ0tOafAt1oue_7NKqELsg__thumb/img/jqycRUhCBZjq1E87oQVIFb1_j0A=/fit-in/200x150/filters:strip_icc()/pic7203269.jpg";}i:42;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:8:"Wingspan";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/yLZJCVLlIx4c7eJEWUNJ7w__thumb/img/VNToqgS2-pOGU6MuvIkMPKn_y-s=/fit-in/200x150/filters:strip_icc()/pic4458123.jpg";}i:43;O:32:"JanWennrich\BoardGames\Boardgame":2:{s:5:"title";s:28:"Wingspan: European Expansion";s:12:"thumbnailUrl";s:141:"https://cf.geekdo-images.com/7izK8WM_bgtvBzxQvLGz-A__thumb/img/Q76pV0p00R8qkcS6o-nczJD7DCk=/fit-in/200x150/filters:strip_icc()/pic4982682.jpg";}}
1 change: 1 addition & 0 deletions assets/boardgames-played.serialized.txt

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"type": "project",
"require": {
"php": "^8.2",
"nataniel/bggxmlapi2": "^1.1.5",
"php-di/php-di": "^7.0.7",
"twig/twig": "^3.14.0",
"nataniel/bggxmlapi2": "^1.1.5"
"ramsey/collection": "^2.0",
"twig/twig": "^3.14.0"
},
"require-dev": {
"captainhook/captainhook": "^5.23.5",
Expand Down
91 changes: 90 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions container-config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

use JanWennrich\BoardGames\OwnedBoardgamesLoader;
use JanWennrich\BoardGames\OwnedBoardgamesLoaderInterface;
use JanWennrich\BoardGames\PlayedBoardgamesLoader;
use JanWennrich\BoardGames\PlayedBoardgamesLoaderInterface;
use Twig\Environment;
use Twig\Loader\FilesystemLoader;

require_once __DIR__ . "/vendor/autoload.php";

return [
'bgg.username' => \DI\env('BGG_USERNAME'),
'serialization.path.boardgames.played' => 'assets/boardgames-played.serialized.txt',
'serialization.path.boardgames.owned' => 'assets/boardgames-owned.serialized.txt',
Environment::class => \DI\factory(function () {
return new Environment(new FilesystemLoader(__DIR__ . '/templates'));
}),
PlayedBoardgamesLoaderInterface::class => \DI\get(PlayedBoardgamesLoader::class),
OwnedBoardgamesLoaderInterface::class => \DI\get(OwnedBoardgamesLoader::class),
];
23 changes: 23 additions & 0 deletions download-bgg-data.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

use Crell\Serde\SerdeCommon;
use JanWennrich\BoardGames\OwnedBoardgamesLoader;
use JanWennrich\BoardGames\PlayedBoardgamesLoader;

require_once __DIR__ . '/vendor/autoload.php';

$containerConfig = require_once __DIR__ . "/container-config.php";

$diContainer = new \DI\Container($containerConfig);

$bggUsername = $diContainer->get('bgg.username');

$playedBoardgames = $diContainer->get(PlayedBoardgamesLoader::class)->getForUser($bggUsername);
$playedBoardgamesSerialized = serialize($playedBoardgames);
$playedBoardgamesSerializationPath = $diContainer->get('serialization.path.boardgames.played');
file_put_contents($playedBoardgamesSerializationPath, $playedBoardgamesSerialized);

$ownedBoardgames = $diContainer->get(OwnedBoardgamesLoader::class)->getForUser($bggUsername);
$ownedBoardgamesSerialized = serialize($ownedBoardgames);
$ownedBoardgamesSerializationPath = $diContainer->get('serialization.path.boardgames.owned');
file_put_contents($ownedBoardgamesSerializationPath, $ownedBoardgamesSerialized);
57 changes: 20 additions & 37 deletions generate-html.php
Original file line number Diff line number Diff line change
@@ -1,40 +1,23 @@
<?php

use Crell\Serde\SerdeCommon;
use JanWennrich\BoardGames\HtmlGenerator;
use JanWennrich\BoardGames\OwnedBoardgamesLoader;
use JanWennrich\BoardGames\OwnedBoardgamesLoaderInterface;
use JanWennrich\BoardGames\PlayedBoardgamesLoader;
use JanWennrich\BoardGames\PlayedBoardgamesLoaderInterface;
use JanWennrich\BoardGames\Test\Stub\OwnedBoardgamesLoaderStub;
use JanWennrich\BoardGames\Test\Stub\PlayedBoardgamesLoaderStub;
use Twig\Environment;
use Twig\Loader\FilesystemLoader;

require_once "vendor/autoload.php";

$diContainer = new \DI\Container([
'bgg.username' => \DI\env('BGG_USERNAME'),
Environment::class => \DI\factory(function () {
return new Environment(new FilesystemLoader(__DIR__ . '/templates'));
}),
PlayedBoardgamesLoaderInterface::class => \DI\get(PlayedBoardgamesLoader::class),
OwnedBoardgamesLoaderInterface::class => \DI\get(OwnedBoardgamesLoader::class),
]);

if (getenv('BGG_API') === 'mocked') {
$diContainer->set(
PlayedBoardgamesLoaderInterface::class,
\DI\get(PlayedBoardgamesLoaderStub::class),
);

$diContainer->set(
OwnedBoardgamesLoaderInterface::class,
\DI\get(OwnedBoardgamesLoaderStub::class),
);
}

$bggUsername = $diContainer->get('bgg.username');

$html = $diContainer->get(HtmlGenerator::class)->generateHtml($bggUsername);

echo $html;

require_once __DIR__ . '/vendor/autoload.php';

$containerConfig = require_once __DIR__ . "/container-config.php";

$diContainer = new \DI\Container($containerConfig);

$boardgamesOwnerSerializedPath = $diContainer->get('serialization.path.boardgames.owned');
$boardgamesOwnedSerialized = file_get_contents($boardgamesOwnerSerializedPath);
$boardgamesOwned = unserialize($boardgamesOwnedSerialized ?: throw new Exception("Could not read owned boardgames from '$boardgamesOwnerSerializedPath'"));

$boardgamesPlayedSerializedPath = $diContainer->get('serialization.path.boardgames.played');
$boardgamesPlayedSerialized = file_get_contents($boardgamesPlayedSerializedPath);
$boardgamesPlayed = unserialize($boardgamesPlayedSerialized ?: throw new Exception("Could not read played boardgames from '$boardgamesPlayedSerializedPath'"));

$htmlGenerator = $diContainer->get(HtmlGenerator::class);
$html = $htmlGenerator->generateHtml($boardgamesOwned, $boardgamesPlayed);

file_put_contents(__DIR__ . '/build/index.html', $html);
Loading

0 comments on commit bb0f8a6

Please sign in to comment.