$location) { if ($location['type'] == 'shop') { $economySlug = $location['modules/tuxemon.economy']; $scoop = json_decode(file_get_contents(dirname(__DIR__) . "/modules/tuxemon/mods/tuxemon/db/economy/$economySlug.json"), true); array_unshift($area['locations'][$locationId]['items'], ...$scoop['items']); } } // connections foreach ($area['connections'] as $areaSlug => $connection) { $area['connections'][$areaSlug]['modules/tuxemon.slug'] = json_decode(@file_get_contents(__DIR__ . "/areas/$areaSlug.json") ?? '', true)['modules/tuxemon.slug'] ?? ''; } // build file_put_contents(__DIR__ . "/_generated/areas/$fileName.json", json_encode($area)); }