[Scummvm-git-logs] scummvm-web master -> 8b87c3863e91cb3e32a75d292a6fe2122660702a

lephilousophe noreply at scummvm.org
Sat Sep 21 14:27:32 UTC 2024


This automated email contains information about 7 new commits which have been
pushed to the 'scummvm-web' repo located at https://github.com/scummvm/scummvm-web .

Summary:
bced39e150 WEB: Update dependabot rules
6f2f9cb8f2 Bump sass from 1.78.0 to 1.79.2
fd1e709060 Bump squizlabs/php_codesniffer from 3.10.2 to 3.10.3
d5c682ccf6 BUILD: Fix new SASS warnings
2d41648004 BUILD: Use a transaction to feed the database
2ec02d4627 BUILD: Make promises run as soon as they can
8b87c3863e BUILD: Document curl optional requirement.


Commit: bced39e1504ad8f225666da78f58fe06f3e9a4dd
    https://github.com/scummvm/scummvm-web/commit/bced39e1504ad8f225666da78f58fe06f3e9a4dd
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-09-20T08:09:37+02:00

Commit Message:
WEB: Update dependabot rules

- Add NPM support
- Group patch updates
- Issue PRs on friday: this will allow easier review on the week-end.

Changed paths:
    .github/dependabot.yml


diff --git a/.github/dependabot.yml b/.github/dependabot.yml
index 9584544b..71579a4e 100644
--- a/.github/dependabot.yml
+++ b/.github/dependabot.yml
@@ -5,10 +5,28 @@
 
 version: 2
 updates:
-  - package-ecosystem: "composer" # See documentation for possible values
-    directory: "/" # Location of package manifests
+  - package-ecosystem: "composer"
+    directory: "/"
     schedule:
       interval: "weekly"
+      day: "friday"
     ignore:
       - dependency-name: "phpstan/phpstan"
         update-types: ["version-update:semver-patch"]
+    groups:
+      patch-releases:
+        applies-to: version-updates
+        update-types:
+        - "patch"
+  - package-ecosystem: "npm"
+    directories:
+      - "/"
+      - "/dumper-companion"
+    schedule:
+      interval: "weekly"
+      day: "friday"
+    groups:
+      patch-releases:
+        applies-to: version-updates
+        update-types:
+        - "patch"


Commit: 6f2f9cb8f24649a5cfb845a4200eb5b2bd846b91
    https://github.com/scummvm/scummvm-web/commit/6f2f9cb8f24649a5cfb845a4200eb5b2bd846b91
Author: dependabot[bot] (49699333+dependabot[bot]@users.noreply.github.com)
Date: 2024-09-20T08:35:32+02:00

Commit Message:
Bump sass from 1.78.0 to 1.79.2

Bumps [sass](https://github.com/sass/dart-sass) from 1.78.0 to 1.79.2.
- [Release notes](https://github.com/sass/dart-sass/releases)
- [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sass/dart-sass/compare/1.78.0...1.79.2)

---
updated-dependencies:
- dependency-name: sass
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support at github.com>

Changed paths:
    package-lock.json
    package.json


diff --git a/package-lock.json b/package-lock.json
index 32f46557..6ce32a21 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12,7 +12,7 @@
         "autoprefixer": "^10.4.20",
         "dumper-companion": "file:dumper-companion",
         "postcss": "^8.4.45",
-        "sass": "1.78.0"
+        "sass": "1.79.2"
       }
     },
     "dumper-companion": {
@@ -774,18 +774,6 @@
         "url": "https://github.com/chalk/ansi-styles?sponsor=1"
       }
     },
-    "node_modules/anymatch": {
-      "version": "3.1.3",
-      "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz",
-      "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==",
-      "dependencies": {
-        "normalize-path": "^3.0.0",
-        "picomatch": "^2.0.4"
-      },
-      "engines": {
-        "node": ">= 8"
-      }
-    },
     "node_modules/argparse": {
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
@@ -836,17 +824,6 @@
       "dev": true,
       "license": "MIT"
     },
-    "node_modules/binary-extensions": {
-      "version": "2.3.0",
-      "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz",
-      "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==",
-      "engines": {
-        "node": ">=8"
-      },
-      "funding": {
-        "url": "https://github.com/sponsors/sindresorhus"
-      }
-    },
     "node_modules/brace-expansion": {
       "version": "1.1.11",
       "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
@@ -950,26 +927,17 @@
       }
     },
     "node_modules/chokidar": {
-      "version": "3.6.0",
-      "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
-      "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.0.tgz",
+      "integrity": "sha512-mxIojEAQcuEvT/lyXq+jf/3cO/KoA6z4CeNDGGevTybECPOMFCnQy3OPahluUkbqgPNGw5Bi78UC7Po6Lhy+NA==",
       "dependencies": {
-        "anymatch": "~3.1.2",
-        "braces": "~3.0.2",
-        "glob-parent": "~5.1.2",
-        "is-binary-path": "~2.1.0",
-        "is-glob": "~4.0.1",
-        "normalize-path": "~3.0.0",
-        "readdirp": "~3.6.0"
+        "readdirp": "^4.0.1"
       },
       "engines": {
-        "node": ">= 8.10.0"
+        "node": ">= 14.16.0"
       },
       "funding": {
         "url": "https://paulmillr.com/funding/"
-      },
-      "optionalDependencies": {
-        "fsevents": "~2.3.2"
       }
     },
     "node_modules/chrome-trace-event": {
@@ -1565,6 +1533,7 @@
       "version": "5.1.2",
       "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
       "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
+      "dev": true,
       "dependencies": {
         "is-glob": "^4.0.1"
       },
@@ -1699,17 +1668,6 @@
         "node": ">=10.13.0"
       }
     },
-    "node_modules/is-binary-path": {
-      "version": "2.1.0",
-      "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz",
-      "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==",
-      "dependencies": {
-        "binary-extensions": "^2.0.0"
-      },
-      "engines": {
-        "node": ">=8"
-      }
-    },
     "node_modules/is-core-module": {
       "version": "2.15.1",
       "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz",
@@ -1728,6 +1686,7 @@
       "version": "2.1.1",
       "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
       "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
+      "dev": true,
       "engines": {
         "node": ">=0.10.0"
       }
@@ -1736,6 +1695,7 @@
       "version": "4.0.3",
       "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
       "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
+      "dev": true,
       "dependencies": {
         "is-extglob": "^2.1.1"
       },
@@ -2007,14 +1967,6 @@
       "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.18.tgz",
       "integrity": "sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g=="
     },
-    "node_modules/normalize-path": {
-      "version": "3.0.0",
-      "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz",
-      "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==",
-      "engines": {
-        "node": ">=0.10.0"
-      }
-    },
     "node_modules/normalize-range": {
       "version": "0.1.2",
       "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz",
@@ -2224,14 +2176,15 @@
       }
     },
     "node_modules/readdirp": {
-      "version": "3.6.0",
-      "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
-      "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
-      "dependencies": {
-        "picomatch": "^2.2.1"
-      },
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.0.1.tgz",
+      "integrity": "sha512-GkMg9uOTpIWWKbSsgwb5fA4EavTR+SG/PMPoAY8hkhHfEEY0/vqljY+XHqtDf2cr2IJtoNRDbrrEpZUiZCkYRw==",
       "engines": {
-        "node": ">=8.10.0"
+        "node": ">= 14.16.0"
+      },
+      "funding": {
+        "type": "individual",
+        "url": "https://paulmillr.com/funding/"
       }
     },
     "node_modules/rechoir": {
@@ -2335,11 +2288,11 @@
       ]
     },
     "node_modules/sass": {
-      "version": "1.78.0",
-      "resolved": "https://registry.npmjs.org/sass/-/sass-1.78.0.tgz",
-      "integrity": "sha512-AaIqGSrjo5lA2Yg7RvFZrlXDBCp3nV4XP73GrLGvdRWWwk+8H3l0SDvq/5bA4eF+0RFPLuWUk3E+P1U/YqnpsQ==",
+      "version": "1.79.2",
+      "resolved": "https://registry.npmjs.org/sass/-/sass-1.79.2.tgz",
+      "integrity": "sha512-YmT1aoF1MwHsZEu/eXhbAJNsPGAhNP4UixW9ckEwWCvPcVdVF0/C104OGDVEqtoctKq0N+wM20O/rj+sSPsWeg==",
       "dependencies": {
-        "chokidar": ">=3.0.0 <4.0.0",
+        "chokidar": "^4.0.0",
         "immutable": "^4.0.0",
         "source-map-js": ">=0.6.2 <2.0.0"
       },
diff --git a/package.json b/package.json
index be83e918..e2eba483 100644
--- a/package.json
+++ b/package.json
@@ -6,7 +6,7 @@
     "autoprefixer": "^10.4.20",
     "dumper-companion": "file:dumper-companion",
     "postcss": "^8.4.45",
-    "sass": "1.78.0"
+    "sass": "1.79.2"
   },
   "scripts": {
     "postinstall": "cd dumper-companion && npm ci --omit=dev && npm run build && cd .. && node build.js",


Commit: fd1e709060c612b04909474af032f43cf4067e76
    https://github.com/scummvm/scummvm-web/commit/fd1e709060c612b04909474af032f43cf4067e76
Author: dependabot[bot] (49699333+dependabot[bot]@users.noreply.github.com)
Date: 2024-09-20T08:35:47+02:00

Commit Message:
Bump squizlabs/php_codesniffer from 3.10.2 to 3.10.3

Bumps [squizlabs/php_codesniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) from 3.10.2 to 3.10.3.
- [Release notes](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases)
- [Changelog](https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.10.2...3.10.3)

---
updated-dependencies:
- dependency-name: squizlabs/php_codesniffer
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support at github.com>

Changed paths:
    composer.lock


diff --git a/composer.lock b/composer.lock
index 223aeb1c..bc0f9bc8 100644
--- a/composer.lock
+++ b/composer.lock
@@ -2853,16 +2853,16 @@
         },
         {
             "name": "squizlabs/php_codesniffer",
-            "version": "3.10.2",
+            "version": "3.10.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
-                "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017"
+                "reference": "62d32998e820bddc40f99f8251958aed187a5c9c"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017",
-                "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017",
+                "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c",
+                "reference": "62d32998e820bddc40f99f8251958aed187a5c9c",
                 "shasum": ""
             },
             "require": {
@@ -2929,7 +2929,7 @@
                     "type": "open_collective"
                 }
             ],
-            "time": "2024-07-21T23:26:44+00:00"
+            "time": "2024-09-18T10:38:58+00:00"
         }
     ],
     "aliases": [],


Commit: d5c682ccf61bd4682d24fd5a05b9209c77458ea8
    https://github.com/scummvm/scummvm-web/commit/d5c682ccf61bd4682d24fd5a05b9209c77458ea8
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-09-21T16:14:36+02:00

Commit Message:
BUILD: Fix new SASS warnings

The future Dart Sass 2.0 will remove several functions which are now
deprecated:
- legacy API
- single channel adjustment functions

A helper function to keep old hexadecimal colors is added.
This allows to keep the same CSS as before the update and could be
removed afterwards.

Changed paths:
    build.js
    scss/abstracts/_mixins.scss
    scss/base/_base.scss
    scss/pages/_chart.scss
    scss/pages/_compatibility.scss
    scss/pages/_downloads.scss
    scss/theme/_themes.scss


diff --git a/build.js b/build.js
index 254a9f13..227265ac 100644
--- a/build.js
+++ b/build.js
@@ -8,10 +8,8 @@ async function renderScss(filename) {
     const outFile = `./public_html/css/${filename}.css`;
 
     console.log(`Converting ${inFile} to css`);
-    const output = sass.renderSync({
-        outputStyle: "compressed",
-        file: inFile,
-
+    const output = sass.compile(inFile, {
+        style: "compressed",
     });
 
     console.log(`Applying autoprefixer`);
diff --git a/scss/abstracts/_mixins.scss b/scss/abstracts/_mixins.scss
index 1a12bc67..68583259 100644
--- a/scss/abstracts/_mixins.scss
+++ b/scss/abstracts/_mixins.scss
@@ -2,7 +2,9 @@
 /// @access public
 /// @param {String} $breakpoint - Breakpoint
 /// @requires $breakpoints
+ at use "sass:color";
 @use "sass:math";
+ at use "sass:string";
 
 @mixin respond-to($breakpoint) {
   $raw-query: map-get($breakpoints, $breakpoint);
@@ -91,3 +93,10 @@
   }
   @return $value;
 }
+
+/* Helper function to convert colors to hex */
+ at function hex-color($color) {
+	@return string.unquote('#' + string.to-lower-case(
+		string.slice(color.ie-hex-str($color), 4)
+	));
+}
diff --git a/scss/base/_base.scss b/scss/base/_base.scss
index 46f9e5f9..e4740c99 100644
--- a/scss/base/_base.scss
+++ b/scss/base/_base.scss
@@ -1,4 +1,6 @@
 /* General layout rules */
+ at use "sass:color";
+
 body {
 	background-repeat: repeat-x;
 	font-family: verdana, tahoma, arial, helvetica, sans-serif;
@@ -28,7 +30,7 @@ a:hover {
 	text-decoration: none;
 
 	@include themify($themes) {
-		color: lighten(themed("link"), 20%);
+		color: hex-color(color.adjust(themed("link"), $lightness: 20%, $space: hsl));
 	}
 }
 
diff --git a/scss/pages/_chart.scss b/scss/pages/_chart.scss
index 9952ddea..b2474355 100644
--- a/scss/pages/_chart.scss
+++ b/scss/pages/_chart.scss
@@ -1,3 +1,5 @@
+ at use "sass:color";
+
 .chart-wrapper {
 
   span {
@@ -41,7 +43,7 @@
     }
     &:hover {
       @include themify($themes) {
-        color: lighten(themed("link"), 20%);
+        color: hex-color(color.adjust(themed("link"), $lightness: 20%, $space: hsl));
       }
     }
   }
diff --git a/scss/pages/_compatibility.scss b/scss/pages/_compatibility.scss
index 8cd18f37..3ba35616 100644
--- a/scss/pages/_compatibility.scss
+++ b/scss/pages/_compatibility.scss
@@ -1,3 +1,5 @@
+ at use "sass:color";
+
 .colorKeyTable {
 	td {
 		text-align: center;
@@ -22,6 +24,6 @@
 
 @for $i from 0 through 4 {
 	.pct#{$i*25} {
-		background-color: adjust-hue(hsl(0, 100%, (66-$i) + 0%), $i * 4.5 * 5);
+		background-color: hex-color(hsl($i * 4.5 * 5, 100%, (66-$i) + 0%));
 	}
 }
diff --git a/scss/pages/_downloads.scss b/scss/pages/_downloads.scss
index b941574b..9ce28515 100644
--- a/scss/pages/_downloads.scss
+++ b/scss/pages/_downloads.scss
@@ -1,3 +1,5 @@
+ at use "sass:color";
+
 ul.downloads {
 	li.file {
 		list-style-type: none;
@@ -37,7 +39,9 @@ ul.downloads {
 			border: 1px solid themed("download-text");
 			$download-background: themed("download-background");
 			background: $download-background
-				linear-gradient(to bottom, lighten($download-background, 40%) 0%, $download-background 100%);
+				linear-gradient(to bottom,
+					hex-color(color.adjust($download-background, $lightness: 40%, $space: hsl)) 0%,
+					$download-background 100%);
 		}
 		img {
 			display: block;
@@ -51,11 +55,11 @@ ul.downloads {
 		&:hover {
 			@include themify($themes) {
 				$download-background: themed("download-background");
-				background: lighten($download-background, 40%)
+				background: hex-color(color.adjust($download-background, $lightness: 40%, $space: hsl))
 					linear-gradient(
 						to bottom,
-						lighten($download-background, 50%) 0%,
-						lighten($download-background, 40%) 35%,
+						hex-color(color.adjust($download-background, $lightness: 50%, $space: hsl))  0%,
+						hex-color(color.adjust($download-background, $lightness: 40%, $space: hsl)) 35%,
 						$download-background 100%
 					);
 			}
diff --git a/scss/theme/_themes.scss b/scss/theme/_themes.scss
index bc8ac0d6..675ab01a 100644
--- a/scss/theme/_themes.scss
+++ b/scss/theme/_themes.scss
@@ -1,3 +1,5 @@
+ at use "sass:color";
+
 $themes: (
     scumm: (
         // Main elements
@@ -54,14 +56,14 @@ $themes: (
         round-container-title-background: #b5d7bd
             linear-gradient(
                 to top,
-                lighten(desaturate(#b5d7bd, 36.5), 17.25) 0%,
-                lighten(desaturate(#b5d7bd, 36.5), 12.35) 35%,
+                hex-color(color.adjust(#b5d7bd, $saturation: -36.5%, $lightness: 17.25%, $space: hsl)) 0%,
+                hex-color(color.adjust(#b5d7bd, $saturation: -36.5%, $lightness: 12.35%, $space: hsl)) 35%,
                 #b5d7bd 100%
             ),
         container-title-background: #45a63d
             linear-gradient(
                 to bottom,
-                lighten(desaturate(#45a63d, 20), 27.25) 0%,
+                hex-color(color.adjust(#45a63d, $saturation: -20%, $lightness: 27.25%, $space: hsl)) 0%,
                 #45a63d 100%
             ),
         background: #6699cc,


Commit: 2d4164800418b0ffa677f5f04d8858a34ccb3ecf
    https://github.com/scummvm/scummvm-web/commit/2d4164800418b0ffa677f5f04d8858a34ccb3ecf
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-09-21T16:15:32+02:00

Commit Message:
BUILD: Use a transaction to feed the database

This avoids Propel to issue a transaction at each save which causes
SQLite to sync to disk after every single insertion.
This speeds up the process dramatically on slow drives.

Changed paths:
    include/DataUtils.php


diff --git a/include/DataUtils.php b/include/DataUtils.php
index 76c2bb13..960d3a08 100644
--- a/include/DataUtils.php
+++ b/include/DataUtils.php
@@ -10,6 +10,7 @@ use League\Csv\Statement;
 use Symfony\Component\Yaml\Yaml;
 use GuzzleHttp\Client;
 use GuzzleHttp\Promise;
+use Propel\Runtime\Propel;
 use Propel\Runtime\Map\TableMap;
 
 /**
@@ -115,6 +116,12 @@ class DataUtils
             $file = DIR_DATA . "/" . DEFAULT_LOCALE . "/$name.yaml";
             $data = Yaml::parseFile($file);
             echo "Writing $object data to database\n";
+
+            $class = "ScummVM\\OrmObjects\\$object";
+            $mapClass = $class::TABLE_MAP;
+            $con = Propel::getConnection($mapClass::DATABASE_NAME);
+            // Use a transation to speed up writes
+            $con->beginTransaction();
             foreach ($data as $item) {
                 try {
                     foreach ($item as $key => $val) {
@@ -122,19 +129,19 @@ class DataUtils
                             unset($item[$key]);
                         }
                     }
-                    $class = "ScummVM\\OrmObjects\\$object";
                     $dbItem = new $class();
                     // TODO: Rename platform to platform_id
                     if ($object === 'Demo' || $object === 'DirectorDemo') {
                         $item['platform_id'] = $item['platform'];
                     }
                     $dbItem->fromArray($item, TableMap::TYPE_FIELDNAME);
-                    $dbItem->save();
+                    $dbItem->save($con);
                 } catch (\Exception $ex) {
                     echo json_encode($item) . "\n";
                     echo $ex->getMessage() . "\n";
                 }
             }
+            $con->commit();
         }
     }
 }


Commit: 2ec02d46277adb3ab2b069464b0ba616891044ca
    https://github.com/scummvm/scummvm-web/commit/2ec02d46277adb3ab2b069464b0ba616891044ca
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-09-21T16:19:48+02:00

Commit Message:
BUILD: Make promises run as soon as they can

Instead of waiting to download everything and process the results,
process each result when it comes.

Changed paths:
    include/DataUtils.php


diff --git a/include/DataUtils.php b/include/DataUtils.php
index 960d3a08..cfaf0cb0 100644
--- a/include/DataUtils.php
+++ b/include/DataUtils.php
@@ -64,46 +64,50 @@ class DataUtils
         foreach (self::SHEET_IDS as $name => $gid) {
             $url = self::SHEET_URL . "&gid=" . $gid;
             $promises[$name] = $client->getAsync($url);
+            $promises[$name]->then(function ($response) use ($name) {
+                self::doUpdateData($name, $response);
+            });
         }
 
-        $responses = Promise\Utils::unwrap($promises);
+        Promise\Utils::unwrap($promises);
 
-        foreach ($responses as $name => $response) {
-            $tsv = $response->getBody();
-            $reader = Reader::createFromString($tsv);
-            $reader->setDelimiter("\t");
-            $reader->setHeaderOffset(0);
-            $stmt = new Statement();
+        DataUtils::convertYamlToOrm();
 
-            $records = $stmt->process($reader);
-            // Convert to JSON because records are serializable
-            // and cannot be converted directly to yaml
-            $json = \json_encode($records);
-            $data = \json_decode($json, true);
+        // Clear the cache at the end of all data operations
+        \file_put_contents('.clear-cache', '');
+    }
 
-            // Convert TRUE/FALSE strings to Booleans
-            foreach ($data as $objKey => $obj) {
-                foreach ($obj as $key => $val) {
-                    if ($val === 'TRUE') {
-                        $data[$objKey][$key] = true;
-                    } elseif ($val === 'FALSE') {
-                        $data[$objKey][$key] = false;
-                    }
+    private static function doUpdateData($name, $response)
+    {
+        $tsv = $response->getBody();
+        $reader = Reader::createFromString($tsv);
+        $reader->setDelimiter("\t");
+        $reader->setHeaderOffset(0);
+        $stmt = new Statement();
+
+        $records = $stmt->process($reader);
+        // Convert to JSON because records are serializable
+        // and cannot be converted directly to yaml
+        $json = \json_encode($records);
+        $data = \json_decode($json, true);
+
+        // Convert TRUE/FALSE strings to Booleans
+        foreach ($data as $objKey => $obj) {
+            foreach ($obj as $key => $val) {
+                if ($val === 'TRUE') {
+                    $data[$objKey][$key] = true;
+                } elseif ($val === 'FALSE') {
+                    $data[$objKey][$key] = false;
                 }
             }
-
-            // Convert to YAML
-            $yaml = Yaml::dump($data);
-            $yaml = "# This is a generated file, please do not edit manually\n" . $yaml;
-            $outFile = DIR_DATA . "/" . DEFAULT_LOCALE . "/$name.yaml";
-            echo("Writing $name data to $outFile\n");
-            \file_put_contents($outFile, $yaml);
         }
 
-        DataUtils::convertYamlToOrm();
-
-        // Clear the cache at the end of all data operations
-        \file_put_contents('.clear-cache', '');
+        // Convert to YAML
+        $yaml = Yaml::dump($data);
+        $yaml = "# This is a generated file, please do not edit manually\n" . $yaml;
+        $outFile = DIR_DATA . "/" . DEFAULT_LOCALE . "/$name.yaml";
+        echo("Writing $name data to $outFile\n");
+        \file_put_contents($outFile, $yaml);
     }
 
     private static function convertYamlToOrm()


Commit: 8b87c3863e91cb3e32a75d292a6fe2122660702a
    https://github.com/scummvm/scummvm-web/commit/8b87c3863e91cb3e32a75d292a6fe2122660702a
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-09-21T16:19:48+02:00

Commit Message:
BUILD: Document curl optional requirement.

GuzzleHTTP makes use of curl when available.
It's far more faster than using the default implementation when doing
concurrent requests.

Changed paths:
    README.md


diff --git a/README.md b/README.md
index 535bd22c..1b40cdc5 100644
--- a/README.md
+++ b/README.md
@@ -17,6 +17,7 @@ Before installing please make sure you have the following installed:
   * PHP YAML extension. Install via `pecl install yaml` or `sudo apt install php-yaml`
   * The version of PHP included with macOS doesn't include PECL, so you'll need to install a different version of PHP [through Homebrew](https://formulae.brew.sh/formula/php) or another method
   * Alternatively on macOS you can use [MacPorts](https://www.macports.org) to install both PHP and yaml (for example to use PHP 8.2 `sudo port install php82 php82-yaml php82-iconv php82-intl php82-mbstring php82-sqlite ; sudo port select --set php php82`)
+  * To improve build performance, PHP curl extension can be installed.
 * [Composer](https://getcomposer.org/)
 * [Python & pip](https://www.python.org/) (2.7.9+/3.4+)
 * [Node.js & npm](https://nodejs.org/)




More information about the Scummvm-git-logs mailing list