[Scummvm-git-logs] scummvm-web master -> 6589516321b1298229519dcf2108d220a6621d6a

Mataniko mataniko at gmail.com
Thu Dec 31 09:49:54 UTC 2020


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

Summary:
6ef35310d0 WEB: Add Propel as an ORM
c80da556c0 WEB: Load data into the ORM from YAML
8e2c5cd7da WEB: Model remaining data into the ORM schema
8780993416 WEB: Convert most most pages to use the ORM objects
f1a969bdbd WEB: Use ORM objects for Screenshots
c71dce7702 WEB: Move downloads page to use the ORM
1e7f0f1684 WEB: Auto generate PK when undefined
a74cd5d8f4 WEB: Move Game Demos to ORM
22ef91d2a5 WEB: Migrate game downloads to use the ORM
8f961660d8 WEB: Move compatibility to the ORM model
9e43102294 WEB: Add all ORM Objects to ScummVM package
635156a755 BUILD: Auto generate ORM database and config in proper locations
cf5b7b8431 WEB: Rename Database tables
c6be8fea6a WEB: ORM cleanups
cc433bd940 BUILD: Update build scripts to generate database
e415dad73a WEB: Lint files
97f36a9716 BUILD: Ignore generated ORM base files
fbd9058568 BUILD: Move ORM config to PHP file, removing sed hack
f27fe3d0fd WEB: Rewrite the Screenshot model to use the database
6589516321 WEB: Restore number of shots in screenshots page


Commit: 6ef35310d0e930635351f843f758863240c061e7
    https://github.com/scummvm/scummvm-web/commit/6ef35310d0e930635351f843f758863240c061e7
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
WEB: Add Propel as an ORM

Changed paths:
  A propel.yaml
  A schema.xml
    .gitignore
    composer.json
    composer.lock


diff --git a/.gitignore b/.gitignore
index 3da4e07f..2430e96b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,3 +35,9 @@ public_html/frs
 # Clear cache instruction
 .clear-cache
 .no-cache
+
+# Propel
+generated-classes
+generated-conf
+generated-sql
+scummvm.db
diff --git a/composer.json b/composer.json
index 224c6a72..ac9ccab6 100644
--- a/composer.json
+++ b/composer.json
@@ -9,7 +9,7 @@
     }
   ],
   "require": {
-    "php": ">=7.0.0",
+    "php": ">=7.3.0",
     "ext-intl": "*",
     "smarty/smarty": "^3.1",
     "ezyang/htmlpurifier": "^4.10",
@@ -22,7 +22,8 @@
     "league/csv": "^9.6",
     "symfony/yaml": "^5.1",
     "predis/predis": "^1.1",
-    "guzzlehttp/guzzle": "^7.2"
+    "guzzlehttp/guzzle": "^7.2",
+    "propel/propel": "~2.0 at dev"
   },
   "require-dev": {
     "phpstan/phpstan": "^0.12.43",
@@ -60,6 +61,13 @@
     "update-data": [
       "php include/DataUtils.php"
     ],
+    "database": [
+      "rm scummvm.db",
+      "propel sql:build",
+      "propel model:build",
+      "propel config:convert",
+      "propel sql:insert"
+    ],
     "localize": [
       "php include/LocalizationUtils.php"
     ],
@@ -77,6 +85,7 @@
         "include/",
         "public_html/index.php"
       ]
-    }
+    },
+    "classmap": ["generated-classes/"]
   }
 }
diff --git a/composer.lock b/composer.lock
index affad8aa..f83a876d 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "2a95105f5c1913afc0c32097bee38e28",
+    "content-hash": "d8cbbe3a4b4c8807c615ab403a051763",
     "packages": [
         {
             "name": "altorouter/altorouter",
@@ -60,27 +60,31 @@
                 "router",
                 "routing"
             ],
+            "support": {
+                "issues": "https://github.com/dannyvankooten/AltoRouter/issues",
+                "source": "https://github.com/dannyvankooten/AltoRouter/tree/2.0.1"
+            },
             "time": "2019-11-23T11:01:41+00:00"
         },
         {
             "name": "composer/semver",
-            "version": "3.2.2",
+            "version": "3.2.4",
             "source": {
                 "type": "git",
                 "url": "https://github.com/composer/semver.git",
-                "reference": "4089fddb67bcf6bf860d91b979e95be303835002"
+                "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/composer/semver/zipball/4089fddb67bcf6bf860d91b979e95be303835002",
-                "reference": "4089fddb67bcf6bf860d91b979e95be303835002",
+                "url": "https://api.github.com/repos/composer/semver/zipball/a02fdf930a3c1c3ed3a49b5f63859c0c20e10464",
+                "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464",
                 "shasum": ""
             },
             "require": {
                 "php": "^5.3.2 || ^7.0 || ^8.0"
             },
             "require-dev": {
-                "phpstan/phpstan": "^0.12.19",
+                "phpstan/phpstan": "^0.12.54",
                 "symfony/phpunit-bridge": "^4.2 || ^5"
             },
             "type": "library",
@@ -122,6 +126,11 @@
                 "validation",
                 "versioning"
             ],
+            "support": {
+                "irc": "irc://irc.freenode.org/composer",
+                "issues": "https://github.com/composer/semver/issues",
+                "source": "https://github.com/composer/semver/tree/3.2.4"
+            },
             "funding": [
                 {
                     "url": "https://packagist.com",
@@ -136,7 +145,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-10-14T08:51:15+00:00"
+            "time": "2020-11-13T08:59:24+00:00"
         },
         {
             "name": "erusev/parsedown",
@@ -182,6 +191,10 @@
                 "markdown",
                 "parser"
             ],
+            "support": {
+                "issues": "https://github.com/erusev/parsedown/issues",
+                "source": "https://github.com/erusev/parsedown/tree/1.7.x"
+            },
             "time": "2019-12-30T22:54:17+00:00"
         },
         {
@@ -232,6 +245,10 @@
             "keywords": [
                 "html"
             ],
+            "support": {
+                "issues": "https://github.com/ezyang/htmlpurifier/issues",
+                "source": "https://github.com/ezyang/htmlpurifier/tree/master"
+            },
             "time": "2020-06-29T00:56:53+00:00"
         },
         {
@@ -468,22 +485,22 @@
         },
         {
             "name": "league/csv",
-            "version": "9.6.1",
+            "version": "9.6.2",
             "source": {
                 "type": "git",
                 "url": "https://github.com/thephpleague/csv.git",
-                "reference": "634322df4aed210fdfbb7c94e434dc860da733d9"
+                "reference": "f28da6e483bf979bac10e2add384c90ae9983e4e"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/thephpleague/csv/zipball/634322df4aed210fdfbb7c94e434dc860da733d9",
-                "reference": "634322df4aed210fdfbb7c94e434dc860da733d9",
+                "url": "https://api.github.com/repos/thephpleague/csv/zipball/f28da6e483bf979bac10e2add384c90ae9983e4e",
+                "reference": "f28da6e483bf979bac10e2add384c90ae9983e4e",
                 "shasum": ""
             },
             "require": {
                 "ext-json": "*",
                 "ext-mbstring": "*",
-                "php": "^7.2.5"
+                "php": ">=7.2.5"
             },
             "require-dev": {
                 "ext-curl": "*",
@@ -536,13 +553,19 @@
                 "transform",
                 "write"
             ],
+            "support": {
+                "docs": "https://csv.thephpleague.com",
+                "issues": "https://github.com/thephpleague/csv/issues",
+                "rss": "https://github.com/thephpleague/csv/releases.atom",
+                "source": "https://github.com/thephpleague/csv"
+            },
             "funding": [
                 {
                     "url": "https://github.com/sponsors/nyamsprod",
                     "type": "github"
                 }
             ],
-            "time": "2020-09-05T08:40:12+00:00"
+            "time": "2020-12-10T19:40:30+00:00"
         },
         {
             "name": "mustangostang/spyc",
@@ -596,16 +619,16 @@
         },
         {
             "name": "phpfastcache/phpfastcache",
-            "version": "8.0.2",
+            "version": "8.0.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/PHPSocialNetwork/phpfastcache.git",
-                "reference": "943dcea432f2a5cc93b4718845fa9eb3fd03bf7a"
+                "reference": "e1b7cb89a438d1d962d0529ff74c4932159a216f"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/PHPSocialNetwork/phpfastcache/zipball/943dcea432f2a5cc93b4718845fa9eb3fd03bf7a",
-                "reference": "943dcea432f2a5cc93b4718845fa9eb3fd03bf7a",
+                "url": "https://api.github.com/repos/PHPSocialNetwork/phpfastcache/zipball/e1b7cb89a438d1d962d0529ff74c4932159a216f",
+                "reference": "e1b7cb89a438d1d962d0529ff74c4932159a216f",
                 "shasum": ""
             },
             "require": {
@@ -695,6 +718,10 @@
                 "zend memory cache",
                 "zend server"
             ],
+            "support": {
+                "issues": "https://github.com/PHPSocialNetwork/phpfastcache/issues",
+                "source": "https://github.com/PHPSocialNetwork/phpfastcache/tree/8.0.3"
+            },
             "funding": [
                 {
                     "url": "https://github.com/geolim4",
@@ -705,20 +732,20 @@
                     "type": "patreon"
                 }
             ],
-            "time": "2020-08-28T13:54:22+00:00"
+            "time": "2020-11-24T11:29:49+00:00"
         },
         {
             "name": "piwik/device-detector",
-            "version": "3.13.0",
+            "version": "3.13.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/matomo-org/device-detector.git",
-                "reference": "75ca5b690e38c40d199ade93e677bc5d7c3bc498"
+                "reference": "e90533302c58acf41f0d8075a0151537d0ddf34d"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/matomo-org/device-detector/zipball/75ca5b690e38c40d199ade93e677bc5d7c3bc498",
-                "reference": "75ca5b690e38c40d199ade93e677bc5d7c3bc498",
+                "url": "https://api.github.com/repos/matomo-org/device-detector/zipball/e90533302c58acf41f0d8075a0151537d0ddf34d",
+                "reference": "e90533302c58acf41f0d8075a0151537d0ddf34d",
                 "shasum": ""
             },
             "require": {
@@ -740,7 +767,10 @@
             "autoload": {
                 "psr-4": {
                     "DeviceDetector\\": ""
-                }
+                },
+                "exclude-from-classmap": [
+                    "Tests/"
+                ]
             },
             "notification-url": "https://packagist.org/downloads/",
             "license": [
@@ -760,7 +790,14 @@
                 "parser",
                 "useragent"
             ],
-            "time": "2020-08-17T07:37:33+00:00"
+            "support": {
+                "forum": "http://forum.matomo.org/",
+                "issues": "https://github.com/matomo-org/device-detector/issues",
+                "source": "https://github.com/matomo-org/piwik",
+                "wiki": "https://dev.matomo.org/"
+            },
+            "abandoned": "matomo/device-detector",
+            "time": "2020-10-25T10:17:36+00:00"
         },
         {
             "name": "predis/predis",
@@ -829,6 +866,10 @@
                 "predis",
                 "redis"
             ],
+            "support": {
+                "issues": "https://github.com/predis/predis/issues",
+                "source": "https://github.com/predis/predis/tree/v1.1.6"
+            },
             "funding": [
                 {
                     "url": "https://github.com/sponsors/tillkruss",
@@ -837,6 +878,81 @@
             ],
             "time": "2020-09-11T19:18:05+00:00"
         },
+        {
+            "name": "propel/propel",
+            "version": "dev-master",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/propelorm/Propel2.git",
+                "reference": "3df45aa1ad441b5d3fb3f3341456722aa9e2125c"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/propelorm/Propel2/zipball/3df45aa1ad441b5d3fb3f3341456722aa9e2125c",
+                "reference": "3df45aa1ad441b5d3fb3f3341456722aa9e2125c",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2",
+                "psr/log": "^1.0",
+                "symfony/config": "^3.4.0||^4.0.0||^5.0.0",
+                "symfony/console": "^3.4.0||^4.0.0||^5.0.0",
+                "symfony/filesystem": "^3.4.0||^4.0.0||^5.0.0",
+                "symfony/finder": "^3.4.0||^4.0.0||^5.0.0",
+                "symfony/translation": "^3.4.0||^4.0.0||^5.0.0",
+                "symfony/validator": "^3.4.0||^4.0.0||^5.0.0",
+                "symfony/yaml": "^3.4.0||^4.0.0||^5.0.0"
+            },
+            "require-dev": {
+                "ext-json": "*",
+                "ext-pdo": "*",
+                "monolog/monolog": "^1.3",
+                "phpstan/phpstan": "^0.12.4",
+                "phpunit/phpunit": "^8.0.0||^9.0.0",
+                "psalm/phar": "^4.1.0",
+                "spryker/code-sniffer": "^0.15.6"
+            },
+            "suggest": {
+                "monolog/monolog": "The recommended logging library to use with Propel."
+            },
+            "default-branch": true,
+            "bin": [
+                "bin/propel"
+            ],
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.0-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Propel\\": "src/Propel/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "William Durand",
+                    "email": "william.durand1 at gmail.com"
+                }
+            ],
+            "description": "Propel2 is an open-source Object-Relational Mapping (ORM) for PHP.",
+            "homepage": "http://www.propelorm.org/",
+            "keywords": [
+                "Active Record",
+                "orm",
+                "persistence"
+            ],
+            "support": {
+                "issues": "https://github.com/propelorm/Propel2/issues",
+                "source": "https://github.com/propelorm/Propel2/tree/master"
+            },
+            "time": "2020-12-03T09:54:53+00:00"
+        },
         {
             "name": "psr/cache",
             "version": "1.0.1",
@@ -881,8 +997,64 @@
                 "psr",
                 "psr-6"
             ],
+            "support": {
+                "source": "https://github.com/php-fig/cache/tree/master"
+            },
             "time": "2016-08-06T20:24:11+00:00"
         },
+        {
+            "name": "psr/container",
+            "version": "1.0.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/container.git",
+                "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
+                "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.0.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Psr\\Container\\": "src/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "http://www.php-fig.org/"
+                }
+            ],
+            "description": "Common Container Interface (PHP FIG PSR-11)",
+            "homepage": "https://github.com/php-fig/container",
+            "keywords": [
+                "PSR-11",
+                "container",
+                "container-interface",
+                "container-interop",
+                "psr"
+            ],
+            "support": {
+                "issues": "https://github.com/php-fig/container/issues",
+                "source": "https://github.com/php-fig/container/tree/master"
+            },
+            "time": "2017-02-14T16:28:37+00:00"
+        },
         {
             "name": "psr/http-client",
             "version": "1.0.1",
@@ -988,6 +1160,56 @@
             },
             "time": "2016-08-06T14:39:51+00:00"
         },
+        {
+            "name": "psr/log",
+            "version": "1.1.3",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/php-fig/log.git",
+                "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/php-fig/log/zipball/0f73288fd15629204f9d42b7055f72dacbe811fc",
+                "reference": "0f73288fd15629204f9d42b7055f72dacbe811fc",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3.0"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "1.1.x-dev"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Psr\\Log\\": "Psr/Log/"
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "PHP-FIG",
+                    "homepage": "http://www.php-fig.org/"
+                }
+            ],
+            "description": "Common interface for logging libraries",
+            "homepage": "https://github.com/php-fig/log",
+            "keywords": [
+                "log",
+                "psr",
+                "psr-3"
+            ],
+            "support": {
+                "source": "https://github.com/php-fig/log/tree/1.1.3"
+            },
+            "time": "2020-03-23T09:12:05+00:00"
+        },
         {
             "name": "psr/simple-cache",
             "version": "1.0.1",
@@ -1034,6 +1256,9 @@
                 "psr-16",
                 "simple-cache"
             ],
+            "support": {
+                "source": "https://github.com/php-fig/simple-cache/tree/master"
+            },
             "time": "2017-10-23T01:57:42+00:00"
         },
         {
@@ -1135,6 +1360,12 @@
             "keywords": [
                 "templating"
             ],
+            "support": {
+                "forum": "http://www.smarty.net/forums/",
+                "irc": "irc://irc.freenode.org/smarty",
+                "issues": "https://github.com/smarty-php/smarty/issues",
+                "source": "https://github.com/smarty-php/smarty/tree/v3.1.36"
+            },
             "time": "2020-04-14T14:44:26+00:00"
         },
         {
@@ -1184,38 +1415,53 @@
                 "spatie",
                 "yaml"
             ],
+            "support": {
+                "issues": "https://github.com/spatie/yaml-front-matter/issues",
+                "source": "https://github.com/spatie/yaml-front-matter/tree/master"
+            },
             "time": "2019-12-02T20:50:50+00:00"
         },
         {
-            "name": "symfony/deprecation-contracts",
-            "version": "v2.2.0",
+            "name": "symfony/config",
+            "version": "v5.2.0",
             "source": {
                 "type": "git",
-                "url": "https://github.com/symfony/deprecation-contracts.git",
-                "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665"
+                "url": "https://github.com/symfony/config.git",
+                "reference": "fa1219ecbf96bb5db59f2599cba0960a0d9c3aea"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665",
-                "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665",
+                "url": "https://api.github.com/repos/symfony/config/zipball/fa1219ecbf96bb5db59f2599cba0960a0d9c3aea",
+                "reference": "fa1219ecbf96bb5db59f2599cba0960a0d9c3aea",
                 "shasum": ""
             },
             "require": {
-                "php": ">=7.1"
+                "php": ">=7.2.5",
+                "symfony/deprecation-contracts": "^2.1",
+                "symfony/filesystem": "^4.4|^5.0",
+                "symfony/polyfill-ctype": "~1.8",
+                "symfony/polyfill-php80": "^1.15"
             },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "2.2-dev"
-                },
-                "thanks": {
-                    "name": "symfony/contracts",
-                    "url": "https://github.com/symfony/contracts"
-                }
+            "conflict": {
+                "symfony/finder": "<4.4"
+            },
+            "require-dev": {
+                "symfony/event-dispatcher": "^4.4|^5.0",
+                "symfony/finder": "^4.4|^5.0",
+                "symfony/messenger": "^4.4|^5.0",
+                "symfony/service-contracts": "^1.1|^2",
+                "symfony/yaml": "^4.4|^5.0"
             },
+            "suggest": {
+                "symfony/yaml": "To use the yaml reference dumper"
+            },
+            "type": "library",
             "autoload": {
-                "files": [
-                    "function.php"
+                "psr-4": {
+                    "Symfony\\Component\\Config\\": ""
+                },
+                "exclude-from-classmap": [
+                    "/Tests/"
                 ]
             },
             "notification-url": "https://packagist.org/downloads/",
@@ -1224,16 +1470,19 @@
             ],
             "authors": [
                 {
-                    "name": "Nicolas Grekas",
-                    "email": "p at tchwork.com"
+                    "name": "Fabien Potencier",
+                    "email": "fabien at symfony.com"
                 },
                 {
                     "name": "Symfony Community",
                     "homepage": "https://symfony.com/contributors"
                 }
             ],
-            "description": "A generic function and convention to trigger deprecation notices",
+            "description": "Symfony Config Component",
             "homepage": "https://symfony.com",
+            "support": {
+                "source": "https://github.com/symfony/config/tree/v5.2.0"
+            },
             "funding": [
                 {
                     "url": "https://symfony.com/sponsor",
@@ -1248,44 +1497,62 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-09-07T11:33:47+00:00"
+            "time": "2020-11-16T18:02:40+00:00"
         },
         {
-            "name": "symfony/polyfill-ctype",
-            "version": "v1.18.1",
+            "name": "symfony/console",
+            "version": "v5.2.0",
             "source": {
                 "type": "git",
-                "url": "https://github.com/symfony/polyfill-ctype.git",
-                "reference": "1c302646f6efc070cd46856e600e5e0684d6b454"
+                "url": "https://github.com/symfony/console.git",
+                "reference": "3e0564fb08d44a98bd5f1960204c958e57bd586b"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/1c302646f6efc070cd46856e600e5e0684d6b454",
-                "reference": "1c302646f6efc070cd46856e600e5e0684d6b454",
+                "url": "https://api.github.com/repos/symfony/console/zipball/3e0564fb08d44a98bd5f1960204c958e57bd586b",
+                "reference": "3e0564fb08d44a98bd5f1960204c958e57bd586b",
                 "shasum": ""
             },
             "require": {
-                "php": ">=5.3.3"
+                "php": ">=7.2.5",
+                "symfony/polyfill-mbstring": "~1.0",
+                "symfony/polyfill-php73": "^1.8",
+                "symfony/polyfill-php80": "^1.15",
+                "symfony/service-contracts": "^1.1|^2",
+                "symfony/string": "^5.1"
+            },
+            "conflict": {
+                "symfony/dependency-injection": "<4.4",
+                "symfony/dotenv": "<5.1",
+                "symfony/event-dispatcher": "<4.4",
+                "symfony/lock": "<4.4",
+                "symfony/process": "<4.4"
+            },
+            "provide": {
+                "psr/log-implementation": "1.0"
+            },
+            "require-dev": {
+                "psr/log": "~1.0",
+                "symfony/config": "^4.4|^5.0",
+                "symfony/dependency-injection": "^4.4|^5.0",
+                "symfony/event-dispatcher": "^4.4|^5.0",
+                "symfony/lock": "^4.4|^5.0",
+                "symfony/process": "^4.4|^5.0",
+                "symfony/var-dumper": "^4.4|^5.0"
             },
             "suggest": {
-                "ext-ctype": "For best performance"
+                "psr/log": "For using the console logger",
+                "symfony/event-dispatcher": "",
+                "symfony/lock": "",
+                "symfony/process": ""
             },
             "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-master": "1.18-dev"
-                },
-                "thanks": {
-                    "name": "symfony/polyfill",
-                    "url": "https://github.com/symfony/polyfill"
-                }
-            },
             "autoload": {
                 "psr-4": {
-                    "Symfony\\Polyfill\\Ctype\\": ""
+                    "Symfony\\Component\\Console\\": ""
                 },
-                "files": [
-                    "bootstrap.php"
+                "exclude-from-classmap": [
+                    "/Tests/"
                 ]
             },
             "notification-url": "https://packagist.org/downloads/",
@@ -1294,22 +1561,25 @@
             ],
             "authors": [
                 {
-                    "name": "Gert de Pagter",
-                    "email": "BackEndTea at gmail.com"
+                    "name": "Fabien Potencier",
+                    "email": "fabien at symfony.com"
                 },
                 {
                     "name": "Symfony Community",
                     "homepage": "https://symfony.com/contributors"
                 }
             ],
-            "description": "Symfony polyfill for ctype functions",
+            "description": "Symfony Console Component",
             "homepage": "https://symfony.com",
             "keywords": [
-                "compatibility",
-                "ctype",
-                "polyfill",
-                "portable"
+                "cli",
+                "command line",
+                "console",
+                "terminal"
             ],
+            "support": {
+                "source": "https://github.com/symfony/console/tree/v5.2.0"
+            },
             "funding": [
                 {
                     "url": "https://symfony.com/sponsor",
@@ -1324,51 +1594,38 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-07-14T12:35:20+00:00"
+            "time": "2020-11-28T11:24:18+00:00"
         },
         {
-            "name": "symfony/yaml",
-            "version": "v5.1.7",
+            "name": "symfony/deprecation-contracts",
+            "version": "v2.2.0",
             "source": {
                 "type": "git",
-                "url": "https://github.com/symfony/yaml.git",
-                "reference": "e147a68cb66a8b510f4b7481fe4da5b2ab65ec6a"
+                "url": "https://github.com/symfony/deprecation-contracts.git",
+                "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/yaml/zipball/e147a68cb66a8b510f4b7481fe4da5b2ab65ec6a",
-                "reference": "e147a68cb66a8b510f4b7481fe4da5b2ab65ec6a",
+                "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5fa56b4074d1ae755beb55617ddafe6f5d78f665",
+                "reference": "5fa56b4074d1ae755beb55617ddafe6f5d78f665",
                 "shasum": ""
             },
             "require": {
-                "php": ">=7.2.5",
-                "symfony/deprecation-contracts": "^2.1",
-                "symfony/polyfill-ctype": "~1.8"
-            },
-            "conflict": {
-                "symfony/console": "<4.4"
-            },
-            "require-dev": {
-                "symfony/console": "^4.4|^5.0"
-            },
-            "suggest": {
-                "symfony/console": "For validating YAML files using the lint command"
+                "php": ">=7.1"
             },
-            "bin": [
-                "Resources/bin/yaml-lint"
-            ],
             "type": "library",
             "extra": {
                 "branch-alias": {
-                    "dev-master": "5.1-dev"
+                    "dev-master": "2.2-dev"
+                },
+                "thanks": {
+                    "name": "symfony/contracts",
+                    "url": "https://github.com/symfony/contracts"
                 }
             },
             "autoload": {
-                "psr-4": {
-                    "Symfony\\Component\\Yaml\\": ""
-                },
-                "exclude-from-classmap": [
-                    "/Tests/"
+                "files": [
+                    "function.php"
                 ]
             },
             "notification-url": "https://packagist.org/downloads/",
@@ -1377,16 +1634,19 @@
             ],
             "authors": [
                 {
-                    "name": "Fabien Potencier",
-                    "email": "fabien at symfony.com"
+                    "name": "Nicolas Grekas",
+                    "email": "p at tchwork.com"
                 },
                 {
                     "name": "Symfony Community",
                     "homepage": "https://symfony.com/contributors"
                 }
             ],
-            "description": "Symfony Yaml Component",
+            "description": "A generic function and convention to trigger deprecation notices",
             "homepage": "https://symfony.com",
+            "support": {
+                "source": "https://github.com/symfony/deprecation-contracts/tree/master"
+            },
             "funding": [
                 {
                     "url": "https://symfony.com/sponsor",
@@ -1401,22 +1661,1150 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-09-27T03:44:28+00:00"
-        }
+            "time": "2020-09-07T11:33:47+00:00"
+        },
+        {
+            "name": "symfony/filesystem",
+            "version": "v5.2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/filesystem.git",
+                "reference": "bb92ba7f38b037e531908590a858a04d85c0e238"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/filesystem/zipball/bb92ba7f38b037e531908590a858a04d85c0e238",
+                "reference": "bb92ba7f38b037e531908590a858a04d85c0e238",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2.5",
+                "symfony/polyfill-ctype": "~1.8"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Component\\Filesystem\\": ""
+                },
+                "exclude-from-classmap": [
+                    "/Tests/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien at symfony.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony Filesystem Component",
+            "homepage": "https://symfony.com",
+            "support": {
+                "source": "https://github.com/symfony/filesystem/tree/v5.2.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-11-12T09:58:18+00:00"
+        },
+        {
+            "name": "symfony/finder",
+            "version": "v5.2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/finder.git",
+                "reference": "fd8305521692f27eae3263895d1ef1571c71a78d"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/finder/zipball/fd8305521692f27eae3263895d1ef1571c71a78d",
+                "reference": "fd8305521692f27eae3263895d1ef1571c71a78d",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2.5"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Component\\Finder\\": ""
+                },
+                "exclude-from-classmap": [
+                    "/Tests/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien at symfony.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony Finder Component",
+            "homepage": "https://symfony.com",
+            "support": {
+                "source": "https://github.com/symfony/finder/tree/v5.2.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-11-18T09:42:36+00:00"
+        },
+        {
+            "name": "symfony/polyfill-ctype",
+            "version": "v1.20.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-ctype.git",
+                "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/f4ba089a5b6366e453971d3aad5fe8e897b37f41",
+                "reference": "f4ba089a5b6366e453971d3aad5fe8e897b37f41",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "suggest": {
+                "ext-ctype": "For best performance"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.20-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Polyfill\\Ctype\\": ""
+                },
+                "files": [
+                    "bootstrap.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Gert de Pagter",
+                    "email": "BackEndTea at gmail.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill for ctype functions",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "ctype",
+                "polyfill",
+                "portable"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-ctype/tree/v1.20.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-10-23T14:02:19+00:00"
+        },
+        {
+            "name": "symfony/polyfill-intl-grapheme",
+            "version": "v1.20.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-intl-grapheme.git",
+                "reference": "c7cf3f858ec7d70b89559d6e6eb1f7c2517d479c"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/c7cf3f858ec7d70b89559d6e6eb1f7c2517d479c",
+                "reference": "c7cf3f858ec7d70b89559d6e6eb1f7c2517d479c",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "suggest": {
+                "ext-intl": "For best performance"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.20-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Polyfill\\Intl\\Grapheme\\": ""
+                },
+                "files": [
+                    "bootstrap.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p at tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill for intl's grapheme_* functions",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "grapheme",
+                "intl",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.20.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-10-23T14:02:19+00:00"
+        },
+        {
+            "name": "symfony/polyfill-intl-normalizer",
+            "version": "v1.20.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-intl-normalizer.git",
+                "reference": "727d1096295d807c309fb01a851577302394c897"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/727d1096295d807c309fb01a851577302394c897",
+                "reference": "727d1096295d807c309fb01a851577302394c897",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "suggest": {
+                "ext-intl": "For best performance"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.20-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Polyfill\\Intl\\Normalizer\\": ""
+                },
+                "files": [
+                    "bootstrap.php"
+                ],
+                "classmap": [
+                    "Resources/stubs"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p at tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill for intl's Normalizer class and related functions",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "intl",
+                "normalizer",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.20.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-10-23T14:02:19+00:00"
+        },
+        {
+            "name": "symfony/polyfill-mbstring",
+            "version": "v1.20.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-mbstring.git",
+                "reference": "39d483bdf39be819deabf04ec872eb0b2410b531"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/39d483bdf39be819deabf04ec872eb0b2410b531",
+                "reference": "39d483bdf39be819deabf04ec872eb0b2410b531",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "suggest": {
+                "ext-mbstring": "For best performance"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.20-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Polyfill\\Mbstring\\": ""
+                },
+                "files": [
+                    "bootstrap.php"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p at tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill for the Mbstring extension",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "mbstring",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.20.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-10-23T14:02:19+00:00"
+        },
+        {
+            "name": "symfony/polyfill-php73",
+            "version": "v1.20.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-php73.git",
+                "reference": "8ff431c517be11c78c48a39a66d37431e26a6bed"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/8ff431c517be11c78c48a39a66d37431e26a6bed",
+                "reference": "8ff431c517be11c78c48a39a66d37431e26a6bed",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.20-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Polyfill\\Php73\\": ""
+                },
+                "files": [
+                    "bootstrap.php"
+                ],
+                "classmap": [
+                    "Resources/stubs"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p at tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-php73/tree/v1.20.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-10-23T14:02:19+00:00"
+        },
+        {
+            "name": "symfony/polyfill-php80",
+            "version": "v1.20.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/polyfill-php80.git",
+                "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/e70aa8b064c5b72d3df2abd5ab1e90464ad009de",
+                "reference": "e70aa8b064c5b72d3df2abd5ab1e90464ad009de",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.1"
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-main": "1.20-dev"
+                },
+                "thanks": {
+                    "name": "symfony/polyfill",
+                    "url": "https://github.com/symfony/polyfill"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Polyfill\\Php80\\": ""
+                },
+                "files": [
+                    "bootstrap.php"
+                ],
+                "classmap": [
+                    "Resources/stubs"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Ion Bazan",
+                    "email": "ion.bazan at gmail.com"
+                },
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p at tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "compatibility",
+                "polyfill",
+                "portable",
+                "shim"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/polyfill-php80/tree/v1.20.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-10-23T14:02:19+00:00"
+        },
+        {
+            "name": "symfony/service-contracts",
+            "version": "v2.2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/service-contracts.git",
+                "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d15da7ba4957ffb8f1747218be9e1a121fd298a1",
+                "reference": "d15da7ba4957ffb8f1747218be9e1a121fd298a1",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2.5",
+                "psr/container": "^1.0"
+            },
+            "suggest": {
+                "symfony/service-implementation": ""
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.2-dev"
+                },
+                "thanks": {
+                    "name": "symfony/contracts",
+                    "url": "https://github.com/symfony/contracts"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Contracts\\Service\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p at tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Generic abstractions related to writing services",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "abstractions",
+                "contracts",
+                "decoupling",
+                "interfaces",
+                "interoperability",
+                "standards"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/service-contracts/tree/master"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-09-07T11:33:47+00:00"
+        },
+        {
+            "name": "symfony/string",
+            "version": "v5.2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/string.git",
+                "reference": "40e975edadd4e32cd16f3753b3bad65d9ac48242"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/string/zipball/40e975edadd4e32cd16f3753b3bad65d9ac48242",
+                "reference": "40e975edadd4e32cd16f3753b3bad65d9ac48242",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2.5",
+                "symfony/polyfill-ctype": "~1.8",
+                "symfony/polyfill-intl-grapheme": "~1.0",
+                "symfony/polyfill-intl-normalizer": "~1.0",
+                "symfony/polyfill-mbstring": "~1.0",
+                "symfony/polyfill-php80": "~1.15"
+            },
+            "require-dev": {
+                "symfony/error-handler": "^4.4|^5.0",
+                "symfony/http-client": "^4.4|^5.0",
+                "symfony/translation-contracts": "^1.1|^2",
+                "symfony/var-exporter": "^4.4|^5.0"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Component\\String\\": ""
+                },
+                "files": [
+                    "Resources/functions.php"
+                ],
+                "exclude-from-classmap": [
+                    "/Tests/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p at tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony String component",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "grapheme",
+                "i18n",
+                "string",
+                "unicode",
+                "utf-8",
+                "utf8"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/string/tree/v5.2.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-10-24T12:08:07+00:00"
+        },
+        {
+            "name": "symfony/translation",
+            "version": "v5.2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/translation.git",
+                "reference": "52f486a707510884450df461b5a6429dd7a67379"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/translation/zipball/52f486a707510884450df461b5a6429dd7a67379",
+                "reference": "52f486a707510884450df461b5a6429dd7a67379",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2.5",
+                "symfony/polyfill-mbstring": "~1.0",
+                "symfony/polyfill-php80": "^1.15",
+                "symfony/translation-contracts": "^2.3"
+            },
+            "conflict": {
+                "symfony/config": "<4.4",
+                "symfony/dependency-injection": "<5.0",
+                "symfony/http-kernel": "<5.0",
+                "symfony/twig-bundle": "<5.0",
+                "symfony/yaml": "<4.4"
+            },
+            "provide": {
+                "symfony/translation-implementation": "2.0"
+            },
+            "require-dev": {
+                "psr/log": "~1.0",
+                "symfony/config": "^4.4|^5.0",
+                "symfony/console": "^4.4|^5.0",
+                "symfony/dependency-injection": "^5.0",
+                "symfony/finder": "^4.4|^5.0",
+                "symfony/http-kernel": "^5.0",
+                "symfony/intl": "^4.4|^5.0",
+                "symfony/service-contracts": "^1.1.2|^2",
+                "symfony/yaml": "^4.4|^5.0"
+            },
+            "suggest": {
+                "psr/log-implementation": "To use logging capability in translator",
+                "symfony/config": "",
+                "symfony/yaml": ""
+            },
+            "type": "library",
+            "autoload": {
+                "files": [
+                    "Resources/functions.php"
+                ],
+                "psr-4": {
+                    "Symfony\\Component\\Translation\\": ""
+                },
+                "exclude-from-classmap": [
+                    "/Tests/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien at symfony.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony Translation Component",
+            "homepage": "https://symfony.com",
+            "support": {
+                "source": "https://github.com/symfony/translation/tree/v5.2.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-11-28T11:24:18+00:00"
+        },
+        {
+            "name": "symfony/translation-contracts",
+            "version": "v2.3.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/translation-contracts.git",
+                "reference": "e2eaa60b558f26a4b0354e1bbb25636efaaad105"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/e2eaa60b558f26a4b0354e1bbb25636efaaad105",
+                "reference": "e2eaa60b558f26a4b0354e1bbb25636efaaad105",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2.5"
+            },
+            "suggest": {
+                "symfony/translation-implementation": ""
+            },
+            "type": "library",
+            "extra": {
+                "branch-alias": {
+                    "dev-master": "2.3-dev"
+                },
+                "thanks": {
+                    "name": "symfony/contracts",
+                    "url": "https://github.com/symfony/contracts"
+                }
+            },
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Contracts\\Translation\\": ""
+                }
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Nicolas Grekas",
+                    "email": "p at tchwork.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Generic abstractions related to translation",
+            "homepage": "https://symfony.com",
+            "keywords": [
+                "abstractions",
+                "contracts",
+                "decoupling",
+                "interfaces",
+                "interoperability",
+                "standards"
+            ],
+            "support": {
+                "source": "https://github.com/symfony/translation-contracts/tree/v2.3.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-09-28T13:05:58+00:00"
+        },
+        {
+            "name": "symfony/validator",
+            "version": "v5.2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/validator.git",
+                "reference": "7b2583e2c4cb82b23fcb37730981c868efefd2c0"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/validator/zipball/7b2583e2c4cb82b23fcb37730981c868efefd2c0",
+                "reference": "7b2583e2c4cb82b23fcb37730981c868efefd2c0",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2.5",
+                "symfony/deprecation-contracts": "^2.1",
+                "symfony/polyfill-ctype": "~1.8",
+                "symfony/polyfill-mbstring": "~1.0",
+                "symfony/polyfill-php73": "~1.0",
+                "symfony/polyfill-php80": "^1.15",
+                "symfony/translation-contracts": "^1.1|^2"
+            },
+            "conflict": {
+                "doctrine/lexer": "<1.0.2",
+                "phpunit/phpunit": "<5.4.3",
+                "symfony/dependency-injection": "<4.4",
+                "symfony/expression-language": "<5.1",
+                "symfony/http-kernel": "<4.4",
+                "symfony/intl": "<4.4",
+                "symfony/translation": "<4.4",
+                "symfony/yaml": "<4.4"
+            },
+            "require-dev": {
+                "doctrine/annotations": "~1.7",
+                "doctrine/cache": "~1.0",
+                "egulias/email-validator": "^2.1.10",
+                "symfony/cache": "^4.4|^5.0",
+                "symfony/config": "^4.4|^5.0",
+                "symfony/console": "^4.4|^5.0",
+                "symfony/dependency-injection": "^4.4|^5.0",
+                "symfony/expression-language": "^5.1",
+                "symfony/finder": "^4.4|^5.0",
+                "symfony/http-client": "^4.4|^5.0",
+                "symfony/http-foundation": "^4.4|^5.0",
+                "symfony/http-kernel": "^4.4|^5.0",
+                "symfony/intl": "^4.4|^5.0",
+                "symfony/mime": "^4.4|^5.0",
+                "symfony/property-access": "^4.4|^5.0",
+                "symfony/property-info": "^4.4|^5.0",
+                "symfony/translation": "^4.4|^5.0",
+                "symfony/yaml": "^4.4|^5.0"
+            },
+            "suggest": {
+                "doctrine/annotations": "For using the annotation mapping. You will also need doctrine/cache.",
+                "doctrine/cache": "For using the default cached annotation reader.",
+                "egulias/email-validator": "Strict (RFC compliant) email validation",
+                "psr/cache-implementation": "For using the mapping cache.",
+                "symfony/config": "",
+                "symfony/expression-language": "For using the Expression validator and the ExpressionLanguageSyntax constraints",
+                "symfony/http-foundation": "",
+                "symfony/intl": "",
+                "symfony/property-access": "For accessing properties within comparison constraints",
+                "symfony/property-info": "To automatically add NotNull and Type constraints",
+                "symfony/translation": "For translating validation errors.",
+                "symfony/yaml": ""
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Component\\Validator\\": ""
+                },
+                "exclude-from-classmap": [
+                    "/Tests/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien at symfony.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony Validator Component",
+            "homepage": "https://symfony.com",
+            "support": {
+                "source": "https://github.com/symfony/validator/tree/v5.2.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-11-28T11:24:18+00:00"
+        },
+        {
+            "name": "symfony/yaml",
+            "version": "v5.2.0",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/symfony/yaml.git",
+                "reference": "bb73619b2ae5121bbbcd9f191dfd53ded17ae598"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/symfony/yaml/zipball/bb73619b2ae5121bbbcd9f191dfd53ded17ae598",
+                "reference": "bb73619b2ae5121bbbcd9f191dfd53ded17ae598",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=7.2.5",
+                "symfony/deprecation-contracts": "^2.1",
+                "symfony/polyfill-ctype": "~1.8"
+            },
+            "conflict": {
+                "symfony/console": "<4.4"
+            },
+            "require-dev": {
+                "symfony/console": "^4.4|^5.0"
+            },
+            "suggest": {
+                "symfony/console": "For validating YAML files using the lint command"
+            },
+            "bin": [
+                "Resources/bin/yaml-lint"
+            ],
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "Symfony\\Component\\Yaml\\": ""
+                },
+                "exclude-from-classmap": [
+                    "/Tests/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "MIT"
+            ],
+            "authors": [
+                {
+                    "name": "Fabien Potencier",
+                    "email": "fabien at symfony.com"
+                },
+                {
+                    "name": "Symfony Community",
+                    "homepage": "https://symfony.com/contributors"
+                }
+            ],
+            "description": "Symfony Yaml Component",
+            "homepage": "https://symfony.com",
+            "support": {
+                "source": "https://github.com/symfony/yaml/tree/v5.2.0"
+            },
+            "funding": [
+                {
+                    "url": "https://symfony.com/sponsor",
+                    "type": "custom"
+                },
+                {
+                    "url": "https://github.com/fabpot",
+                    "type": "github"
+                },
+                {
+                    "url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
+                    "type": "tidelift"
+                }
+            ],
+            "time": "2020-11-28T10:57:20+00:00"
+        }
     ],
     "packages-dev": [
         {
             "name": "phpstan/phpstan",
-            "version": "0.12.50",
+            "version": "0.12.59",
             "source": {
                 "type": "git",
                 "url": "https://github.com/phpstan/phpstan.git",
-                "reference": "b8248f9c81265af75d6d969ca3252aaf3e998f3a"
+                "reference": "cf4107257c8ca2ad967efdd6a00f12b21acbb779"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/phpstan/phpstan/zipball/b8248f9c81265af75d6d969ca3252aaf3e998f3a",
-                "reference": "b8248f9c81265af75d6d969ca3252aaf3e998f3a",
+                "url": "https://api.github.com/repos/phpstan/phpstan/zipball/cf4107257c8ca2ad967efdd6a00f12b21acbb779",
+                "reference": "cf4107257c8ca2ad967efdd6a00f12b21acbb779",
                 "shasum": ""
             },
             "require": {
@@ -1445,6 +2833,10 @@
                 "MIT"
             ],
             "description": "PHPStan - PHP Static Analysis Tool",
+            "support": {
+                "issues": "https://github.com/phpstan/phpstan/issues",
+                "source": "https://github.com/phpstan/phpstan/tree/0.12.59"
+            },
             "funding": [
                 {
                     "url": "https://github.com/ondrejmirtes",
@@ -1459,20 +2851,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-10-16T12:22:23+00:00"
+            "time": "2020-12-07T14:46:03+00:00"
         },
         {
             "name": "squizlabs/php_codesniffer",
-            "version": "3.5.6",
+            "version": "3.5.8",
             "source": {
                 "type": "git",
                 "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
-                "reference": "e97627871a7eab2f70e59166072a6b767d5834e0"
+                "reference": "9d583721a7157ee997f235f327de038e7ea6dac4"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/e97627871a7eab2f70e59166072a6b767d5834e0",
-                "reference": "e97627871a7eab2f70e59166072a6b767d5834e0",
+                "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/9d583721a7157ee997f235f327de038e7ea6dac4",
+                "reference": "9d583721a7157ee997f235f327de038e7ea6dac4",
                 "shasum": ""
             },
             "require": {
@@ -1510,16 +2902,23 @@
                 "phpcs",
                 "standards"
             ],
-            "time": "2020-08-10T04:50:15+00:00"
+            "support": {
+                "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues",
+                "source": "https://github.com/squizlabs/PHP_CodeSniffer",
+                "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki"
+            },
+            "time": "2020-10-23T02:01:07+00:00"
         }
     ],
     "aliases": [],
     "minimum-stability": "stable",
-    "stability-flags": [],
+    "stability-flags": {
+        "propel/propel": 20
+    },
     "prefer-stable": false,
     "prefer-lowest": false,
     "platform": {
-        "php": ">=7.0.0",
+        "php": ">=7.3.0",
         "ext-intl": "*"
     },
     "platform-dev": [],
diff --git a/propel.yaml b/propel.yaml
new file mode 100644
index 00000000..5b99e32e
--- /dev/null
+++ b/propel.yaml
@@ -0,0 +1,21 @@
+
+
+propel:
+  database:
+      connections:
+          scummvm:
+              adapter: sqlite
+              dsn: sqlite:scummvm.db
+              user: admin
+              password: admin
+              settings:
+                charset: utf8
+  runtime:
+      defaultConnection: scummvm
+      connections:
+          - scummvm
+  generator:
+      defaultConnection: scummvm
+      connections:
+          - scummvm
+
diff --git a/schema.xml b/schema.xml
new file mode 100644
index 00000000..3c34e4ac
--- /dev/null
+++ b/schema.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<database name="scummvm" defaultIdMethod="native" namespace="ScummVM\OrmObjects">
+  <table name="game" phpName="Game">
+    <column name="id" type="varchar" required="true" primaryKey="true"/>
+    <column name="name" type="varchar" size="255" required="true" primaryString="true" />
+    <column name="datafiles" type="varchar" size="255"/>
+    <column name="engine_id" type="varchar" size="24" required="true"/>
+    <column name="company_id" type="varchar" size="24" required="true"/>
+    <column name="moby_id" type="integer"/>
+    <column name="series_id" type="varchar"/>
+    <foreign-key foreignTable="engine">
+      <reference local="engine_id" foreign="id"/>
+    </foreign-key>
+    <foreign-key foreignTable="company">
+      <reference local="company_id" foreign="id"/>
+    </foreign-key>
+    <foreign-key foreignTable="series">
+      <reference local="series_id" foreign="id"/>
+    </foreign-key>
+  </table>
+  <table name="engine" phpName="Engine">
+    <column name="id" type="varchar" required="true" primaryKey="true"/>
+    <column name="name" type="varchar" size="128" required="true"/>
+    <column name="alt_name" type="varchar" size="128"/>
+    <column name="enabled" type="boolean"/>
+  </table>
+  <table name="company" phpName="Company">
+    <column name="id" type="varchar" required="true" primaryKey="true"/>
+    <column name="name" type="varchar" size="128" required="true"/>
+    <column name="alt_name" type="varchar" size="128"/>
+  </table>
+  <table name="series" phpName="Series">
+    <column name="id" type="varchar" required="true" primaryKey="true"/>
+    <column name="name" type="varchar" size="128" required="true"/>
+  </table>
+  <table name="compatibility" phpName="Compatibility">
+    <column name="id" type="varchar" required="true" primaryKey="true"/>
+    <column name="support" type="varchar" size="24" required="true" />
+    <column name="since_version" type="varchar" size="24" required="true" primaryKey="true"/>
+    <column name="stable_platforms" type="varchar" size="255"/>
+    <column name="unstable_platforms" type="varchar" size="255"/>
+    <foreign-key foreignTable="game">
+      <reference local="id" foreign="id"/>
+    </foreign-key>
+    <foreign-key foreignTable="version">
+      <reference local="since_version" foreign="id"/>
+    </foreign-key>
+  </table>
+  <table name="platform" phpName="Platform">
+    <column name="id" type="varchar" required="true" primaryKey="true"/>
+    <column name="name" type="varchar" size="128" required="true"/>
+    <column name="moby_id" type="integer"/>
+  </table>
+  <table name="version" phpName="Version">
+    <column name="id" type="varchar" required="true" primaryKey="true"/>
+    <column name="release_date" type="date"/>
+  </table>
+</database>


Commit: c80da556c0b2df8886e2894230e404e05349995c
    https://github.com/scummvm/scummvm-web/commit/c80da556c0b2df8886e2894230e404e05349995c
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
WEB: Load data into the ORM from YAML

Changed paths:
    include/DataUtils.php


diff --git a/include/DataUtils.php b/include/DataUtils.php
index 1b53a572..bdd4e088 100644
--- a/include/DataUtils.php
+++ b/include/DataUtils.php
@@ -2,6 +2,7 @@
 namespace ScummVM;
 
 require_once __DIR__ . '/../vendor/autoload.php';
+require_once __DIR__ . '/../generated-conf/config.php';
 require_once __DIR__ . '/../include/Constants.php';
 
 use League\Csv\Reader;
@@ -9,6 +10,7 @@ use League\Csv\Statement;
 use Symfony\Component\Yaml\Yaml;
 use GuzzleHttp\Client;
 use GuzzleHttp\Promise;
+use Propel\Runtime\Map\TableMap;
 
 /**
  * DataUtils
@@ -33,7 +35,19 @@ class DataUtils
         'game_downloads' => '1287892109',
     ];
 
-
+    const OBJECT_NAMES = [
+        'platforms' => 'Platform', //
+        'engines' => 'Engine', //
+        'companies' => 'Company', //
+        'versions' => 'Version', //
+        'series' => 'Series', //
+        'games' => 'Game', //
+        'compatibility' => 'Compatibility', //
+        // 'game_demos' => '713475305',
+        // 'screenshots' => '1985243204',
+        // 'scummvm_downloads' => '373699606',
+        // 'game_downloads' => '1287892109',
+    ];
 
     /**
      * Gets the TSV representation from sheets and converts it to YAML on file
@@ -84,7 +98,31 @@ class DataUtils
             \file_put_contents('.clear-cache', '');
         }
     }
+
+    public function convertData() {
+        foreach (self::OBJECT_NAMES as $name => $object) {
+            $file = DIR_DATA . "/" . DEFAULT_LOCALE . "/$name.yaml";
+            $data = Yaml::parseFile($file);
+            foreach($data as $item) {
+                try {
+                    foreach ($item as $key => $val) {
+                        if ($val === '') {
+                            unset($item[$key]);
+                        }
+                    }
+                    $class = "ScummVM\\OrmObjects\\$object";
+                    $dbItem = new $class();
+                    $dbItem->fromArray($item, TableMap::TYPE_FIELDNAME);
+                    $dbItem->save();
+                } catch (\Exception $ex) {
+                    echo json_encode($item) . "\n";
+                    echo $ex->getMessage() . "\n";
+                }
+            }
+        }
+    }
 }
 
 $dataUtils = new DataUtils();
 $dataUtils->getAllData();
+$dataUtils->convertData();


Commit: 8e2c5cd7da3216db7f05b44b3d615031c3100b5b
    https://github.com/scummvm/scummvm-web/commit/8e2c5cd7da3216db7f05b44b3d615031c3100b5b
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
WEB: Model remaining data into the ORM schema

Changed paths:
    include/DataUtils.php
    schema.xml


diff --git a/include/DataUtils.php b/include/DataUtils.php
index bdd4e088..96d6502e 100644
--- a/include/DataUtils.php
+++ b/include/DataUtils.php
@@ -36,17 +36,17 @@ class DataUtils
     ];
 
     const OBJECT_NAMES = [
-        'platforms' => 'Platform', //
-        'engines' => 'Engine', //
-        'companies' => 'Company', //
-        'versions' => 'Version', //
-        'series' => 'Series', //
-        'games' => 'Game', //
-        'compatibility' => 'Compatibility', //
-        // 'game_demos' => '713475305',
-        // 'screenshots' => '1985243204',
-        // 'scummvm_downloads' => '373699606',
-        // 'game_downloads' => '1287892109',
+        'platforms' => 'Platform',
+        'engines' => 'Engine',
+        'companies' => 'Company',
+        'versions' => 'Version',
+        'series' => 'Series',
+        'games' => 'Game',
+        'compatibility' => 'Compatibility',
+        'game_demos' => 'Demo',
+        'screenshots' => 'Screenshot',
+        'scummvm_downloads' => 'Downloads',
+        'game_downloads' => 'GameDownloads',
     ];
 
     /**
@@ -99,11 +99,12 @@ class DataUtils
         }
     }
 
-    public function convertData() {
+    public function convertData()
+    {
         foreach (self::OBJECT_NAMES as $name => $object) {
             $file = DIR_DATA . "/" . DEFAULT_LOCALE . "/$name.yaml";
             $data = Yaml::parseFile($file);
-            foreach($data as $item) {
+            foreach ($data as $item) {
                 try {
                     foreach ($item as $key => $val) {
                         if ($val === '') {
@@ -112,6 +113,12 @@ class DataUtils
                     }
                     $class = "ScummVM\\OrmObjects\\$object";
                     $dbItem = new $class();
+                    if ($object === 'Version') {
+                        $ver = explode(".", $item['id']);
+                        $item['major'] = $ver[0];
+                        $item['minor'] = $ver[1];
+                        $item['patch'] = $ver[2];
+                    }
                     $dbItem->fromArray($item, TableMap::TYPE_FIELDNAME);
                     $dbItem->save();
                 } catch (\Exception $ex) {
diff --git a/schema.xml b/schema.xml
index 3c34e4ac..c553967c 100644
--- a/schema.xml
+++ b/schema.xml
@@ -52,7 +52,57 @@
     <column name="moby_id" type="integer"/>
   </table>
   <table name="version" phpName="Version">
-    <column name="id" type="varchar" required="true" primaryKey="true"/>
+    <column name="id" type="varchar" size="24" required="true" primaryKey="true"/>
+    <column name="major" type="SMALLINT" required="true"/>
+    <column name="minor" type="SMALLINT" required="true"/>
+    <column name="patch" type="SMALLINT" required="true"/>
     <column name="release_date" type="date"/>
   </table>
+  <table name="screenshot" phpName="Screenshot">
+    <!-- id	variant	platform_id	language	filemask -->
+    <column name="id" type="varchar" required="true"/>
+    <column name="variant" type="varchar" size="255" />
+    <column name="platform_id" type="varchar" size="24" required="true"/>
+    <column name="language" type="varchar" size="8" required="true"/>
+    <column name="filemask" type="varchar" size="255" required="true"/>
+    <foreign-key foreignTable="game">
+      <reference local="id" foreign="id"/>
+    </foreign-key>
+    <foreign-key foreignTable="platform">
+      <reference local="platform_id" foreign="id"/>
+    </foreign-key>
+  </table>
+  <table name="demo" phpName="Demo">
+    <column name="id" type="varchar" required="true"/>
+    <column name="platform_id" type="varchar" size="24" required="true"/>
+    <column name="category" type="varchar" size="255"/>
+    <column name="url" type="varchar" size="255"/>
+    <foreign-key foreignTable="game">
+      <reference local="id" foreign="id"/>
+    </foreign-key>
+    <foreign-key foreignTable="platform">
+      <reference local="platform_id" foreign="id"/>
+    </foreign-key>
+  </table>
+  <table name="scummvm_downloads" phpName="Downloads">
+    <column name="name" type="varchar" size="255" required="true"/>
+    <column name="description" type="varchar" size="255"/>
+    <column name="subcategory" type="varchar" size="24" required="true"/>
+    <column name="category" type="varchar" size="24" required="true"/>
+    <column name="category_icon" type="varchar" size="24"/>
+    <column name="enabled" type="boolean" />
+    <column name="user_agent" type="varchar" size="255"/>
+    <column name="url" type="varchar" size="255" required="true"/>
+  </table>
+  <table name="game_downloads" phpName="GameDownloads">
+    <column name="category" type="varchar" size="24" required="true"/>
+    <column name="game_id" type="varchar" size="24" required="true"/>
+    <column name="category_icon" type="varchar" size="24" required="true"/>
+    <column name="name" type="varchar" size="255" required="true"/>
+    <column name="notes" type="varchar" size="255"/>
+    <column name="url" type="varchar" size="255" required="true"/>
+    <foreign-key foreignTable="game">
+      <reference local="game_id" foreign="id"/>
+    </foreign-key>
+  </table>
 </database>


Commit: 878099341696f326280615b74c21f97f9c092ff3
    https://github.com/scummvm/scummvm-web/commit/878099341696f326280615b74c21f97f9c092ff3
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
WEB: Convert most most pages to use the ORM objects

Changed paths:
  A include/Models/SimpleYamlModel.php
  R include/Objects/Company.php
  R include/Objects/Compatibility.php
  R include/Objects/Engine.php
  R include/Objects/Game.php
  R include/Objects/Platform.php
  R include/Objects/Series.php
  R include/Objects/Version.php
    include/Controller.php
    include/Models/GameDownloadsModel.php
    include/Models/GameModel.php
    include/Models/SimpleModel.php
    include/Models/VersionsModel.php
    include/Pages/SimplePage.php
    public_html/index.php


diff --git a/include/Controller.php b/include/Controller.php
index aceca025..29bf0d52 100644
--- a/include/Controller.php
+++ b/include/Controller.php
@@ -2,7 +2,7 @@
 namespace ScummVM;
 
 use Smarty;
-use ScummVM\Models\SimpleModel;
+use ScummVM\Models\SimpleYamlModel;
 
 /**
  * The Controller class will create an instance of the Smarty object configured
@@ -60,7 +60,7 @@ class Controller
         $this->css_files = array();
         $this->js_files = array();
 
-        $this->menuModel = new SimpleModel("MenuItem", "menus.yaml");
+        $this->menuModel = new SimpleYamlModel("MenuItem", "menus.yaml");
         $menus = [];
         /* The menus have caused an exception, need to skip them. */
         if (!ExceptionHandler::skipMenus()) {
diff --git a/include/Models/GameDownloadsModel.php b/include/Models/GameDownloadsModel.php
index 1ce0d12c..512e4d2a 100644
--- a/include/Models/GameDownloadsModel.php
+++ b/include/Models/GameDownloadsModel.php
@@ -4,18 +4,13 @@ namespace ScummVM\Models;
 use ScummVM\Objects\DownloadsSection;
 use Symfony\Component\Yaml\Yaml;
 use ScummVM\Models\GameModel;
+use ScummVM\OrmObjects\GameQuery;
 
 /**
  * The GameDownloadsModel will produce DownloadsSection objects.
  */
 class GameDownloadsModel extends BasicModel
 {
-    private $gameModel;
-
-    public function __construct()
-    {
-        $this->gameModel = new GameModel();
-    }
     /* Get all download entries. */
     public function getAllDownloads()
     {
@@ -23,11 +18,9 @@ class GameDownloadsModel extends BasicModel
         if (is_null($sections)) {
             $fname = $this->getLocalizedFile('game_downloads.yaml');
             $parsedData = @Yaml::parseFile($fname);
-            // error check yaml
-
             $sections = [];
             $sectionsData = $this->getSectionData();
-            $games = $this->gameModel->getAllGames();
+            $gameQuery = GameQuery::create();
             foreach ($parsedData as $data) {
                 // Create Sections
                 $category = $data['category'];
@@ -41,16 +34,17 @@ class GameDownloadsModel extends BasicModel
 
                 // Create Subsections
                 $gameId = $data['game_id'];
+                $gameName = $gameQuery->findPk($gameId)->getName();
                 if (!isset($sections[$category]->getSubSections()[$gameId])) {
                     $sections[$category]->addSubsection(new DownloadsSection([
                         'anchor' => $gameId,
-                        'title' => $games[$gameId]->getName(),
+                        'title' => $gameName,
                         'notes' => $sectionsData[$gameId]['notes']
                     ]));
                 }
 
                 // Add Download to subsection
-                $data['name'] = $games[$gameId]->getName() . " - " . $data['name'];
+                $data['name'] = $gameName . " - " . $data['name'];
                 $sections[$category]->getSubsections()[$gameId]->addItem($data);
             }
             $this->saveToCache($sections);
@@ -58,7 +52,8 @@ class GameDownloadsModel extends BasicModel
         return $sections;
     }
 
-    private function getSectionData() {
+    private function getSectionData()
+    {
         return [
             "games"=>["title"=>"{#gamesXMLTitle#} {#downloadsXMLVersion#}"],
             "addons"=>["title"=>"{#gamesXMLAddons#} {#downloadsXMLVersion#}"],
diff --git a/include/Models/GameModel.php b/include/Models/GameModel.php
index 93f29d3e..35022046 100644
--- a/include/Models/GameModel.php
+++ b/include/Models/GameModel.php
@@ -1,42 +1,19 @@
 <?php
 namespace ScummVM\Models;
 
-use ScummVM\Objects\Game;
-use ScummVM\Models\SimpleModel;
-use Symfony\Component\Yaml\Yaml;
+use ScummVM\OrmObjects\GameQuery;
 
 /**
  * The GamesModel is used to cross reference Games across the website
  */
 class GameModel extends BasicModel
 {
-    private $companiesModel;
-    private $enginesModel;
-    private $seriesModel;
-
-    public function __construct()
-    {
-        $this->companiesModel = new SimpleModel("Company", "companies.yaml");
-        $this->enginesModel = new SimpleModel("Engine", "engines.yaml");
-        $this->seriesModel = new SimpleModel("Series", "series.yaml");
-    }
-
     /* Get all Games from YAML */
     public function getAllGames()
     {
         $data = $this->getFromCache();
         if (is_null($data)) {
-            $companies = $this->companiesModel->getAllData();
-            $engines = $this->enginesModel->getAllData();
-            $series = $this->seriesModel->getAllData();
-            $fname = $this->getLocalizedFile('games.yaml');
-            $games = Yaml::parseFile($fname);
-            $data = [];
-            foreach ($games as $game) {
-                $obj = new Game($game, $engines, $companies, $series);
-                $data[$obj->getId()] = $obj;
-            }
-            $this->saveToCache($data);
+            $data = GameQuery::create()->find();
         }
         return $data;
     }
diff --git a/include/Models/SimpleModel.php b/include/Models/SimpleModel.php
index a5c21a8f..0ca6b625 100644
--- a/include/Models/SimpleModel.php
+++ b/include/Models/SimpleModel.php
@@ -9,36 +9,19 @@ use Symfony\Component\Yaml\Yaml;
  */
 class SimpleModel extends BasicModel
 {
-    private $filename;
-    private $type;
+    private $query;
 
-    const FILE_NOT_FOUND = 'The filename %s could not be found';
-    const YAML_PARSE_FAILED = 'Unable to parse the contents of the file %s';
-
-    public function __construct($type, $filename)
+    public function __construct($type)
     {
         parent::__construct();
-        $this->filename = $this->getLocalizedFile($filename);
-        $this->type = "ScummVM\Objects\\$type";
+        $this->query = "ScummVM\OrmObjects\\{$type}Query::create" ;
     }
 
-    public function getAllData($assignIdsToArray = true)
+    public function getAllData()
     {
         $objects = $this->getFromCache();
         if (is_null($objects)) {
-            $data = @Yaml::parseFile($this->filename);
-            if (!$data || !\is_array($data)) {
-                throw new \ErrorException(\sprintf(self::YAML_PARSE_FAILED, $this->filename));
-            }
-            $objects = [];
-            foreach ($data as $item) {
-                $obj = new $this->type($item);
-                if ($assignIdsToArray && method_exists($obj, "getId")) {
-                    $objects[$obj->getId()] = $obj;
-                } else {
-                    $objects[] = $obj;
-                }
-            }
+            $objects = ($this->query)()->find();
             $this->saveToCache($objects, $this->type);
         }
         return $objects;
diff --git a/include/Models/SimpleYamlModel.php b/include/Models/SimpleYamlModel.php
new file mode 100644
index 00000000..a9d80404
--- /dev/null
+++ b/include/Models/SimpleYamlModel.php
@@ -0,0 +1,46 @@
+<?php
+namespace ScummVM\Models;
+
+use Symfony\Component\Yaml\Yaml;
+
+/**
+ * The SimpleModel is used automatically create simple models
+ * that do not require any special handling
+ */
+class SimpleYamlModel extends BasicModel
+{
+    private $filename;
+    private $type;
+
+    const FILE_NOT_FOUND = 'The filename %s could not be found';
+    const YAML_PARSE_FAILED = 'Unable to parse the contents of the file %s';
+
+    public function __construct($type, $filename)
+    {
+        parent::__construct();
+        $this->filename = $this->getLocalizedFile($filename);
+        $this->type = "ScummVM\Objects\\$type";
+    }
+
+    public function getAllData($assignIdsToArray = true)
+    {
+        $objects = $this->getFromCache();
+        if (is_null($objects)) {
+            $data = @Yaml::parseFile($this->filename);
+            if (!$data || !\is_array($data)) {
+                throw new \ErrorException(\sprintf(self::YAML_PARSE_FAILED, $this->filename));
+            }
+            $objects = [];
+            foreach ($data as $item) {
+                $obj = new $this->type($item);
+                if ($assignIdsToArray && method_exists($obj, "getId")) {
+                    $objects[$obj->getId()] = $obj;
+                } else {
+                    $objects[] = $obj;
+                }
+            }
+            $this->saveToCache($objects, $this->type);
+        }
+        return $objects;
+    }
+}
diff --git a/include/Models/VersionsModel.php b/include/Models/VersionsModel.php
index e40b8772..30bf3641 100644
--- a/include/Models/VersionsModel.php
+++ b/include/Models/VersionsModel.php
@@ -1,8 +1,8 @@
 <?php
 namespace ScummVM\Models;
 
-use ScummVM\Objects\Version;
-use Symfony\Component\Yaml\Yaml;
+use ScummVM\OrmObjects\Version;
+use ScummVM\OrmObjects\VersionQuery;
 
 /**
  * The VersionsModel is used to cross reference versions across the website
@@ -14,21 +14,13 @@ class VersionsModel extends BasicModel
     {
         $data = $this->getFromCache();
         if (is_null($data)) {
-            $fname = $this->getLocalizedFile('versions.yaml');
-            $versions = Yaml::parseFile($fname);
-
-            $data = [];
-            foreach ($versions as $version) {
-                $obj = new Version($version);
-                $data[$obj->getId()] = $obj;
-            }
-
-            \uasort($data, "version_compare");
-
-            if (!array_key_exists('DEV', $data)) {
-                $data['DEV'] = new Version(["id" => 'DEV', "date" => "1/1/2099"]);
+            $dev = VersionQuery::create()->findPk('DEV');
+            if (!$dev) {
+                $dev = new Version();
+                $dev->fromArray(["Id" => 'DEV', 'Major' => 9, 'Minor' => 9, 'Patch' => 9]);
+                $dev->save();
             }
-            $data = array_reverse($data, true);
+            $data = VersionQuery::create()->orderByReleaseDate()->find();
             $this->saveToCache($data);
         }
         return $data;
diff --git a/include/Objects/Company.php b/include/Objects/Company.php
deleted file mode 100644
index bc8a4da4..00000000
--- a/include/Objects/Company.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-namespace ScummVM\Objects;
-
-/**
- * The Company object represents companies with games
- * known to ScummVM.
- */
-class Company extends DataObject
-{
-    private $name;
-    private $alt_name;
-
-    /* Article object constructor. */
-    public function __construct($data)
-    {
-        parent::__construct($data);
-        $this->name = $this->assignFromArray('name', $data, true);
-        $this->alt_name = $this->assignFromArray('alt_name', $data);
-    }
-
-    /* Get the company name. */
-    public function getName()
-    {
-        return $this->name;
-    }
-
-    /* Get the alternative name */
-    public function getAltName()
-    {
-        return $this->alt_name;
-    }
-}
diff --git a/include/Objects/Compatibility.php b/include/Objects/Compatibility.php
deleted file mode 100644
index 7a76507b..00000000
--- a/include/Objects/Compatibility.php
+++ /dev/null
@@ -1,97 +0,0 @@
-<?php
-namespace ScummVM\Objects;
-
-use Erusev\Parsedown;
-
-/**
- * The Compatibility object represents a game on the compatibility charts on the
- * website.
- */
-class Compatibility extends DataObject
-{
-    private $game;
-    private $supportLevel;
-    private $notes;
-    private $sinceVersion;
-    private $stablePlatforms;
-    private $unstablePlatforms;
-
-    /* Project object constructor. */
-    public function __construct($data, $games, $platforms)
-    {
-        parent::__construct($data);
-        $this->supportLevel = $this->assignFromArray('support', $data, true);
-        $this->notes = $this->assignFromArray('notes', $data);
-        $this->sinceVersion = $this->assignFromArray('since_version', $data, true);
-        $this->stablePlatforms =
-            $this->processPlatforms($this->assignFromArray('stable_platforms', $data, true), $platforms);
-        $this->unstablePlatforms =
-        $this->processPlatforms($this->assignFromArray('unstable_platforms', $data), $platforms);
-        $this->game = $this->assignFromArray($data['id'], $games, true);
-    }
-
-    private function processPlatforms($values, $platforms)
-    {
-        $retVal = "";
-        foreach (\explode(",", $values) as $platform) {
-            if (array_key_exists($platform, $platforms)) {
-                $retVal .= "- " . $platforms[$platform]->getName() . "\n";
-            }
-        }
-        return $retVal;
-    }
-
-    /* Get the support level. */
-    public function getSupportLevel()
-    {
-        return $this->supportLevel;
-    }
-
-    /* Get the notes. */
-    public function getNotes()
-    {
-        $notes = "**Support Level:**\n\n";
-        $notes .= "%$this->supportLevel%\n\n";
-
-        if ($this->stablePlatforms) {
-            $notes .= "**Supported Platforms:**\n";
-            $notes .= "$this->stablePlatforms\n";
-        }
-
-        if ($this->unstablePlatforms) {
-            $notes .= "**Unsupported Platforms:**\n";
-            $notes .= "$this->unstablePlatforms\n";
-        }
-
-        if ($this->notes) {
-            $notes .= "**Additional Notes:**\n";
-            $notes .= str_replace("- ", "\n- ", $this->notes) . "\n";
-        }
-
-        $config = \HTMLPurifier_Config::createDefault();
-        $purifier = new \HTMLPurifier($config);
-        $parsedown = new \Parsedown();
-        $notes = $parsedown->text($notes);
-        $notes = $purifier->purify($notes);
-        return $notes;
-    }
-
-    /* Get the datafiles uri. */
-    public function getDatafiles()
-    {
-        return $this->game->getDatafiles();
-    }
-
-    public function getGame()
-    {
-        return $this->game;
-    }
-
-    public function getVersion()
-    {
-        if ($this->sinceVersion === 'DEV') {
-            return '9.9.9';
-        }
-        return $this->sinceVersion;
-    }
-}
diff --git a/include/Objects/Engine.php b/include/Objects/Engine.php
deleted file mode 100644
index 40f43ae6..00000000
--- a/include/Objects/Engine.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-namespace ScummVM\Objects;
-
-/**
- * The Engine object represents a game engine known to ScummVM
- */
-class Engine extends DataObject
-{
-    private $name;
-    private $alt_name;
-    private $enabled;
-
-    /* Article object constructor. */
-    public function __construct($data)
-    {
-        parent::__construct($data);
-        $this->name = $this->assignFromArray('name', $data, true);
-        $this->alt_name = $this->assignFromArray('alt_name', $data);
-        $this->enabled = $this->assignFromArray('enabled', $data);
-    }
-
-    /* Get the engine name. */
-    public function getName()
-    {
-        return $this->name;
-    }
-
-    /* Get the alternative name */
-    public function getAltName()
-    {
-        return $this->alt_name;
-    }
-
-     /* Get the engine enabled status. */
-    public function getEnabled()
-    {
-        return $this->enabled;
-    }
-}
diff --git a/include/Objects/Game.php b/include/Objects/Game.php
deleted file mode 100644
index d2df8aec..00000000
--- a/include/Objects/Game.php
+++ /dev/null
@@ -1,68 +0,0 @@
-<?php
-namespace ScummVM\Objects;
-
-/**
- * The Game object represents a game known to ScummVM
- */
-class Game extends DataObject
-{
-    private $name;
-    private $engine;
-    private $company;
-    private $moby_id;
-    private $datafiles;
-    private $series;
-
-    /* Article object constructor. */
-    public function __construct($data, $engines, $companies, $series)
-    {
-        parent::__construct($data);
-        $this->name = $this->assignFromArray('name', $data, true);
-        $this->moby_id = $this->assignFromArray('moby_id', $data);
-        $this->datafiles = $this->assignFromArray('datafiles', $data);
-        $this->company = $this->assignFromArray($data['company_id'], $companies);
-        $this->engine = $this->assignFromArray($data['engine_id'], $engines, true);
-        $this->series = $this->assignFromArray($data['series_id'], $series);
-    }
-
-    public function __toString()
-    {
-        return $this->getName();
-    }
-
-    /* Get the game name. */
-    public function getName()
-    {
-        return $this->name;
-    }
-
-    /* Get the ScummVM engine name */
-    public function getEngine()
-    {
-        return $this->engine;
-    }
-
-     /* Get the company who made the game */
-    public function getCompany()
-    {
-        return $this->company;
-    }
-
-     /* Get the mobygames id. */
-    public function getMobyId()
-    {
-        return $this->moby_id;
-    }
-
-     /* Get the link to the game datafiles. */
-    public function getDatafiles()
-    {
-        return $this->datafiles;
-    }
-
-    /* Get the game series object. */
-    public function getSeries()
-    {
-        return $this->series;
-    }
-}
diff --git a/include/Objects/Platform.php b/include/Objects/Platform.php
deleted file mode 100644
index c70f0540..00000000
--- a/include/Objects/Platform.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-namespace ScummVM\Objects;
-
-/**
- * The Platform object represents the named representation of a game platform
- */
-class Platform extends DataObject
-{
-    private $name;
-
-    /* Article object constructor. */
-    public function __construct($data)
-    {
-        parent::__construct($data);
-        $this->name = $this->assignFromArray('name', $data, true);
-    }
-
-    /* Get the platform name. */
-    public function getName()
-    {
-        return $this->name;
-    }
-}
diff --git a/include/Objects/Series.php b/include/Objects/Series.php
deleted file mode 100644
index 0448c0c2..00000000
--- a/include/Objects/Series.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-namespace ScummVM\Objects;
-
-/**
- * The Platform object represents the named representation of a game platform
- */
-class Series extends DataObject
-{
-    private $name;
-
-    /* Article object constructor. */
-    public function __construct($data)
-    {
-        parent::__construct($data);
-        $this->name = $this->assignFromArray('name', $data, true);
-    }
-
-    /* Get the platform name. */
-    public function getName()
-    {
-        return $this->name;
-    }
-}
diff --git a/include/Objects/Version.php b/include/Objects/Version.php
deleted file mode 100644
index c8bf7024..00000000
--- a/include/Objects/Version.php
+++ /dev/null
@@ -1,23 +0,0 @@
-<?php
-namespace ScummVM\Objects;
-
-/**
- * The Version object represents a ScummVM release version
- */
-class Version extends DataObject
-{
-    private $releaseDate;
-
-    /* Article object constructor. */
-    public function __construct($data)
-    {
-        parent::__construct($data);
-        $this->releaseDate = $this->assignFromArray('release_date', $data);
-    }
-
-    /* Get the version release name. */
-    public function getDate()
-    {
-        return $this->releaseDate;
-    }
-}
diff --git a/include/Pages/SimplePage.php b/include/Pages/SimplePage.php
index c2a037d1..804d8ee9 100644
--- a/include/Pages/SimplePage.php
+++ b/include/Pages/SimplePage.php
@@ -2,7 +2,7 @@
 namespace ScummVM\Pages;
 
 use ScummVM\Controller;
-use ScummVM\Models\SimpleModel;
+use ScummVM\Models\SimpleYamlModel;
 
 class SimplePage extends Controller
 {
@@ -30,7 +30,7 @@ class SimplePage extends Controller
         }
         if (array_key_exists($key, self::PAGE_MODELS)) {
             [$model, $data] = self::PAGE_MODELS[$key];
-            $this->model = new SimpleModel($model, $data);
+            $this->model = new SimpleYamlModel($model, $data);
         }
     }
 
diff --git a/public_html/index.php b/public_html/index.php
index 9b0c3b03..6ae5fd38 100644
--- a/public_html/index.php
+++ b/public_html/index.php
@@ -16,6 +16,7 @@ if (isset($_SERVER['SERVER_SOFTWARE']) &&
 }
 
 require_once __DIR__ . '/../vendor/autoload.php';
+require_once __DIR__ . '/../generated-conf/config.php';
 require_once __DIR__ . '/../include/Constants.php';
 
 /**


Commit: f1a969bdbd9451b5b0629c2e791959ea17103511
    https://github.com/scummvm/scummvm-web/commit/f1a969bdbd9451b5b0629c2e791959ea17103511
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
WEB: Use ORM objects for Screenshots

Changed paths:
  A generated-classes/ScummVM/OrmObjects/Screenshot.php
  R include/Objects/Screenshot.php
    .gitignore
    include/Models/ScreenshotsModel.php
    include/Pages/ScreenshotsPage.php
    schema.xml
    templates/components/list_items.tpl


diff --git a/.gitignore b/.gitignore
index 2430e96b..20507209 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,7 +37,8 @@ public_html/frs
 .no-cache
 
 # Propel
-generated-classes
+generated-classes/ScummVM/OrmObjects/*
+!generated-classes/ScummVM/OrmObjects/Screenshot.php
 generated-conf
 generated-sql
 scummvm.db
diff --git a/generated-classes/ScummVM/OrmObjects/Screenshot.php b/generated-classes/ScummVM/OrmObjects/Screenshot.php
new file mode 100644
index 00000000..7fa91487
--- /dev/null
+++ b/generated-classes/ScummVM/OrmObjects/Screenshot.php
@@ -0,0 +1,93 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\Screenshot as BaseScreenshot;
+
+/**
+ * Skeleton subclass for representing a row from the 'screenshot' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class Screenshot extends BaseScreenshot
+{
+    public function getFiles()
+    {
+        if (!$this->files) {
+            foreach (glob("./" . DIR_SCREENSHOTS . "/" . $this->getFilemask()) as $file) {
+                if (\strpos($file, "_full.") !== false) {
+                    continue;
+                }
+                // Remove the base folder and extension
+                $name = str_replace("./" . DIR_SCREENSHOTS . "/", "", $file);
+                $name = \substr($name, 0, \strlen($name) - 4);
+                $this->files[] = [
+                    'filename' => $name,
+                    'caption' => $this->getCaption(),
+                ];
+            }
+        }
+        return $this->files;
+    }
+
+    public function addFiles($files)
+    {
+        if (is_array($this->files)) {
+            $this->files = array_merge($this->files, $files);
+        } else {
+            $this->files = $files;
+        }
+
+    }
+
+    public function getCategory()
+    {
+        $series = $this->getGame()->getSeries();
+        if ($series) {
+            return $series->getId();
+        } else {
+            return $this->getId();
+        }
+    }
+
+    public function getName()
+    {
+        $series = $this->getGame()->getSeries();
+        if ($series) {
+            return "{$series->getName()} (Series)";
+        } else {
+            return $this->getGame()->getName();
+        }
+    }
+
+    public function getCaption()
+    {
+        $name =  $this->getGame()->getName();
+        $extras = [];
+        if ($this->getVariant()) {
+            $extras[] = $this->getVariant();
+        }
+        if ($this->getPlatform()) {
+            $extras[] = $this->getPlatform()->getName();
+        }
+        if ($this->getLanguage()) {
+            $extras[] = \locale_get_display_language($this->getLanguage(), "en");
+        }
+
+        if (count($extras) > 0) {
+            $extra = \join("/", $extras);
+            return "$name ($extra)";
+        }
+
+        return $name;
+    }
+
+    public function __toString()
+    {
+        return $this->getCaption();
+    }
+}
diff --git a/include/Models/ScreenshotsModel.php b/include/Models/ScreenshotsModel.php
index 1c349b0b..ebe6ae68 100644
--- a/include/Models/ScreenshotsModel.php
+++ b/include/Models/ScreenshotsModel.php
@@ -1,10 +1,7 @@
 <?php
 namespace ScummVM\Models;
 
-use ScummVM\Objects\Screenshot;
-use ScummVM\Models\GameModel;
-use ScummVM\Models\SimpleModel;
-use Symfony\Component\Yaml\Yaml;
+use ScummVM\OrmObjects\ScreenshotQuery;
 
 /**
  * The ScreenshotsModel will generate Screenshot objects.
@@ -14,32 +11,19 @@ class ScreenshotsModel extends BasicModel
     const INVALID_TARGET = 'Invalid target specified.';
     const INVALID_CATEGORY = 'Invalid category specified.';
 
-    private $platformsModel;
-    private $gameModel;
-
-    public function __construct()
-    {
-        $this->platformsModel = new SimpleModel("Platform", "platforms.yaml");
-        $this->gameModel = new GameModel();
-    }
-
     /* Get all screenshots. */
     public function getAllScreenshots()
     {
-        $fname = $this->getLocalizedFile('screenshots.yaml');
-        $screenshots = Yaml::parseFile($fname);
-        $platforms = $this->platformsModel->getAllData();
-        $games = $this->gameModel->getAllGames();
+        $screenshots = ScreenshotQuery::create()->find();
         $data = [];
         foreach ($screenshots as $screenshot) {
-            $obj = new Screenshot($screenshot, $games, $platforms);
-            if (array_key_exists($obj->getCategory(), $data)) {
-                $data[$obj->getCategory()]->addFiles($obj->getFiles());
+            $category = $screenshot->getCategory();
+            if (isset($data[$category])) {
+                $data[$screenshot->getCategory()]->addFiles($screenshot->getFiles());
             } else {
-                $data[$obj->getCategory()] = $obj;
+                $data[$screenshot->getCategory()] = $screenshot;
             }
         }
-
         return $data;
     }
 
@@ -49,24 +33,24 @@ class ScreenshotsModel extends BasicModel
         $entries = [];
 
         // create top level company categories
-        foreach ($screenshots as $value) {
-            $game = $value->getGame();
+        foreach ($screenshots as $screenshot) {
+            $game = $screenshot->getGame();
             $company = $game->getCompany();
             $companyId = $company ? $company->getId() : 'other';
             $companyName = $company ? $company->getName() : 'Other';
 
-            if (!array_key_exists($companyId, $entries)) {
+            if (!isset($entries[$companyId])) {
                 $entries[$companyId] = [
                     'title' => $companyName . " Games",
                     'category' => $companyId,
                     'games' => [],
                 ];
             }
-            $entries[$companyId]['games'][] = $value;
+            $entries[$companyId]['games'][] = $screenshot;
         }
 
         // Create Other top level category and sort everything
-        if (!array_key_exists('other', $entries)) {
+        if (!isset($entries['other'])) {
             $entries['other'] = [
                 'title' => 'Other Games',
                 'category' => 'other',
@@ -97,10 +81,10 @@ class ScreenshotsModel extends BasicModel
     /* Get all screenshots in one category. */
     public function getCategoryScreenshots($category)
     {
-        $sshots = $this->getGroupedScreenshots();
-        foreach ($sshots as $shots) {
-            if ($shots['category'] == $category) {
-                return $shots;
+        $screenshots = $this->getGroupedScreenshots();
+        foreach ($screenshots as $screenshot) {
+            if ($screenshot['category'] == $category) {
+                return $screenshot;
             }
         }
         throw new \ErrorException(self::INVALID_CATEGORY);
diff --git a/include/Objects/Screenshot.php b/include/Objects/Screenshot.php
deleted file mode 100644
index 94b92339..00000000
--- a/include/Objects/Screenshot.php
+++ /dev/null
@@ -1,109 +0,0 @@
-<?php
-namespace ScummVM\Objects;
-
-/**
- * The Screenshot object represents all screenshots for one game.
- */
-class Screenshot extends DataObject
-{
-    private $platform;
-    private $language;
-    private $variant;
-    private $filename;
-    private $game;
-    private $files;
-
-    /* The Screenshot object constructor. */
-    public function __construct($data, $games, $platforms)
-    {
-        parent::__construct($data);
-        $this->platform = $this->assignFromArray($data['platform_id'], $platforms);
-        $this->language = $this->assignFromArray('language', $data);
-        $this->variant = $this->assignFromArray('variant', $data);
-        $this->filename = $this->assignFromArray('filemask', $data, true);
-        $this->game = $this->assignFromArray($data['id'], $games);
-        $this->files = [];
-        foreach (glob("./" . DIR_SCREENSHOTS . "/" . $this->filename) as $file) {
-            if (\strpos($file, "_full.") !== false) {
-                continue;
-            }
-            // Remove the base folder and extension
-            $name = str_replace("./" . DIR_SCREENSHOTS . "/", "", $file);
-            $name = \substr($name, 0, \strlen($name) - 4);
-            $this->files[] = [
-                'filename' => $name,
-                'caption' => $this->getCaption(),
-            ];
-        }
-    }
-
-    public function getFiles()
-    {
-        return $this->files;
-    }
-
-    public function addFiles($files)
-    {
-        $this->files = array_merge($this->files, $files);
-    }
-
-    public function getCategory()
-    {
-        if ($this->game->getSeries()) {
-            return $this->game->getSeries()->getId();
-        } else {
-            return $this->getId();
-        }
-    }
-
-    public function getName()
-    {
-        if ($this->game->getSeries()) {
-            return $this->game->getSeries()->getName() . " (Series)";
-        } else {
-            return $this->game->getName();
-        }
-    }
-
-    public function getPlatform()
-    {
-        return $this->platform;
-    }
-
-    public function getFilename()
-    {
-        return $this->filename;
-    }
-
-    public function getGame()
-    {
-        return $this->game;
-    }
-
-    public function getCaption()
-    {
-        $name =  $this->game->getName();
-        $extras = [];
-        if ($this->variant) {
-            $extras[] = $this->variant;
-        }
-        if ($this->platform) {
-            $extras[] = $this->platform->getName();
-        }
-        if ($this->language) {
-            $extras[] = \locale_get_display_language($this->language, "en");
-        }
-
-        if (count($extras) > 0) {
-            $extra = \join("/", $extras);
-            return "$name ($extra)";
-        }
-
-        return $name;
-    }
-
-    public function __toString()
-    {
-        return $this->getCaption();
-    }
-}
diff --git a/include/Pages/ScreenshotsPage.php b/include/Pages/ScreenshotsPage.php
index 634303d3..2d678964 100644
--- a/include/Pages/ScreenshotsPage.php
+++ b/include/Pages/ScreenshotsPage.php
@@ -7,7 +7,6 @@ use ScummVM\Models\ScreenshotsModel;
 class ScreenshotsPage extends Controller
 {
     private $screenshotsModel;
-    private $template_category;
 
     /* Constructor. */
     public function __construct()
diff --git a/schema.xml b/schema.xml
index c553967c..537ee317 100644
--- a/schema.xml
+++ b/schema.xml
@@ -64,7 +64,7 @@
     <column name="variant" type="varchar" size="255" />
     <column name="platform_id" type="varchar" size="24" required="true"/>
     <column name="language" type="varchar" size="8" required="true"/>
-    <column name="filemask" type="varchar" size="255" required="true"/>
+    <column name="filemask" type="varchar" size="255" required="true" primaryKey="true"/>
     <foreign-key foreignTable="game">
       <reference local="id" foreign="id"/>
     </foreign-key>
diff --git a/templates/components/list_items.tpl b/templates/components/list_items.tpl
index 2ab2ac37..6361289b 100644
--- a/templates/components/list_items.tpl
+++ b/templates/components/list_items.tpl
@@ -36,7 +36,7 @@
                 <li class="link">
                     <a href="{$item->getURL()}">{$item->getName()}</a>: {$item->getDescription()}
                 </li>
-            {elseif $item instanceof ScummVM\Objects\Screenshot}
+            {elseif $item instanceof ScummVM\OrmObjects\Screenshot}
                 <li class="file">
                     <span class="sprite-games-{$item->getCategory()} sprite"></span>
                     <a href="{'/screenshots/'|lang}{$arr.category}/{$item->getCategory()}/">{$item->getName()}</a>


Commit: c71dce7702eb1d1f376b985ba113b1288068da78
    https://github.com/scummvm/scummvm-web/commit/c71dce7702eb1d1f376b985ba113b1288068da78
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
WEB: Move downloads page to use the ORM

Changed paths:
    include/Models/DownloadsModel.php
    include/Objects/DownloadsSection.php


diff --git a/include/Models/DownloadsModel.php b/include/Models/DownloadsModel.php
index a430b7bc..2bc2edc1 100644
--- a/include/Models/DownloadsModel.php
+++ b/include/Models/DownloadsModel.php
@@ -3,8 +3,8 @@
 namespace ScummVM\Models;
 
 use ScummVM\Objects\DownloadsSection;
-use Symfony\Component\Yaml\Yaml;
 use DeviceDetector\Parser\OperatingSystem as OsParser;
+use ScummVM\OrmObjects\DownloadsQuery;
 
 /**
  * The DownloadsModel will produce DownloadsSection objects.
@@ -16,19 +16,13 @@ class DownloadsModel extends BasicModel
     {
         $sections = $this->getFromCache();
         if (is_null($sections)) {
-            $fname = $this->getLocalizedFile('scummvm_downloads.yaml');
-            $parsedData = @Yaml::parseFile($fname);
-            // error check yaml
-
+            $parsedData = DownloadsQuery::create()
+                ->findByEnabled(true);
             $sections = [];
             $sectionsData = $this->getSectionData();
             foreach ($parsedData as $data) {
-                if (!$data['enabled'] === TRUE) {
-                    continue;
-                }
-
                 // Create Sections
-                $category = $data['category'];
+                $category = $data->getCategory();
                 if (!isset($sections[$category])) {
                     $sections[$category] = new DownloadsSection([
                         'anchor' => $category,
@@ -38,7 +32,7 @@ class DownloadsModel extends BasicModel
                 }
 
                 // Create Subsections
-                $subCategory = $data['subcategory'];
+                $subCategory = $data->getSubcategory();
                 if (!isset($sections[$category]->getSubSections()[$subCategory])) {
                     $sections[$category]->addSubsection(new DownloadsSection([
                         'anchor' => $subCategory,
@@ -82,68 +76,52 @@ class DownloadsModel extends BasicModel
             return false;
         }
 
-        $downloads = $this->getAllDownloads();
-
         $osParser = new OsParser();
         $osParser->setUserAgent($_SERVER['HTTP_USER_AGENT']);
         $os = $osParser->parse();
 
-        foreach ($downloads as $section) {
-            foreach ($section->getSubSections() as $subsection) {
-                $version = array_values(
-                    array_filter(
-                        $subsection->getItems(),
-                        function ($item) use ($os) {
-                            if ($item->getUserAgent() != "") {
-                                $ua = preg_quote($item->getUserAgent(), '/');
-                                return preg_match("/({$ua})/i", $os['name']);
-                            }
-                        }
-                    )
-                );
-
-                if ($version) {
-                    $curItem = $version[0];
-                    $url = str_replace('{$release}', RELEASE, $curItem->getURL());
-                    sscanf($url, "/frs/scummvm/%s", $versionStr);
-                    $version = substr($versionStr, 0, strpos($versionStr, "/"));
-                    $name = strip_tags($curItem->getName());
-                    $data = $curItem->getExtraInfo();
-                    if (is_array($data)) {
-                        $extra_text = $data['size'] . " ";
-                        if ($data['ext'] == '.exe') {
-                            $extra_text = $extra_text . 'Win32 ';
-                        }
-
-                        $extra_text .= $data['ext'] . " " . $data['msg'];
-                    } else {
-                        $extra_text = $data;
-                    }
+        $downloads = DownloadsQuery::create()
+            ->setIgnoreCase(true)
+            ->findByUserAgent($os['name']);
+
+        foreach ($downloads as $download) {
+            $url = str_replace('{$release}', RELEASE, $download->getURL());
+            sscanf($url, "/frs/scummvm/%s", $versionStr);
+            $version = substr($versionStr, 0, strpos($versionStr, "/"));
+            $name = strip_tags($download->getName());
+            $data = ""; //$download->getExtraInfo();
+            if (is_array($data)) {
+                $extra_text = $data['size'] . " ";
+                if ($data['ext'] == '.exe') {
+                    $extra_text = $extra_text . 'Win32 ';
+                }
 
-                    /*
-                    Get the version information for our store releases for
-                    Android and the Snap store. Since we can't rely on the
-                    file names here, we set them via Constants.php
-                    */
-                    if ($os['name'] === 'Android') {
-                        $version = RELEASE_ANDROID_STORE;
-                    }
+                $extra_text .= $data['ext'] . " " . $data['msg'];
+            } else {
+                $extra_text = $data;
+            }
 
-                    if ($os['name'] === 'Ubuntu') {
-                        $version = RELEASE_SNAP_STORE;
-                        $extra_text = '(snap install scummvm)';
-                    }
+            /*
+            Get the version information for our store releases for
+            Android and the Snap store. Since we can't rely on the
+            file names here, we set them via Constants.php
+            */
+            if ($os['name'] === 'Android') {
+                $version = RELEASE_ANDROID_STORE;
+            }
 
-                    return [
-                        'os' => $name,
-                        'ver' => $version,
-                        'desc' => $extra_text,
-                        'url' => $url,
-                    ];
-                }
+            if ($os['name'] === 'Ubuntu') {
+                $version = RELEASE_SNAP_STORE;
+                $extra_text = '(snap install scummvm)';
             }
-        }
 
+            return [
+                'os' => $name,
+                'ver' => $version,
+                'desc' => $extra_text,
+                'url' => $url,
+            ];
+        }
         return false;
     }
 }
diff --git a/include/Objects/DownloadsSection.php b/include/Objects/DownloadsSection.php
index 2948b1ab..a8aaaf75 100644
--- a/include/Objects/DownloadsSection.php
+++ b/include/Objects/DownloadsSection.php
@@ -1,6 +1,9 @@
 <?php
 namespace ScummVM\Objects;
 
+use Propel\Runtime\Map\TableMap;
+use ScummVM\OrmObjects\Downloads;
+
 /**
  * The DownloadsSection object represents a section on the downloads page.
  */
@@ -24,12 +27,12 @@ class DownloadsSection extends BasicSection
 
     }
 
-    public function addItem($item)
+    public function addItem(Downloads $item)
     {
-        if ($item['category_icon']) {
-            $this->items[] = new File($item, '');
+        if ($item->getCategoryIcon()) {
+            $this->items[] = new File($item->toArray(TableMap::TYPE_FIELDNAME), '');
         } else {
-            $this->items[] = new WebLink($item);
+            $this->items[] = new WebLink($item->toArray(TableMap::TYPE_FIELDNAME));
         }
     }
 


Commit: 1e7f0f1684434e58e6bd0dee13e191cbcef7983e
    https://github.com/scummvm/scummvm-web/commit/1e7f0f1684434e58e6bd0dee13e191cbcef7983e
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
WEB: Auto generate PK when undefined

Changed paths:
    schema.xml


diff --git a/schema.xml b/schema.xml
index 537ee317..25486bba 100644
--- a/schema.xml
+++ b/schema.xml
@@ -1,5 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <database name="scummvm" defaultIdMethod="native" namespace="ScummVM\OrmObjects">
+  <behavior name="auto_add_pk">
+    <parameter name="name" value="auto_id" />
+  </behavior>
   <table name="game" phpName="Game">
     <column name="id" type="varchar" required="true" primaryKey="true"/>
     <column name="name" type="varchar" size="255" required="true" primaryString="true" />
@@ -8,13 +11,13 @@
     <column name="company_id" type="varchar" size="24" required="true"/>
     <column name="moby_id" type="integer"/>
     <column name="series_id" type="varchar"/>
-    <foreign-key foreignTable="engine">
+    <foreign-key foreignTable="engine" onDelete="CASCADE">
       <reference local="engine_id" foreign="id"/>
     </foreign-key>
-    <foreign-key foreignTable="company">
+    <foreign-key foreignTable="company" onDelete="CASCADE">
       <reference local="company_id" foreign="id"/>
     </foreign-key>
-    <foreign-key foreignTable="series">
+    <foreign-key foreignTable="series" onDelete="CASCADE">
       <reference local="series_id" foreign="id"/>
     </foreign-key>
   </table>
@@ -39,10 +42,10 @@
     <column name="since_version" type="varchar" size="24" required="true" primaryKey="true"/>
     <column name="stable_platforms" type="varchar" size="255"/>
     <column name="unstable_platforms" type="varchar" size="255"/>
-    <foreign-key foreignTable="game">
+    <foreign-key foreignTable="game" onDelete="CASCADE">
       <reference local="id" foreign="id"/>
     </foreign-key>
-    <foreign-key foreignTable="version">
+    <foreign-key foreignTable="version" onDelete="CASCADE">
       <reference local="since_version" foreign="id"/>
     </foreign-key>
   </table>
@@ -64,11 +67,11 @@
     <column name="variant" type="varchar" size="255" />
     <column name="platform_id" type="varchar" size="24" required="true"/>
     <column name="language" type="varchar" size="8" required="true"/>
-    <column name="filemask" type="varchar" size="255" required="true" primaryKey="true"/>
-    <foreign-key foreignTable="game">
+    <column name="filemask" type="varchar" size="255" required="true"/>
+    <foreign-key foreignTable="game" onDelete="CASCADE">
       <reference local="id" foreign="id"/>
     </foreign-key>
-    <foreign-key foreignTable="platform">
+    <foreign-key foreignTable="platform" onDelete="CASCADE">
       <reference local="platform_id" foreign="id"/>
     </foreign-key>
   </table>
@@ -77,10 +80,10 @@
     <column name="platform_id" type="varchar" size="24" required="true"/>
     <column name="category" type="varchar" size="255"/>
     <column name="url" type="varchar" size="255"/>
-    <foreign-key foreignTable="game">
+    <foreign-key foreignTable="game" onDelete="CASCADE">
       <reference local="id" foreign="id"/>
     </foreign-key>
-    <foreign-key foreignTable="platform">
+    <foreign-key foreignTable="platform" onDelete="CASCADE">
       <reference local="platform_id" foreign="id"/>
     </foreign-key>
   </table>
@@ -101,7 +104,7 @@
     <column name="name" type="varchar" size="255" required="true"/>
     <column name="notes" type="varchar" size="255"/>
     <column name="url" type="varchar" size="255" required="true"/>
-    <foreign-key foreignTable="game">
+    <foreign-key foreignTable="game" onDelete="CASCADE">
       <reference local="game_id" foreign="id"/>
     </foreign-key>
   </table>


Commit: a74cd5d8f481058c5fcdcfa604c3e04c20aca1d6
    https://github.com/scummvm/scummvm-web/commit/a74cd5d8f481058c5fcdcfa604c3e04c20aca1d6
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
WEB: Move Game Demos to ORM

Changed paths:
  A generated-classes/ScummVM/OrmObjects/Demo.php
  R include/Objects/GameDemo.php
    include/Models/GameDemosModel.php


diff --git a/generated-classes/ScummVM/OrmObjects/Demo.php b/generated-classes/ScummVM/OrmObjects/Demo.php
new file mode 100644
index 00000000..6ff7e11b
--- /dev/null
+++ b/generated-classes/ScummVM/OrmObjects/Demo.php
@@ -0,0 +1,30 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\Demo as BaseDemo;
+
+/**
+ * Skeleton subclass for representing a row from the 'demo' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class Demo extends BaseDemo
+{
+    public function getName()
+    {
+        $gameName = $this->getGame()->getName();
+        $platformName = $this->getPlatform()->getName();
+        $category = $this->getCategory();
+        return "$gameName ($platformName $category Demo)";
+    }
+
+    public function __toString()
+    {
+        return $this->getName();
+    }
+}
diff --git a/include/Models/GameDemosModel.php b/include/Models/GameDemosModel.php
index dfb1641d..c1a2b579 100644
--- a/include/Models/GameDemosModel.php
+++ b/include/Models/GameDemosModel.php
@@ -1,38 +1,24 @@
 <?php
 namespace ScummVM\Models;
 
-use ScummVM\Objects\GameDemo;
-use ScummVM\Models\GameModel;
-use Symfony\Component\Yaml\Yaml;
+use ScummVM\OrmObjects\DemoQuery;
 
 /**
  * The GameDemosModel class will generate GameDemo objects.
  */
 class GameDemosModel extends BasicModel
 {
-    private $gameModel;
-    private $platformsModel;
-
-    public function __construct()
-    {
-        $this->gameModel = new GameModel();
-        $this->platformsModel = new SimpleModel("Platform", "platforms.yaml");
-    }
     /* Get all the groups and their respective demos. */
     public function getAllGroupsAndDemos()
     {
         $groupedData = $this->getFromCache();
         if (is_null($groupedData)) {
-            $fname = $this->getLocalizedFile('game_demos.yaml');
-            $demos = Yaml::parseFile($fname);
-            $games = $this->gameModel->getAllGames();
-            $platforms = $this->platformsModel->getAllData();
-            $data = [];
-            foreach ($demos as $demo) {
-                $obj = new GameDemo($demo, $games, $platforms);
-                $data[] = $obj;
-            }
-            $groupedData =  $this->createGroups($data);
+            $demos = DemoQuery::create()
+                ->useGameQuery()
+                ->orderByName()
+                ->endUse()
+            ->find();
+            $groupedData =  $this->createGroups($demos);
             $this->saveToCache($groupedData);
         }
         return $groupedData;
@@ -43,13 +29,14 @@ class GameDemosModel extends BasicModel
         $groups = [];
         foreach ($demos as $demo) {
             $company = $demo->getGame()->getCompany();
-            if (is_string($company)) {
+
+            if ($company === null) {
                 $companyName = "Unknown";
             } else {
                 $companyName = $company->getName();
             }
             $companyId = $company->getId();
-            if (!array_key_exists($companyId, $groups)) {
+            if (!isset($groups[$companyId])) {
                 $groups[$companyId] = [
                     'name' => "$companyName Demos",
                     'href' => $companyId,
@@ -67,7 +54,6 @@ class GameDemosModel extends BasicModel
             'demos' => []
         ];
         foreach ($groups as $key => $group) {
-            \sort($groups[$key]['demos'], SORT_STRING);
             if (count($groups[$key]['demos']) <= 15) {
                 $groups['other']['demos'] = \array_merge($groups['other']['demos'], $groups[$key]['demos']);
                 unset($groups[$key]);
diff --git a/include/Objects/GameDemo.php b/include/Objects/GameDemo.php
deleted file mode 100644
index 3312ac2f..00000000
--- a/include/Objects/GameDemo.php
+++ /dev/null
@@ -1,63 +0,0 @@
-<?php
-namespace ScummVM\Objects;
-
-/**
- * The GameDemo class represents a game demo item on the website.
- */
-class GameDemo extends DataObject
-{
-
-    private $url;
-    private $category;
-    private $platform;
-    private $game;
-
-    /* GameDemo object constructor. */
-    public function __construct($data, $games, $platforms)
-    {
-        parent::__construct($data);
-        $this->url = $this->assignFromArray('url', $data, true);
-        $this->platform = $this->assignFromArray($data['platform'], $platforms, true);
-        $this->game = $this->assignFromArray($data['id'], $games, true);
-        $this->category = $this->assignFromArray('category', $data);
-    }
-
-    public function __toString()
-    {
-        return $this->getName();
-    }
-
-    /* Get the download URL for the demo. */
-    public function getURL()
-    {
-        return $this->url;
-    }
-
-    /* Get the platform for the demo. */
-    public function getPlatform()
-    {
-        return $this->platform;
-    }
-
-    /* Get the game for the demo. */
-    public function getGame()
-    {
-        return $this->game;
-    }
-
-    /* Get the category for the demo. */
-    public function getCategory()
-    {
-        return $this->category;
-    }
-
-    /* Get the category for the demo. */
-    public function getName()
-    {
-        $gameName = $this->game->getName();
-        $platformName = $this->platform->getName();
-        $category = $this->getCategory();
-        return "$gameName ($platformName $category Demo)";
-    }
-}
-//


Commit: 22ef91d2a511cf1ef5dc4b4ffae4726cc8836dbc
    https://github.com/scummvm/scummvm-web/commit/22ef91d2a511cf1ef5dc4b4ffae4726cc8836dbc
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
WEB: Migrate game downloads to use the ORM

Changed paths:
    include/Models/GameDownloadsModel.php
    include/Objects/DownloadsSection.php


diff --git a/include/Models/GameDownloadsModel.php b/include/Models/GameDownloadsModel.php
index 512e4d2a..48c01d4b 100644
--- a/include/Models/GameDownloadsModel.php
+++ b/include/Models/GameDownloadsModel.php
@@ -2,9 +2,7 @@
 namespace ScummVM\Models;
 
 use ScummVM\Objects\DownloadsSection;
-use Symfony\Component\Yaml\Yaml;
-use ScummVM\Models\GameModel;
-use ScummVM\OrmObjects\GameQuery;
+use ScummVM\OrmObjects\GameDownloadsQuery;
 
 /**
  * The GameDownloadsModel will produce DownloadsSection objects.
@@ -16,25 +14,31 @@ class GameDownloadsModel extends BasicModel
     {
         $sections = $this->getFromCache();
         if (is_null($sections)) {
-            $fname = $this->getLocalizedFile('game_downloads.yaml');
-            $parsedData = @Yaml::parseFile($fname);
             $sections = [];
             $sectionsData = $this->getSectionData();
-            $gameQuery = GameQuery::create();
-            foreach ($parsedData as $data) {
-                // Create Sections
-                $category = $data['category'];
-                if (!isset($sections[$category])) {
-                    $sections[$category] = new DownloadsSection([
+            $categories = GameDownloadsQuery::create()
+                ->select('category')
+                ->distinct()
+                ->find();
+
+            foreach ($categories as $category) {
+                $sections[$category] = new DownloadsSection([
                         'anchor' => $category,
                         'title' => $sectionsData[$category]['title'],
                         'notes' => $sectionsData[$category]['notes']
                     ]);
-                }
+            }
+
+            $gameDownloads = GameDownloadsQuery::create()
+                ->joinWithGame()
+                ->find();
+            foreach ($gameDownloads as $gameDownload) {
+                // Create Sections
+                $category = $gameDownload->getCategory();
+                $gameId = $gameDownload->getGameId();
+                $gameName = $gameDownload->getGame()->getName();
 
                 // Create Subsections
-                $gameId = $data['game_id'];
-                $gameName = $gameQuery->findPk($gameId)->getName();
                 if (!isset($sections[$category]->getSubSections()[$gameId])) {
                     $sections[$category]->addSubsection(new DownloadsSection([
                         'anchor' => $gameId,
@@ -44,8 +48,8 @@ class GameDownloadsModel extends BasicModel
                 }
 
                 // Add Download to subsection
-                $data['name'] = $gameName . " - " . $data['name'];
-                $sections[$category]->getSubsections()[$gameId]->addItem($data);
+                $gameDownload->setName($gameName . " - " . $gameDownload->getName());
+                $sections[$category]->getSubsections()[$gameId]->addItem($gameDownload);
             }
             $this->saveToCache($sections);
         }
diff --git a/include/Objects/DownloadsSection.php b/include/Objects/DownloadsSection.php
index a8aaaf75..d4daee55 100644
--- a/include/Objects/DownloadsSection.php
+++ b/include/Objects/DownloadsSection.php
@@ -2,7 +2,6 @@
 namespace ScummVM\Objects;
 
 use Propel\Runtime\Map\TableMap;
-use ScummVM\OrmObjects\Downloads;
 
 /**
  * The DownloadsSection object represents a section on the downloads page.
@@ -24,10 +23,9 @@ class DownloadsSection extends BasicSection
         parent::__construct($data);
         $this->notes = $data['notes'];
         $this->items = [];
-
     }
 
-    public function addItem(Downloads $item)
+    public function addItem($item)
     {
         if ($item->getCategoryIcon()) {
             $this->items[] = new File($item->toArray(TableMap::TYPE_FIELDNAME), '');


Commit: 8f961660d8bb1a2c78dcd5dcc1e6bfdb21a94c22
    https://github.com/scummvm/scummvm-web/commit/8f961660d8bb1a2c78dcd5dcc1e6bfdb21a94c22
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
WEB: Move compatibility to the ORM model

Changed paths:
  A generated-classes/ScummVM/OrmObjects/Compatibility.php
    include/Models/CompatibilityModel.php
    include/Pages/CompatibilityPage.php
    schema.xml
    templates/components/compatibility_details.tpl
    templates/pages/compatibility.tpl


diff --git a/generated-classes/ScummVM/OrmObjects/Compatibility.php b/generated-classes/ScummVM/OrmObjects/Compatibility.php
new file mode 100644
index 00000000..585fa7a6
--- /dev/null
+++ b/generated-classes/ScummVM/OrmObjects/Compatibility.php
@@ -0,0 +1,61 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\Compatibility as BaseCompatibility;
+
+/**
+ * Skeleton subclass for representing a row from the 'compatibility' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class Compatibility extends BaseCompatibility
+{
+    private function processPlatforms($values)
+    {
+        $platforms = \explode(",", $values);
+
+        $data = PlatformQuery::create()->findPks($platforms);
+        $retVal = '';
+        foreach ($data as $platform) {
+            $retVal .= "- {$platform->getName()} \n";
+        }
+        return $retVal;
+    }
+
+    public function getNotes()
+    {
+        $notes = "**Support Level:**\n\n";
+        $notes .= "%{$this->getSupport()}%\n\n";
+
+        if ($stable = $this->getStablePlatforms()) {
+            $notes .= "**Supported Platforms:**\n";
+            $notes .= "{$this->processPlatforms($stable)}\n";
+        }
+
+        if ($unstable = $this->getUnstablePlatforms) {
+            $notes .= "**Unsupported Platforms:**\n";
+            $notes .= "{$this->processPlatforms($unstable)}\n";
+        }
+
+        if ($this->notes) {
+            $notes .= "**Additional Notes:**\n";
+            $notes .= str_replace("- ", "\n- ",  parent::getNotes()) . "\n";
+        }
+
+        $config = \HTMLPurifier_Config::createDefault();
+        $purifier = new \HTMLPurifier($config);
+        $parsedown = new \Parsedown();
+        $notes = $parsedown->text($notes);
+        $notes = $purifier->purify($notes);
+        return $notes;
+    }
+
+    public function getDataFiles() {
+        return $this->getGame()->getDataFiles();
+    }
+}
diff --git a/include/Models/CompatibilityModel.php b/include/Models/CompatibilityModel.php
index ca3c056b..5badffe1 100644
--- a/include/Models/CompatibilityModel.php
+++ b/include/Models/CompatibilityModel.php
@@ -1,11 +1,8 @@
 <?php
 namespace ScummVM\Models;
 
-use ScummVM\Objects\Compatibility;
-use ScummVM\Models\GameModel;
-use ScummVM\Models\SimpleModel;
-use Composer\Semver\Comparator;
-use Symfony\Component\Yaml\Yaml;
+use Propel\Runtime\ActiveQuery\Criteria;
+use ScummVM\OrmObjects\Base\CompatibilityQuery;
 
 /**
  * The CompatibilityModel class will generate CompatGame objects.
@@ -15,15 +12,6 @@ class CompatibilityModel extends BasicModel
     const NO_VERSION = 'No version specified.';
     const NO_VERSION_TARGET = 'No version and/or target specified.';
     const NOT_FOUND = 'Did not find any games for the specified version.';
-    const NO_FILES = 'No compatibility files found.';
-    private $gameModel;
-    private $platformsModel;
-
-    public function __construct()
-    {
-        $this->gameModel = new GameModel();
-        $this->platformsModel = new SimpleModel("Platform", "platforms.yaml");
-    }
 
     public function getLastUpdated()
     {
@@ -34,27 +22,27 @@ class CompatibilityModel extends BasicModel
     public function getAllData($version)
     {
         $data = $this->getFromCache($version);
-        if (is_null($data)) {
-            $fname = $this->getLocalizedFile("compatibility.yaml");
-            $compatibilityEntries = Yaml::parseFile($fname);
-            $games = $this->gameModel->getAllGames();
-            $platforms = $this->platformsModel->getAllData();
-            $compareVersion = $version === 'DEV' ? '9.9.9' : $version;
-            $data = [];
-            foreach ($compatibilityEntries as $compat) {
-                $obj = new Compatibility($compat, $games, $platforms);
-                $objVersion = $obj->getVersion();
-                if (Comparator::lessThanOrEqualTo($objVersion, $compareVersion)) {
-                    if (array_key_exists($obj->getId(), $data)) {
-                        $existingVersion = $data[$obj->getId()]->getVersion();
-                        if (Comparator::greaterThan($objVersion, $existingVersion)) {
-                            $data[$obj->getId()] = $obj;
-                        }
-                    } else {
-                        $data[$obj->getId()] = $obj;
-                    }
-                }
+        if (\is_null($data)) {
+            if ($version === 'DEV') {
+                $version = "99.99.99";
             }
+            $version = \explode('.', $version);
+            $data = CompatibilityQuery::create()
+                ->withColumn("max(release_date)")
+                ->groupById()
+                ->useGameQuery()
+                    ->orderByName()
+                    ->joinCompany()
+                    ->useEngineQuery()
+                        ->filterByEnabled(true)
+                    ->endUse()
+                ->endUse()
+                ->useVersionQuery()
+                    ->filterByMajor($version[0], Criteria::LESS_EQUAL)
+                    ->filterByMinor($version[1], Criteria::LESS_EQUAL)
+                    ->filterByPatch($version[2], Criteria::LESS_EQUAL)
+                ->endUse()
+                ->find();
             $this->saveToCache($data, $version);
         }
         return $data;
@@ -66,57 +54,53 @@ class CompatibilityModel extends BasicModel
         if (!is_string($version) || !is_string($target)) {
             throw new \ErrorException(self::NO_VERSION_TARGET);
         }
-        if (!($all_games = $this->getAllData($version))) {
-            throw new \ErrorException(self::NOT_FOUND);
+        if ($version === 'DEV') {
+            $version = "99.99.99";
         }
+        $version = explode('.', $version);
+        $gameData = CompatibilityQuery::create()
+                ->joinVersion()
+                ->withColumn("max(release_date)")
+                ->filterById($target)
+                ->useVersionQuery()
+                    ->filterByMajor($version[0], Criteria::LESS_EQUAL)
+                    ->filterByMinor($version[1], Criteria::LESS_EQUAL)
+                    ->filterByPatch($version[2], Criteria::LESS_EQUAL)
+                ->endUse()
+            ->findOne();
 
-        if (!array_key_exists($target, $all_games)) {
+        if (!$gameData) {
             throw new \ErrorException(self::NOT_FOUND);
         }
 
-        return $all_games[$target];
+        return $gameData;
     }
 
     public function getAllDataGroups($version)
     {
-        $data = self::getAllData($version);
+        $data = $this->getAllData($version);
         $compat_data = [];
         foreach ($data as $compat) {
-            $engine = $compat->getGame()->getEngine();
             $company = $compat->getGame()->getCompany();
 
-            if ($engine->getEnabled()) {
-                $engineName = $engine->getName();
-                if (is_string($company) || \is_null($company)) {
-                    $companyName = "Unknown";
-                } else {
-                    $companyName = $company->getName();
-                }
-                if (!array_key_exists($companyName, $compat_data)) {
-                    $compat_data[$companyName] = [];
-                }
-                $compat_data[$companyName][] = $compat;
+            if (!$company) {
+                $companyName = "Unknown";
+            } else {
+                $companyName = $company->getName();
+            }
+            if (!isset($compat_data[$companyName])) {
+                $compat_data[$companyName] = [];
             }
+            $compat_data[$companyName][] = $compat;
         }
         $compat_data['Other'] = [];
         foreach ($compat_data as $key => $company) {
-            \sort($compat_data[$key], SORT_STRING);
             if (count($compat_data[$key]) < 3) {
                 $compat_data['Other'] = \array_merge($compat_data['Other'], $company);
                 unset($compat_data[$key]);
             }
         }
-        if ($compat_data['Other']) {
-            \sort($compat_data['Other'], SORT_STRING);
-        } else {
-            unset($compat_data['Other']);
-        }
 
         return $compat_data;
     }
-
-    private function compatibilitySorter($compat1, $compat2)
-    {
-        return strnatcmp($compat1->getName(), $compat2->getName());
-    }
 }
diff --git a/include/Pages/CompatibilityPage.php b/include/Pages/CompatibilityPage.php
index 90f7b2d8..69822486 100644
--- a/include/Pages/CompatibilityPage.php
+++ b/include/Pages/CompatibilityPage.php
@@ -3,7 +3,7 @@ namespace ScummVM\Pages;
 
 use ScummVM\Controller;
 use ScummVM\Models\CompatibilityModel;
-use ScummVM\Models\VersionsModel;
+use ScummVM\OrmObjects\VersionQuery;
 
 /**
  * The Compatibility page gets all the data from the CompatibilityModel and
@@ -15,7 +15,6 @@ class CompatibilityPage extends Controller
     private $supportLevel;
     private $supportLevelDescriptions;
     private $supportLevelClass;
-    private $versionsModel;
     private $compatibilityModel;
 
     /* Constructor. */
@@ -47,7 +46,6 @@ class CompatibilityPage extends Controller
             'excellent' => 'pct100'
         );
 
-        $this->versionsModel = new VersionsModel();
         $this->compatibilityModel = new CompatibilityModel();
     }
 
@@ -57,12 +55,16 @@ class CompatibilityPage extends Controller
         $version = $args['version'];
         $target = $args['game'];
 
-        $versions = $this->versionsModel->getAllVersions();
-        unset($versions['DEV']);
+        $versions = VersionQuery::create()
+            ->orderByMajor()
+            ->orderByMinor()
+            ->orderByPatch()
+            ->select('id')
+            ->find()->toArray();
 
         /* Default to DEV */
-        if (!in_array($version, $versions)) {
-            $version = 'DEV';
+        if (!in_array($version, $versions) || $version === 'DEV') {
+            $version = '99.99.99';
         }
 
         if (!empty($target)) {
@@ -105,8 +107,9 @@ class CompatibilityPage extends Controller
         $last_updated = $this->compatibilityModel->getLastUpdated();
         $this->template = 'pages/compatibility.tpl';
 
+        $version = $version == '99.99.99' ? 'DEV' : $version;
         return $this->renderPage(
-            array(
+            [
                 'title' => preg_replace('/{version}/', $version, $this->getConfigVars('compatibilityTitle')),
                 'content_title' => preg_replace(
                     '/{version}/',
@@ -120,7 +123,7 @@ class CompatibilityPage extends Controller
                 'support_level_header' => $this->supportLevel,
                 'support_level_description' => $this->supportLevelDescriptions,
                 'support_level_class' => $this->supportLevelClass
-            )
+            ]
         );
     }
 }
diff --git a/schema.xml b/schema.xml
index 25486bba..3f9792a9 100644
--- a/schema.xml
+++ b/schema.xml
@@ -40,6 +40,7 @@
     <column name="id" type="varchar" required="true" primaryKey="true"/>
     <column name="support" type="varchar" size="24" required="true" />
     <column name="since_version" type="varchar" size="24" required="true" primaryKey="true"/>
+    <column name="notes" type="varchar"/>
     <column name="stable_platforms" type="varchar" size="255"/>
     <column name="unstable_platforms" type="varchar" size="255"/>
     <foreign-key foreignTable="game" onDelete="CASCADE">
diff --git a/templates/components/compatibility_details.tpl b/templates/components/compatibility_details.tpl
index ce6a6862..8082e31d 100644
--- a/templates/components/compatibility_details.tpl
+++ b/templates/components/compatibility_details.tpl
@@ -1,4 +1,4 @@
-{assign var="x" value=$game->getSupportLevel()}
+{assign var="x" value=$game->getSupport()}
 {assign var="pct_class" value=$support_level_class.$x}
 {assign var="support_level" value=$support_level_header.$x}
 {assign var="support_description" value=$support_level_description.$x}
@@ -31,4 +31,4 @@
 </p>
 {/capture}
 
-{include "components/box.tpl" head={#compatibilityDetailsInto#} content=$smarty.capture.content}
\ No newline at end of file
+{include "components/box.tpl" head={#compatibilityDetailsInto#} content=$smarty.capture.content}
diff --git a/templates/pages/compatibility.tpl b/templates/pages/compatibility.tpl
index f2e5ed5d..44608709 100644
--- a/templates/pages/compatibility.tpl
+++ b/templates/pages/compatibility.tpl
@@ -67,14 +67,14 @@
     </thead>
     <tbody>
         {foreach from=$games item=game}
-        {assign var="x" value=$game->getSupportLevel()}
+        {assign var="x" value=$game->getSupport()}
         {assign var="pct_class" value=$support_level_class.$x}
         {assign var="support_level" value=$support_level_header.$x}
         <tr class="color{cycle values='2,0'}">
             <td class="gameFullName"><a href="{'/compatibility/'|lang}{$version}/{$game->getGame()->getId()}/">{$game->getGame()->getName()}</a></td>
             <td class="gameShortName">{$game->getGame()->getId()}</td>
             <td class="gameDatafiles">
-                {if $game->getDatafiles()}
+            {if $game->getDatafiles()}
                 <a href="{$game->getDatafiles()}">{#compatabilityDetailsDetails#}</a></td>
             {else}
             ---
@@ -87,4 +87,4 @@
 {/foreach}
 {/capture}
 
-{include file="components/box.tpl" head=$content_title intro=$smarty.capture.intro content=$smarty.capture.content}
\ No newline at end of file
+{include file="components/box.tpl" head=$content_title intro=$smarty.capture.intro content=$smarty.capture.content}


Commit: 9e4310229462746a8e42a5948054291d8fd0f22b
    https://github.com/scummvm/scummvm-web/commit/9e4310229462746a8e42a5948054291d8fd0f22b
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
WEB: Add all ORM Objects to ScummVM package

Changed paths:
  A include/OrmObjects/Company.php
  A include/OrmObjects/CompanyQuery.php
  A include/OrmObjects/Compatibility.php
  A include/OrmObjects/CompatibilityQuery.php
  A include/OrmObjects/Demo.php
  A include/OrmObjects/DemoQuery.php
  A include/OrmObjects/Downloads.php
  A include/OrmObjects/DownloadsQuery.php
  A include/OrmObjects/Engine.php
  A include/OrmObjects/EngineQuery.php
  A include/OrmObjects/Game.php
  A include/OrmObjects/GameDownloads.php
  A include/OrmObjects/GameDownloadsQuery.php
  A include/OrmObjects/GameQuery.php
  A include/OrmObjects/Platform.php
  A include/OrmObjects/PlatformQuery.php
  A include/OrmObjects/Screenshot.php
  A include/OrmObjects/ScreenshotQuery.php
  A include/OrmObjects/Series.php
  A include/OrmObjects/SeriesQuery.php
  A include/OrmObjects/Version.php
  A include/OrmObjects/VersionQuery.php
  R generated-classes/ScummVM/OrmObjects/Compatibility.php
  R generated-classes/ScummVM/OrmObjects/Demo.php
  R generated-classes/ScummVM/OrmObjects/Screenshot.php


diff --git a/include/OrmObjects/Company.php b/include/OrmObjects/Company.php
new file mode 100644
index 00000000..62a57ea4
--- /dev/null
+++ b/include/OrmObjects/Company.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\Company as BaseCompany;
+
+/**
+ * Skeleton subclass for representing a row from the 'company' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class Company extends BaseCompany
+{
+
+}
diff --git a/include/OrmObjects/CompanyQuery.php b/include/OrmObjects/CompanyQuery.php
new file mode 100644
index 00000000..ee7846cd
--- /dev/null
+++ b/include/OrmObjects/CompanyQuery.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\CompanyQuery as BaseCompanyQuery;
+
+/**
+ * Skeleton subclass for performing query and update operations on the 'company' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class CompanyQuery extends BaseCompanyQuery
+{
+
+}
diff --git a/generated-classes/ScummVM/OrmObjects/Compatibility.php b/include/OrmObjects/Compatibility.php
similarity index 100%
rename from generated-classes/ScummVM/OrmObjects/Compatibility.php
rename to include/OrmObjects/Compatibility.php
diff --git a/include/OrmObjects/CompatibilityQuery.php b/include/OrmObjects/CompatibilityQuery.php
new file mode 100644
index 00000000..7916f368
--- /dev/null
+++ b/include/OrmObjects/CompatibilityQuery.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\CompatibilityQuery as BaseCompatibilityQuery;
+
+/**
+ * Skeleton subclass for performing query and update operations on the 'compatibility' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class CompatibilityQuery extends BaseCompatibilityQuery
+{
+
+}
diff --git a/generated-classes/ScummVM/OrmObjects/Demo.php b/include/OrmObjects/Demo.php
similarity index 100%
rename from generated-classes/ScummVM/OrmObjects/Demo.php
rename to include/OrmObjects/Demo.php
diff --git a/include/OrmObjects/DemoQuery.php b/include/OrmObjects/DemoQuery.php
new file mode 100644
index 00000000..44ba1971
--- /dev/null
+++ b/include/OrmObjects/DemoQuery.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\DemoQuery as BaseDemoQuery;
+
+/**
+ * Skeleton subclass for performing query and update operations on the 'demo' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class DemoQuery extends BaseDemoQuery
+{
+
+}
diff --git a/include/OrmObjects/Downloads.php b/include/OrmObjects/Downloads.php
new file mode 100644
index 00000000..524c4c2d
--- /dev/null
+++ b/include/OrmObjects/Downloads.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\Downloads as BaseDownloads;
+
+/**
+ * Skeleton subclass for representing a row from the 'scummvm_downloads' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class Downloads extends BaseDownloads
+{
+
+}
diff --git a/include/OrmObjects/DownloadsQuery.php b/include/OrmObjects/DownloadsQuery.php
new file mode 100644
index 00000000..43970489
--- /dev/null
+++ b/include/OrmObjects/DownloadsQuery.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\DownloadsQuery as BaseDownloadsQuery;
+
+/**
+ * Skeleton subclass for performing query and update operations on the 'scummvm_downloads' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class DownloadsQuery extends BaseDownloadsQuery
+{
+
+}
diff --git a/include/OrmObjects/Engine.php b/include/OrmObjects/Engine.php
new file mode 100644
index 00000000..dde7a21a
--- /dev/null
+++ b/include/OrmObjects/Engine.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\Engine as BaseEngine;
+
+/**
+ * Skeleton subclass for representing a row from the 'engine' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class Engine extends BaseEngine
+{
+
+}
diff --git a/include/OrmObjects/EngineQuery.php b/include/OrmObjects/EngineQuery.php
new file mode 100644
index 00000000..fd63ad2c
--- /dev/null
+++ b/include/OrmObjects/EngineQuery.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\EngineQuery as BaseEngineQuery;
+
+/**
+ * Skeleton subclass for performing query and update operations on the 'engine' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class EngineQuery extends BaseEngineQuery
+{
+
+}
diff --git a/include/OrmObjects/Game.php b/include/OrmObjects/Game.php
new file mode 100644
index 00000000..963edf76
--- /dev/null
+++ b/include/OrmObjects/Game.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\Game as BaseGame;
+
+/**
+ * Skeleton subclass for representing a row from the 'game' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class Game extends BaseGame
+{
+
+}
diff --git a/include/OrmObjects/GameDownloads.php b/include/OrmObjects/GameDownloads.php
new file mode 100644
index 00000000..b07ca27c
--- /dev/null
+++ b/include/OrmObjects/GameDownloads.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\GameDownloads as BaseGameDownloads;
+
+/**
+ * Skeleton subclass for representing a row from the 'game_downloads' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class GameDownloads extends BaseGameDownloads
+{
+
+}
diff --git a/include/OrmObjects/GameDownloadsQuery.php b/include/OrmObjects/GameDownloadsQuery.php
new file mode 100644
index 00000000..a359d84d
--- /dev/null
+++ b/include/OrmObjects/GameDownloadsQuery.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\GameDownloadsQuery as BaseGameDownloadsQuery;
+
+/**
+ * Skeleton subclass for performing query and update operations on the 'game_downloads' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class GameDownloadsQuery extends BaseGameDownloadsQuery
+{
+
+}
diff --git a/include/OrmObjects/GameQuery.php b/include/OrmObjects/GameQuery.php
new file mode 100644
index 00000000..5b616a07
--- /dev/null
+++ b/include/OrmObjects/GameQuery.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\GameQuery as BaseGameQuery;
+
+/**
+ * Skeleton subclass for performing query and update operations on the 'game' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class GameQuery extends BaseGameQuery
+{
+
+}
diff --git a/include/OrmObjects/Platform.php b/include/OrmObjects/Platform.php
new file mode 100644
index 00000000..21ef0fa8
--- /dev/null
+++ b/include/OrmObjects/Platform.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\Platform as BasePlatform;
+
+/**
+ * Skeleton subclass for representing a row from the 'platform' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class Platform extends BasePlatform
+{
+
+}
diff --git a/include/OrmObjects/PlatformQuery.php b/include/OrmObjects/PlatformQuery.php
new file mode 100644
index 00000000..47cb038e
--- /dev/null
+++ b/include/OrmObjects/PlatformQuery.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\PlatformQuery as BasePlatformQuery;
+
+/**
+ * Skeleton subclass for performing query and update operations on the 'platform' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class PlatformQuery extends BasePlatformQuery
+{
+
+}
diff --git a/generated-classes/ScummVM/OrmObjects/Screenshot.php b/include/OrmObjects/Screenshot.php
similarity index 100%
rename from generated-classes/ScummVM/OrmObjects/Screenshot.php
rename to include/OrmObjects/Screenshot.php
diff --git a/include/OrmObjects/ScreenshotQuery.php b/include/OrmObjects/ScreenshotQuery.php
new file mode 100644
index 00000000..8d5b132d
--- /dev/null
+++ b/include/OrmObjects/ScreenshotQuery.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\ScreenshotQuery as BaseScreenshotQuery;
+
+/**
+ * Skeleton subclass for performing query and update operations on the 'screenshot' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class ScreenshotQuery extends BaseScreenshotQuery
+{
+
+}
diff --git a/include/OrmObjects/Series.php b/include/OrmObjects/Series.php
new file mode 100644
index 00000000..f2cdf66b
--- /dev/null
+++ b/include/OrmObjects/Series.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\Series as BaseSeries;
+
+/**
+ * Skeleton subclass for representing a row from the 'series' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class Series extends BaseSeries
+{
+
+}
diff --git a/include/OrmObjects/SeriesQuery.php b/include/OrmObjects/SeriesQuery.php
new file mode 100644
index 00000000..5b2db928
--- /dev/null
+++ b/include/OrmObjects/SeriesQuery.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\SeriesQuery as BaseSeriesQuery;
+
+/**
+ * Skeleton subclass for performing query and update operations on the 'series' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class SeriesQuery extends BaseSeriesQuery
+{
+
+}
diff --git a/include/OrmObjects/Version.php b/include/OrmObjects/Version.php
new file mode 100644
index 00000000..1f906076
--- /dev/null
+++ b/include/OrmObjects/Version.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\Version as BaseVersion;
+
+/**
+ * Skeleton subclass for representing a row from the 'version' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class Version extends BaseVersion
+{
+
+}
diff --git a/include/OrmObjects/VersionQuery.php b/include/OrmObjects/VersionQuery.php
new file mode 100644
index 00000000..3aa6cd20
--- /dev/null
+++ b/include/OrmObjects/VersionQuery.php
@@ -0,0 +1,19 @@
+<?php
+
+namespace ScummVM\OrmObjects;
+
+use ScummVM\OrmObjects\Base\VersionQuery as BaseVersionQuery;
+
+/**
+ * Skeleton subclass for performing query and update operations on the 'version' table.
+ *
+ *
+ *
+ * You should add additional methods to this class to meet the
+ * application requirements.  This class will only be generated as
+ * long as it does not already exist in the output directory.
+ */
+class VersionQuery extends BaseVersionQuery
+{
+
+}


Commit: 635156a755a7f35c25571161ed55dbff107be620
    https://github.com/scummvm/scummvm-web/commit/635156a755a7f35c25571161ed55dbff107be620
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
BUILD: Auto generate ORM database and config in proper locations

Changed paths:
    .gitignore
    composer.json
    composer.lock
    propel.yaml


diff --git a/.gitignore b/.gitignore
index 20507209..b262ba10 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,8 +37,8 @@ public_html/frs
 .no-cache
 
 # Propel
-generated-classes/ScummVM/OrmObjects/*
-!generated-classes/ScummVM/OrmObjects/Screenshot.php
-generated-conf
-generated-sql
-scummvm.db
+/orm
+/data/scummvm-web.db
+/include/OrmObjects/Base
+/include/OrmObjects/Map
+/propel.yaml-e
diff --git a/composer.json b/composer.json
index ac9ccab6..e5e0b532 100644
--- a/composer.json
+++ b/composer.json
@@ -14,10 +14,9 @@
     "smarty/smarty": "^3.1",
     "ezyang/htmlpurifier": "^4.10",
     "altorouter/altorouter": "^2.0",
-    "piwik/device-detector": "^3.11",
+    "matomo/device-detector": "^3.11",
     "spatie/yaml-front-matter": "^2.0",
     "erusev/parsedown": "^1.7",
-    "composer/semver": "^3.2",
     "phpfastcache/phpfastcache": "^8.0",
     "league/csv": "^9.6",
     "symfony/yaml": "^5.1",
@@ -62,11 +61,13 @@
       "php include/DataUtils.php"
     ],
     "database": [
-      "rm scummvm.db",
+      "sed -i'' -e \"s#{{BASE_DIR}}#$(pwd)#g\" propel.yaml",
       "propel sql:build",
       "propel model:build",
       "propel config:convert",
-      "propel sql:insert"
+      "propel sql:insert",
+      "composer dumpautoload",
+      "sed -i'' -e \"s#$(pwd)#{{BASE_DIR}}#g\" propel.yaml"
     ],
     "localize": [
       "php include/LocalizationUtils.php"
@@ -85,7 +86,6 @@
         "include/",
         "public_html/index.php"
       ]
-    },
-    "classmap": ["generated-classes/"]
+    }
   }
 }
diff --git a/composer.lock b/composer.lock
index f83a876d..45faebe0 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "d8cbbe3a4b4c8807c615ab403a051763",
+    "content-hash": "0dd600fed1a3c27eb64a90e9bc1e97da",
     "packages": [
         {
             "name": "altorouter/altorouter",
@@ -66,87 +66,6 @@
             },
             "time": "2019-11-23T11:01:41+00:00"
         },
-        {
-            "name": "composer/semver",
-            "version": "3.2.4",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/composer/semver.git",
-                "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/composer/semver/zipball/a02fdf930a3c1c3ed3a49b5f63859c0c20e10464",
-                "reference": "a02fdf930a3c1c3ed3a49b5f63859c0c20e10464",
-                "shasum": ""
-            },
-            "require": {
-                "php": "^5.3.2 || ^7.0 || ^8.0"
-            },
-            "require-dev": {
-                "phpstan/phpstan": "^0.12.54",
-                "symfony/phpunit-bridge": "^4.2 || ^5"
-            },
-            "type": "library",
-            "extra": {
-                "branch-alias": {
-                    "dev-main": "3.x-dev"
-                }
-            },
-            "autoload": {
-                "psr-4": {
-                    "Composer\\Semver\\": "src"
-                }
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "MIT"
-            ],
-            "authors": [
-                {
-                    "name": "Nils Adermann",
-                    "email": "naderman at naderman.de",
-                    "homepage": "http://www.naderman.de"
-                },
-                {
-                    "name": "Jordi Boggiano",
-                    "email": "j.boggiano at seld.be",
-                    "homepage": "http://seld.be"
-                },
-                {
-                    "name": "Rob Bast",
-                    "email": "rob.bast at gmail.com",
-                    "homepage": "http://robbast.nl"
-                }
-            ],
-            "description": "Semver library that offers utilities, version constraint parsing and validation.",
-            "keywords": [
-                "semantic",
-                "semver",
-                "validation",
-                "versioning"
-            ],
-            "support": {
-                "irc": "irc://irc.freenode.org/composer",
-                "issues": "https://github.com/composer/semver/issues",
-                "source": "https://github.com/composer/semver/tree/3.2.4"
-            },
-            "funding": [
-                {
-                    "url": "https://packagist.com",
-                    "type": "custom"
-                },
-                {
-                    "url": "https://github.com/composer",
-                    "type": "github"
-                },
-                {
-                    "url": "https://tidelift.com/funding/github/packagist/composer/composer",
-                    "type": "tidelift"
-                }
-            ],
-            "time": "2020-11-13T08:59:24+00:00"
-        },
         {
             "name": "erusev/parsedown",
             "version": "1.7.4",
@@ -567,6 +486,70 @@
             ],
             "time": "2020-12-10T19:40:30+00:00"
         },
+        {
+            "name": "matomo/device-detector",
+            "version": "3.13.1",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/matomo-org/device-detector.git",
+                "reference": "e90533302c58acf41f0d8075a0151537d0ddf34d"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/matomo-org/device-detector/zipball/e90533302c58acf41f0d8075a0151537d0ddf34d",
+                "reference": "e90533302c58acf41f0d8075a0151537d0ddf34d",
+                "shasum": ""
+            },
+            "require": {
+                "mustangostang/spyc": "*",
+                "php": ">=5.5"
+            },
+            "require-dev": {
+                "fabpot/php-cs-fixer": "~1.7",
+                "matthiasmullie/scrapbook": "@stable",
+                "phpunit/phpunit": "^4.8.36",
+                "psr/cache": "^1.0",
+                "psr/simple-cache": "^1.0"
+            },
+            "suggest": {
+                "doctrine/cache": "Can directly be used for caching purpose",
+                "ext-yaml": "Necessary for using the Pecl YAML parser"
+            },
+            "type": "library",
+            "autoload": {
+                "psr-4": {
+                    "DeviceDetector\\": ""
+                },
+                "exclude-from-classmap": [
+                    "Tests/"
+                ]
+            },
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "LGPL-3.0-or-later"
+            ],
+            "authors": [
+                {
+                    "name": "The Matomo Team",
+                    "email": "hello at matomo.org",
+                    "homepage": "https://matomo.org/team/"
+                }
+            ],
+            "description": "The Universal Device Detection library, that parses User Agents and detects devices (desktop, tablet, mobile, tv, cars, console, etc.), clients (browsers, media players, mobile apps, feed readers, libraries, etc), operating systems, devices, brands and models.",
+            "homepage": "https://matomo.org",
+            "keywords": [
+                "devicedetection",
+                "parser",
+                "useragent"
+            ],
+            "support": {
+                "forum": "http://forum.matomo.org/",
+                "issues": "https://github.com/matomo-org/device-detector/issues",
+                "source": "https://github.com/matomo-org/piwik",
+                "wiki": "https://dev.matomo.org/"
+            },
+            "time": "2020-10-25T10:17:36+00:00"
+        },
         {
             "name": "mustangostang/spyc",
             "version": "0.6.3",
@@ -734,71 +717,6 @@
             ],
             "time": "2020-11-24T11:29:49+00:00"
         },
-        {
-            "name": "piwik/device-detector",
-            "version": "3.13.1",
-            "source": {
-                "type": "git",
-                "url": "https://github.com/matomo-org/device-detector.git",
-                "reference": "e90533302c58acf41f0d8075a0151537d0ddf34d"
-            },
-            "dist": {
-                "type": "zip",
-                "url": "https://api.github.com/repos/matomo-org/device-detector/zipball/e90533302c58acf41f0d8075a0151537d0ddf34d",
-                "reference": "e90533302c58acf41f0d8075a0151537d0ddf34d",
-                "shasum": ""
-            },
-            "require": {
-                "mustangostang/spyc": "*",
-                "php": ">=5.5"
-            },
-            "require-dev": {
-                "fabpot/php-cs-fixer": "~1.7",
-                "matthiasmullie/scrapbook": "@stable",
-                "phpunit/phpunit": "^4.8.36",
-                "psr/cache": "^1.0",
-                "psr/simple-cache": "^1.0"
-            },
-            "suggest": {
-                "doctrine/cache": "Can directly be used for caching purpose",
-                "ext-yaml": "Necessary for using the Pecl YAML parser"
-            },
-            "type": "library",
-            "autoload": {
-                "psr-4": {
-                    "DeviceDetector\\": ""
-                },
-                "exclude-from-classmap": [
-                    "Tests/"
-                ]
-            },
-            "notification-url": "https://packagist.org/downloads/",
-            "license": [
-                "LGPL-3.0-or-later"
-            ],
-            "authors": [
-                {
-                    "name": "The Matomo Team",
-                    "email": "hello at matomo.org",
-                    "homepage": "https://matomo.org/team/"
-                }
-            ],
-            "description": "The Universal Device Detection library, that parses User Agents and detects devices (desktop, tablet, mobile, tv, cars, console, etc.), clients (browsers, media players, mobile apps, feed readers, libraries, etc), operating systems, devices, brands and models.",
-            "homepage": "https://matomo.org",
-            "keywords": [
-                "devicedetection",
-                "parser",
-                "useragent"
-            ],
-            "support": {
-                "forum": "http://forum.matomo.org/",
-                "issues": "https://github.com/matomo-org/device-detector/issues",
-                "source": "https://github.com/matomo-org/piwik",
-                "wiki": "https://dev.matomo.org/"
-            },
-            "abandoned": "matomo/device-detector",
-            "time": "2020-10-25T10:17:36+00:00"
-        },
         {
             "name": "predis/predis",
             "version": "v1.1.6",
@@ -884,12 +802,12 @@
             "source": {
                 "type": "git",
                 "url": "https://github.com/propelorm/Propel2.git",
-                "reference": "3df45aa1ad441b5d3fb3f3341456722aa9e2125c"
+                "reference": "a0f7a24ae4d46131b77f0698e8066b91727012cf"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/propelorm/Propel2/zipball/3df45aa1ad441b5d3fb3f3341456722aa9e2125c",
-                "reference": "3df45aa1ad441b5d3fb3f3341456722aa9e2125c",
+                "url": "https://api.github.com/repos/propelorm/Propel2/zipball/a0f7a24ae4d46131b77f0698e8066b91727012cf",
+                "reference": "a0f7a24ae4d46131b77f0698e8066b91727012cf",
                 "shasum": ""
             },
             "require": {
@@ -909,7 +827,7 @@
                 "monolog/monolog": "^1.3",
                 "phpstan/phpstan": "^0.12.4",
                 "phpunit/phpunit": "^8.0.0||^9.0.0",
-                "psalm/phar": "^4.1.0",
+                "psalm/phar": "4.2.1",
                 "spryker/code-sniffer": "^0.15.6"
             },
             "suggest": {
@@ -951,7 +869,7 @@
                 "issues": "https://github.com/propelorm/Propel2/issues",
                 "source": "https://github.com/propelorm/Propel2/tree/master"
             },
-            "time": "2020-12-03T09:54:53+00:00"
+            "time": "2020-12-17T14:58:42+00:00"
         },
         {
             "name": "psr/cache",
@@ -1423,16 +1341,16 @@
         },
         {
             "name": "symfony/config",
-            "version": "v5.2.0",
+            "version": "v5.2.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/config.git",
-                "reference": "fa1219ecbf96bb5db59f2599cba0960a0d9c3aea"
+                "reference": "d0a82d965296083fe463d655a3644cbe49cbaa80"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/config/zipball/fa1219ecbf96bb5db59f2599cba0960a0d9c3aea",
-                "reference": "fa1219ecbf96bb5db59f2599cba0960a0d9c3aea",
+                "url": "https://api.github.com/repos/symfony/config/zipball/d0a82d965296083fe463d655a3644cbe49cbaa80",
+                "reference": "d0a82d965296083fe463d655a3644cbe49cbaa80",
                 "shasum": ""
             },
             "require": {
@@ -1481,7 +1399,7 @@
             "description": "Symfony Config Component",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/config/tree/v5.2.0"
+                "source": "https://github.com/symfony/config/tree/v5.2.1"
             },
             "funding": [
                 {
@@ -1497,20 +1415,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-11-16T18:02:40+00:00"
+            "time": "2020-12-09T18:54:12+00:00"
         },
         {
             "name": "symfony/console",
-            "version": "v5.2.0",
+            "version": "v5.2.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/console.git",
-                "reference": "3e0564fb08d44a98bd5f1960204c958e57bd586b"
+                "reference": "47c02526c532fb381374dab26df05e7313978976"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/console/zipball/3e0564fb08d44a98bd5f1960204c958e57bd586b",
-                "reference": "3e0564fb08d44a98bd5f1960204c958e57bd586b",
+                "url": "https://api.github.com/repos/symfony/console/zipball/47c02526c532fb381374dab26df05e7313978976",
+                "reference": "47c02526c532fb381374dab26df05e7313978976",
                 "shasum": ""
             },
             "require": {
@@ -1578,7 +1496,7 @@
                 "terminal"
             ],
             "support": {
-                "source": "https://github.com/symfony/console/tree/v5.2.0"
+                "source": "https://github.com/symfony/console/tree/v5.2.1"
             },
             "funding": [
                 {
@@ -1594,7 +1512,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-11-28T11:24:18+00:00"
+            "time": "2020-12-18T08:03:05+00:00"
         },
         {
             "name": "symfony/deprecation-contracts",
@@ -1665,16 +1583,16 @@
         },
         {
             "name": "symfony/filesystem",
-            "version": "v5.2.0",
+            "version": "v5.2.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/filesystem.git",
-                "reference": "bb92ba7f38b037e531908590a858a04d85c0e238"
+                "reference": "fa8f8cab6b65e2d99a118e082935344c5ba8c60d"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/filesystem/zipball/bb92ba7f38b037e531908590a858a04d85c0e238",
-                "reference": "bb92ba7f38b037e531908590a858a04d85c0e238",
+                "url": "https://api.github.com/repos/symfony/filesystem/zipball/fa8f8cab6b65e2d99a118e082935344c5ba8c60d",
+                "reference": "fa8f8cab6b65e2d99a118e082935344c5ba8c60d",
                 "shasum": ""
             },
             "require": {
@@ -1707,7 +1625,7 @@
             "description": "Symfony Filesystem Component",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/filesystem/tree/v5.2.0"
+                "source": "https://github.com/symfony/filesystem/tree/v5.2.1"
             },
             "funding": [
                 {
@@ -1723,20 +1641,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-11-12T09:58:18+00:00"
+            "time": "2020-11-30T17:05:38+00:00"
         },
         {
             "name": "symfony/finder",
-            "version": "v5.2.0",
+            "version": "v5.2.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/finder.git",
-                "reference": "fd8305521692f27eae3263895d1ef1571c71a78d"
+                "reference": "0b9231a5922fd7287ba5b411893c0ecd2733e5ba"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/finder/zipball/fd8305521692f27eae3263895d1ef1571c71a78d",
-                "reference": "fd8305521692f27eae3263895d1ef1571c71a78d",
+                "url": "https://api.github.com/repos/symfony/finder/zipball/0b9231a5922fd7287ba5b411893c0ecd2733e5ba",
+                "reference": "0b9231a5922fd7287ba5b411893c0ecd2733e5ba",
                 "shasum": ""
             },
             "require": {
@@ -1768,7 +1686,7 @@
             "description": "Symfony Finder Component",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/finder/tree/v5.2.0"
+                "source": "https://github.com/symfony/finder/tree/v5.2.1"
             },
             "funding": [
                 {
@@ -1784,7 +1702,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-11-18T09:42:36+00:00"
+            "time": "2020-12-08T17:02:38+00:00"
         },
         {
             "name": "symfony/polyfill-ctype",
@@ -2353,16 +2271,16 @@
         },
         {
             "name": "symfony/string",
-            "version": "v5.2.0",
+            "version": "v5.2.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/string.git",
-                "reference": "40e975edadd4e32cd16f3753b3bad65d9ac48242"
+                "reference": "5bd67751d2e3f7d6f770c9154b8fbcb2aa05f7ed"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/string/zipball/40e975edadd4e32cd16f3753b3bad65d9ac48242",
-                "reference": "40e975edadd4e32cd16f3753b3bad65d9ac48242",
+                "url": "https://api.github.com/repos/symfony/string/zipball/5bd67751d2e3f7d6f770c9154b8fbcb2aa05f7ed",
+                "reference": "5bd67751d2e3f7d6f770c9154b8fbcb2aa05f7ed",
                 "shasum": ""
             },
             "require": {
@@ -2416,7 +2334,7 @@
                 "utf8"
             ],
             "support": {
-                "source": "https://github.com/symfony/string/tree/v5.2.0"
+                "source": "https://github.com/symfony/string/tree/v5.2.1"
             },
             "funding": [
                 {
@@ -2432,20 +2350,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-10-24T12:08:07+00:00"
+            "time": "2020-12-05T07:33:16+00:00"
         },
         {
             "name": "symfony/translation",
-            "version": "v5.2.0",
+            "version": "v5.2.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/translation.git",
-                "reference": "52f486a707510884450df461b5a6429dd7a67379"
+                "reference": "a04209ba0d1391c828e5b2373181dac63c52ee70"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/translation/zipball/52f486a707510884450df461b5a6429dd7a67379",
-                "reference": "52f486a707510884450df461b5a6429dd7a67379",
+                "url": "https://api.github.com/repos/symfony/translation/zipball/a04209ba0d1391c828e5b2373181dac63c52ee70",
+                "reference": "a04209ba0d1391c828e5b2373181dac63c52ee70",
                 "shasum": ""
             },
             "require": {
@@ -2509,7 +2427,7 @@
             "description": "Symfony Translation Component",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/translation/tree/v5.2.0"
+                "source": "https://github.com/symfony/translation/tree/v5.2.1"
             },
             "funding": [
                 {
@@ -2525,7 +2443,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-11-28T11:24:18+00:00"
+            "time": "2020-12-08T17:03:37+00:00"
         },
         {
             "name": "symfony/translation-contracts",
@@ -2607,16 +2525,16 @@
         },
         {
             "name": "symfony/validator",
-            "version": "v5.2.0",
+            "version": "v5.2.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/validator.git",
-                "reference": "7b2583e2c4cb82b23fcb37730981c868efefd2c0"
+                "reference": "312d36715799ca1d195ee8dbf258b31d1a3cbf7b"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/validator/zipball/7b2583e2c4cb82b23fcb37730981c868efefd2c0",
-                "reference": "7b2583e2c4cb82b23fcb37730981c868efefd2c0",
+                "url": "https://api.github.com/repos/symfony/validator/zipball/312d36715799ca1d195ee8dbf258b31d1a3cbf7b",
+                "reference": "312d36715799ca1d195ee8dbf258b31d1a3cbf7b",
                 "shasum": ""
             },
             "require": {
@@ -2698,7 +2616,7 @@
             "description": "Symfony Validator Component",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/validator/tree/v5.2.0"
+                "source": "https://github.com/symfony/validator/tree/v5.2.1"
             },
             "funding": [
                 {
@@ -2714,20 +2632,20 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-11-28T11:24:18+00:00"
+            "time": "2020-12-18T07:32:35+00:00"
         },
         {
             "name": "symfony/yaml",
-            "version": "v5.2.0",
+            "version": "v5.2.1",
             "source": {
                 "type": "git",
                 "url": "https://github.com/symfony/yaml.git",
-                "reference": "bb73619b2ae5121bbbcd9f191dfd53ded17ae598"
+                "reference": "290ea5e03b8cf9b42c783163123f54441fb06939"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/symfony/yaml/zipball/bb73619b2ae5121bbbcd9f191dfd53ded17ae598",
-                "reference": "bb73619b2ae5121bbbcd9f191dfd53ded17ae598",
+                "url": "https://api.github.com/repos/symfony/yaml/zipball/290ea5e03b8cf9b42c783163123f54441fb06939",
+                "reference": "290ea5e03b8cf9b42c783163123f54441fb06939",
                 "shasum": ""
             },
             "require": {
@@ -2773,7 +2691,7 @@
             "description": "Symfony Yaml Component",
             "homepage": "https://symfony.com",
             "support": {
-                "source": "https://github.com/symfony/yaml/tree/v5.2.0"
+                "source": "https://github.com/symfony/yaml/tree/v5.2.1"
             },
             "funding": [
                 {
@@ -2789,22 +2707,22 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-11-28T10:57:20+00:00"
+            "time": "2020-12-08T17:02:38+00:00"
         }
     ],
     "packages-dev": [
         {
             "name": "phpstan/phpstan",
-            "version": "0.12.59",
+            "version": "0.12.63",
             "source": {
                 "type": "git",
                 "url": "https://github.com/phpstan/phpstan.git",
-                "reference": "cf4107257c8ca2ad967efdd6a00f12b21acbb779"
+                "reference": "c97ec4754bd53099a06c24847bd2870b99966b6a"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/phpstan/phpstan/zipball/cf4107257c8ca2ad967efdd6a00f12b21acbb779",
-                "reference": "cf4107257c8ca2ad967efdd6a00f12b21acbb779",
+                "url": "https://api.github.com/repos/phpstan/phpstan/zipball/c97ec4754bd53099a06c24847bd2870b99966b6a",
+                "reference": "c97ec4754bd53099a06c24847bd2870b99966b6a",
                 "shasum": ""
             },
             "require": {
@@ -2835,7 +2753,7 @@
             "description": "PHPStan - PHP Static Analysis Tool",
             "support": {
                 "issues": "https://github.com/phpstan/phpstan/issues",
-                "source": "https://github.com/phpstan/phpstan/tree/0.12.59"
+                "source": "https://github.com/phpstan/phpstan/tree/0.12.63"
             },
             "funding": [
                 {
@@ -2851,7 +2769,7 @@
                     "type": "tidelift"
                 }
             ],
-            "time": "2020-12-07T14:46:03+00:00"
+            "time": "2020-12-15T16:37:16+00:00"
         },
         {
             "name": "squizlabs/php_codesniffer",
diff --git a/propel.yaml b/propel.yaml
index 5b99e32e..a46dd1a4 100644
--- a/propel.yaml
+++ b/propel.yaml
@@ -1,11 +1,9 @@
-
-
 propel:
   database:
       connections:
           scummvm:
               adapter: sqlite
-              dsn: sqlite:scummvm.db
+              dsn: sqlite:{{BASE_DIR}}/data/scummvm-web.db
               user: admin
               password: admin
               settings:
@@ -16,6 +14,10 @@ propel:
           - scummvm
   generator:
       defaultConnection: scummvm
+      namespaceAutoPackage: false
       connections:
           - scummvm
-
+  paths:
+    phpConfDir: ./orm/
+    sqlDir: ./orm/
+    phpDir: ./include/OrmObjects/


Commit: cf5b7b8431621f64ef0f91a4f73c01c39119f9a2
    https://github.com/scummvm/scummvm-web/commit/cf5b7b8431621f64ef0f91a4f73c01c39119f9a2
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
WEB: Rename Database tables

Changed paths:
  A include/OrmObjects/Download.php
  A include/OrmObjects/DownloadQuery.php
  A include/OrmObjects/GameDownload.php
  A include/OrmObjects/GameDownloadQuery.php
  R include/OrmObjects/Downloads.php
  R include/OrmObjects/DownloadsQuery.php
  R include/OrmObjects/GameDownloads.php
  R include/OrmObjects/GameDownloadsQuery.php
    include/Models/DownloadsModel.php
    include/Models/GameDownloadsModel.php
    schema.xml


diff --git a/include/Models/DownloadsModel.php b/include/Models/DownloadsModel.php
index 2bc2edc1..20e39efc 100644
--- a/include/Models/DownloadsModel.php
+++ b/include/Models/DownloadsModel.php
@@ -4,7 +4,7 @@ namespace ScummVM\Models;
 
 use ScummVM\Objects\DownloadsSection;
 use DeviceDetector\Parser\OperatingSystem as OsParser;
-use ScummVM\OrmObjects\DownloadsQuery;
+use ScummVM\OrmObjects\DownloadQuery;
 
 /**
  * The DownloadsModel will produce DownloadsSection objects.
@@ -16,7 +16,7 @@ class DownloadsModel extends BasicModel
     {
         $sections = $this->getFromCache();
         if (is_null($sections)) {
-            $parsedData = DownloadsQuery::create()
+            $parsedData = DownloadQuery::create()
                 ->findByEnabled(true);
             $sections = [];
             $sectionsData = $this->getSectionData();
@@ -49,7 +49,8 @@ class DownloadsModel extends BasicModel
         return $sections;
     }
 
-    private function getSectionData() {
+    private function getSectionData()
+    {
         return [
             "current"=>["title"=>"{#downloadsXMLTitle#} {#downloadsXMLVersion#}"],
             "release"=>["title"=>"{#downloadsBinaries#}","notes"=>"{#downloadsBinariesNote1#} <a href='https://downloads.scummvm.org/frs/scummvm/{ldelim}release{rdelim}/ReleaseNotes.html'>{#downloadsBinariesNote2#}</a>.<p>{#downloadsBinariesNote3#}</p>"],
@@ -80,7 +81,7 @@ class DownloadsModel extends BasicModel
         $osParser->setUserAgent($_SERVER['HTTP_USER_AGENT']);
         $os = $osParser->parse();
 
-        $downloads = DownloadsQuery::create()
+        $downloads = DownloadQuery::create()
             ->setIgnoreCase(true)
             ->findByUserAgent($os['name']);
 
diff --git a/include/Models/GameDownloadsModel.php b/include/Models/GameDownloadsModel.php
index 48c01d4b..d149a282 100644
--- a/include/Models/GameDownloadsModel.php
+++ b/include/Models/GameDownloadsModel.php
@@ -2,7 +2,7 @@
 namespace ScummVM\Models;
 
 use ScummVM\Objects\DownloadsSection;
-use ScummVM\OrmObjects\GameDownloadsQuery;
+use ScummVM\OrmObjects\GameDownloadQuery;
 
 /**
  * The GameDownloadsModel will produce DownloadsSection objects.
@@ -16,7 +16,7 @@ class GameDownloadsModel extends BasicModel
         if (is_null($sections)) {
             $sections = [];
             $sectionsData = $this->getSectionData();
-            $categories = GameDownloadsQuery::create()
+            $categories = GameDownloadQuery::create()
                 ->select('category')
                 ->distinct()
                 ->find();
@@ -29,8 +29,8 @@ class GameDownloadsModel extends BasicModel
                     ]);
             }
 
-            $gameDownloads = GameDownloadsQuery::create()
-                ->joinWithGame()
+            $gameDownloads = GameDownloadQuery::create()
+                ->joinGame()
                 ->find();
             foreach ($gameDownloads as $gameDownload) {
                 // Create Sections
diff --git a/include/OrmObjects/Downloads.php b/include/OrmObjects/Download.php
similarity index 77%
rename from include/OrmObjects/Downloads.php
rename to include/OrmObjects/Download.php
index 524c4c2d..66275d01 100644
--- a/include/OrmObjects/Downloads.php
+++ b/include/OrmObjects/Download.php
@@ -2,7 +2,7 @@
 
 namespace ScummVM\OrmObjects;
 
-use ScummVM\OrmObjects\Base\Downloads as BaseDownloads;
+use ScummVM\OrmObjects\Base\Download as BaseDownload;
 
 /**
  * Skeleton subclass for representing a row from the 'scummvm_downloads' table.
@@ -13,7 +13,7 @@ use ScummVM\OrmObjects\Base\Downloads as BaseDownloads;
  * application requirements.  This class will only be generated as
  * long as it does not already exist in the output directory.
  */
-class Downloads extends BaseDownloads
+class Download extends BaseDownload
 {
 
 }
diff --git a/include/OrmObjects/DownloadsQuery.php b/include/OrmObjects/DownloadQuery.php
similarity index 75%
rename from include/OrmObjects/DownloadsQuery.php
rename to include/OrmObjects/DownloadQuery.php
index 43970489..3029eb3f 100644
--- a/include/OrmObjects/DownloadsQuery.php
+++ b/include/OrmObjects/DownloadQuery.php
@@ -2,7 +2,7 @@
 
 namespace ScummVM\OrmObjects;
 
-use ScummVM\OrmObjects\Base\DownloadsQuery as BaseDownloadsQuery;
+use ScummVM\OrmObjects\Base\DownloadQuery as BaseDownloadQuery;
 
 /**
  * Skeleton subclass for performing query and update operations on the 'scummvm_downloads' table.
@@ -13,7 +13,7 @@ use ScummVM\OrmObjects\Base\DownloadsQuery as BaseDownloadsQuery;
  * application requirements.  This class will only be generated as
  * long as it does not already exist in the output directory.
  */
-class DownloadsQuery extends BaseDownloadsQuery
+class DownloadQuery extends BaseDownloadQuery
 {
 
 }
diff --git a/include/OrmObjects/GameDownloads.php b/include/OrmObjects/GameDownload.php
similarity index 75%
rename from include/OrmObjects/GameDownloads.php
rename to include/OrmObjects/GameDownload.php
index b07ca27c..501d02df 100644
--- a/include/OrmObjects/GameDownloads.php
+++ b/include/OrmObjects/GameDownload.php
@@ -2,7 +2,7 @@
 
 namespace ScummVM\OrmObjects;
 
-use ScummVM\OrmObjects\Base\GameDownloads as BaseGameDownloads;
+use ScummVM\OrmObjects\Base\GameDownload as BaseGameDownload;
 
 /**
  * Skeleton subclass for representing a row from the 'game_downloads' table.
@@ -13,7 +13,7 @@ use ScummVM\OrmObjects\Base\GameDownloads as BaseGameDownloads;
  * application requirements.  This class will only be generated as
  * long as it does not already exist in the output directory.
  */
-class GameDownloads extends BaseGameDownloads
+class GameDownload extends BaseGameDownload
 {
 
 }
diff --git a/include/OrmObjects/GameDownloadsQuery.php b/include/OrmObjects/GameDownloadQuery.php
similarity index 72%
rename from include/OrmObjects/GameDownloadsQuery.php
rename to include/OrmObjects/GameDownloadQuery.php
index a359d84d..f9f17a6d 100644
--- a/include/OrmObjects/GameDownloadsQuery.php
+++ b/include/OrmObjects/GameDownloadQuery.php
@@ -2,7 +2,7 @@
 
 namespace ScummVM\OrmObjects;
 
-use ScummVM\OrmObjects\Base\GameDownloadsQuery as BaseGameDownloadsQuery;
+use ScummVM\OrmObjects\Base\GameDownloadQuery as BaseGameDownloadQuery;
 
 /**
  * Skeleton subclass for performing query and update operations on the 'game_downloads' table.
@@ -13,7 +13,7 @@ use ScummVM\OrmObjects\Base\GameDownloadsQuery as BaseGameDownloadsQuery;
  * application requirements.  This class will only be generated as
  * long as it does not already exist in the output directory.
  */
-class GameDownloadsQuery extends BaseGameDownloadsQuery
+class GameDownloadQuery extends BaseGameDownloadQuery
 {
 
 }
diff --git a/schema.xml b/schema.xml
index 3f9792a9..eec38724 100644
--- a/schema.xml
+++ b/schema.xml
@@ -60,7 +60,7 @@
     <column name="major" type="SMALLINT" required="true"/>
     <column name="minor" type="SMALLINT" required="true"/>
     <column name="patch" type="SMALLINT" required="true"/>
-    <column name="release_date" type="date"/>
+    <column name="release_date" type="date" required="true"/>
   </table>
   <table name="screenshot" phpName="Screenshot">
     <!-- id	variant	platform_id	language	filemask -->
@@ -88,7 +88,7 @@
       <reference local="platform_id" foreign="id"/>
     </foreign-key>
   </table>
-  <table name="scummvm_downloads" phpName="Downloads">
+  <table name="scummvm_downloads" phpName="Download">
     <column name="name" type="varchar" size="255" required="true"/>
     <column name="description" type="varchar" size="255"/>
     <column name="subcategory" type="varchar" size="24" required="true"/>
@@ -98,7 +98,7 @@
     <column name="user_agent" type="varchar" size="255"/>
     <column name="url" type="varchar" size="255" required="true"/>
   </table>
-  <table name="game_downloads" phpName="GameDownloads">
+  <table name="game_downloads" phpName="GameDownload">
     <column name="category" type="varchar" size="24" required="true"/>
     <column name="game_id" type="varchar" size="24" required="true"/>
     <column name="category_icon" type="varchar" size="24" required="true"/>


Commit: c6be8fea6ad50fd255a480fb4d926370bdff719d
    https://github.com/scummvm/scummvm-web/commit/c6be8fea6ad50fd255a480fb4d926370bdff719d
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
WEB: ORM cleanups

Changed paths:
    include/DataUtils.php
    include/Models/VersionsModel.php
    public_html/index.php


diff --git a/include/DataUtils.php b/include/DataUtils.php
index 96d6502e..84fed39f 100644
--- a/include/DataUtils.php
+++ b/include/DataUtils.php
@@ -2,7 +2,7 @@
 namespace ScummVM;
 
 require_once __DIR__ . '/../vendor/autoload.php';
-require_once __DIR__ . '/../generated-conf/config.php';
+require_once __DIR__ . '/../orm/config.php';
 require_once __DIR__ . '/../include/Constants.php';
 
 use League\Csv\Reader;
@@ -45,8 +45,8 @@ class DataUtils
         'compatibility' => 'Compatibility',
         'game_demos' => 'Demo',
         'screenshots' => 'Screenshot',
-        'scummvm_downloads' => 'Downloads',
-        'game_downloads' => 'GameDownloads',
+        'scummvm_downloads' => 'Download',
+        'game_downloads' => 'GameDownload',
     ];
 
     /**
@@ -54,7 +54,7 @@ class DataUtils
      *
      * @return void
      */
-    public function getAllData()
+    public static function updateData()
     {
         $client = new Client();
         $promises = [];
@@ -97,13 +97,20 @@ class DataUtils
             \file_put_contents($outFile, $yaml);
             \file_put_contents('.clear-cache', '');
         }
+
+        DataUtils::convertYamlToOrm();
     }
 
-    public function convertData()
+    private static function convertYamlToOrm()
     {
         foreach (self::OBJECT_NAMES as $name => $object) {
+            $query = "ScummVM\\OrmObjects\\{$object}Query";
+            if ($query::create()->count() > 0) {
+                continue;
+            }
             $file = DIR_DATA . "/" . DEFAULT_LOCALE . "/$name.yaml";
             $data = Yaml::parseFile($file);
+            echo "Writing $object data to database\n";
             foreach ($data as $item) {
                 try {
                     foreach ($item as $key => $val) {
@@ -113,11 +120,9 @@ class DataUtils
                     }
                     $class = "ScummVM\\OrmObjects\\$object";
                     $dbItem = new $class();
-                    if ($object === 'Version') {
-                        $ver = explode(".", $item['id']);
-                        $item['major'] = $ver[0];
-                        $item['minor'] = $ver[1];
-                        $item['patch'] = $ver[2];
+                    // TODO: Rename platform to platform_id
+                    if ($object === 'Demo') {
+                        $item['platform_id'] = $item['platform'];
                     }
                     $dbItem->fromArray($item, TableMap::TYPE_FIELDNAME);
                     $dbItem->save();
@@ -130,6 +135,4 @@ class DataUtils
     }
 }
 
-$dataUtils = new DataUtils();
-$dataUtils->getAllData();
-$dataUtils->convertData();
+DataUtils::updateData();
diff --git a/include/Models/VersionsModel.php b/include/Models/VersionsModel.php
index 30bf3641..575a4082 100644
--- a/include/Models/VersionsModel.php
+++ b/include/Models/VersionsModel.php
@@ -14,12 +14,6 @@ class VersionsModel extends BasicModel
     {
         $data = $this->getFromCache();
         if (is_null($data)) {
-            $dev = VersionQuery::create()->findPk('DEV');
-            if (!$dev) {
-                $dev = new Version();
-                $dev->fromArray(["Id" => 'DEV', 'Major' => 9, 'Minor' => 9, 'Patch' => 9]);
-                $dev->save();
-            }
             $data = VersionQuery::create()->orderByReleaseDate()->find();
             $this->saveToCache($data);
         }
diff --git a/public_html/index.php b/public_html/index.php
index 6ae5fd38..2c10d7ce 100644
--- a/public_html/index.php
+++ b/public_html/index.php
@@ -16,7 +16,7 @@ if (isset($_SERVER['SERVER_SOFTWARE']) &&
 }
 
 require_once __DIR__ . '/../vendor/autoload.php';
-require_once __DIR__ . '/../generated-conf/config.php';
+require_once __DIR__ . '/../orm/config.php';
 require_once __DIR__ . '/../include/Constants.php';
 
 /**


Commit: cc433bd9402e0cc4a875c6a61a26221ad1337ef9
    https://github.com/scummvm/scummvm-web/commit/cc433bd9402e0cc4a875c6a61a26221ad1337ef9
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
BUILD: Update build scripts to generate database

Changed paths:
    composer.json


diff --git a/composer.json b/composer.json
index e5e0b532..fd5af9d9 100644
--- a/composer.json
+++ b/composer.json
@@ -34,7 +34,9 @@
   "scripts": {
     "build-common": [
       "@icons",
-      "@localize"
+      "@localize",
+      "@database",
+      "@update-data"
     ],
     "build": [
       "composer install --no-dev",


Commit: e415dad73ac40f24ae1cc2ccb545048c83ddf068
    https://github.com/scummvm/scummvm-web/commit/e415dad73ac40f24ae1cc2ccb545048c83ddf068
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
WEB: Lint files

Changed paths:
    include/Objects/File.php
    include/OrmObjects/Compatibility.php
    include/OrmObjects/Screenshot.php


diff --git a/include/Objects/File.php b/include/Objects/File.php
index 2de10b69..3a3366f1 100644
--- a/include/Objects/File.php
+++ b/include/Objects/File.php
@@ -89,7 +89,6 @@ class File extends BasicObject
             }
         }
         $this->url = $url;
-
         /**
          * Get the filesize/last modified information and put it in
          * $this->extra_info.
diff --git a/include/OrmObjects/Compatibility.php b/include/OrmObjects/Compatibility.php
index 585fa7a6..c43072d6 100644
--- a/include/OrmObjects/Compatibility.php
+++ b/include/OrmObjects/Compatibility.php
@@ -44,7 +44,7 @@ class Compatibility extends BaseCompatibility
 
         if ($this->notes) {
             $notes .= "**Additional Notes:**\n";
-            $notes .= str_replace("- ", "\n- ",  parent::getNotes()) . "\n";
+            $notes .= str_replace("- ", "\n- ", parent::getNotes()) . "\n";
         }
 
         $config = \HTMLPurifier_Config::createDefault();
@@ -55,7 +55,8 @@ class Compatibility extends BaseCompatibility
         return $notes;
     }
 
-    public function getDataFiles() {
+    public function getDataFiles()
+    {
         return $this->getGame()->getDataFiles();
     }
 }
diff --git a/include/OrmObjects/Screenshot.php b/include/OrmObjects/Screenshot.php
index 7fa91487..a2b09943 100644
--- a/include/OrmObjects/Screenshot.php
+++ b/include/OrmObjects/Screenshot.php
@@ -41,7 +41,6 @@ class Screenshot extends BaseScreenshot
         } else {
             $this->files = $files;
         }
-
     }
 
     public function getCategory()


Commit: 97f36a9716b8a3840b1c3e790585b1e1e3d0a256
    https://github.com/scummvm/scummvm-web/commit/97f36a9716b8a3840b1c3e790585b1e1e3d0a256
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
BUILD: Ignore generated ORM base files

Changed paths:
    composer.json


diff --git a/composer.json b/composer.json
index fd5af9d9..f7dc45a7 100644
--- a/composer.json
+++ b/composer.json
@@ -57,7 +57,7 @@
       "@start"
     ],
     "lint": [
-      "phpcbf --standard=psr2 ./include"
+      "phpcbf --standard=psr2 --ignore=./include/OrmObjects/Base,./include/OrmObjects/Map ./include"
     ],
     "update-data": [
       "php include/DataUtils.php"


Commit: fbd9058568e2e324c9296be475ef7e2f1ac13d78
    https://github.com/scummvm/scummvm-web/commit/fbd9058568e2e324c9296be475ef7e2f1ac13d78
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
BUILD: Move ORM config to PHP file, removing sed hack

Changed paths:
  A propel.php
  R propel.yaml
    composer.json


diff --git a/composer.json b/composer.json
index f7dc45a7..36b51a08 100644
--- a/composer.json
+++ b/composer.json
@@ -63,13 +63,11 @@
       "php include/DataUtils.php"
     ],
     "database": [
-      "sed -i'' -e \"s#{{BASE_DIR}}#$(pwd)#g\" propel.yaml",
       "propel sql:build",
       "propel model:build",
       "propel config:convert",
       "propel sql:insert",
-      "composer dumpautoload",
-      "sed -i'' -e \"s#$(pwd)#{{BASE_DIR}}#g\" propel.yaml"
+      "composer dumpautoload"
     ],
     "localize": [
       "php include/LocalizationUtils.php"
diff --git a/propel.php b/propel.php
new file mode 100644
index 00000000..670aae2e
--- /dev/null
+++ b/propel.php
@@ -0,0 +1,36 @@
+<?php
+return [
+  'propel' => [
+    'database' => [
+      'connections' => [
+        'scummvm' => [
+          'adapter' => 'sqlite',
+          'dsn' => 'sqlite:' . __DIR__ . '/data/scummvm-web.db',
+          'user' => 'admin',
+          'password' => 'admin',
+          'settings' => [
+            'charset' => 'utf8',
+          ],
+        ],
+      ],
+    ],
+    'runtime' => [
+      'defaultConnection' => 'scummvm',
+      'connections' => [
+        0 => 'scummvm',
+      ],
+    ],
+    'generator' => [
+      'defaultConnection' => 'scummvm',
+      'namespaceAutoPackage' => false,
+      'connections' => [
+        0 => 'scummvm',
+      ],
+    ],
+    'paths' => [
+      'phpConfDir' => './orm/',
+      'sqlDir' => './orm/',
+      'phpDir' => './include/OrmObjects/',
+    ],
+  ],
+];
diff --git a/propel.yaml b/propel.yaml
deleted file mode 100644
index a46dd1a4..00000000
--- a/propel.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-propel:
-  database:
-      connections:
-          scummvm:
-              adapter: sqlite
-              dsn: sqlite:{{BASE_DIR}}/data/scummvm-web.db
-              user: admin
-              password: admin
-              settings:
-                charset: utf8
-  runtime:
-      defaultConnection: scummvm
-      connections:
-          - scummvm
-  generator:
-      defaultConnection: scummvm
-      namespaceAutoPackage: false
-      connections:
-          - scummvm
-  paths:
-    phpConfDir: ./orm/
-    sqlDir: ./orm/
-    phpDir: ./include/OrmObjects/


Commit: f27fe3d0fdd8f89d5dd42898d26a03917375d0ad
    https://github.com/scummvm/scummvm-web/commit/f27fe3d0fdd8f89d5dd42898d26a03917375d0ad
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
WEB: Rewrite the Screenshot model to use the database

Changed paths:
    include/Models/ScreenshotsModel.php
    include/OrmObjects/Screenshot.php
    include/OrmObjects/ScreenshotQuery.php
    include/Pages/ScreenshotsPage.php
    templates/components/list_items.tpl
    templates/components/random_screenshot.tpl
    templates/pages/screenshots.tpl
    templates/pages/screenshots_category.tpl


diff --git a/include/Models/ScreenshotsModel.php b/include/Models/ScreenshotsModel.php
index ebe6ae68..5eb8bb5c 100644
--- a/include/Models/ScreenshotsModel.php
+++ b/include/Models/ScreenshotsModel.php
@@ -2,6 +2,7 @@
 namespace ScummVM\Models;
 
 use ScummVM\OrmObjects\ScreenshotQuery;
+use Propel\Runtime\Collection\ObjectCollection;
 
 /**
  * The ScreenshotsModel will generate Screenshot objects.
@@ -10,111 +11,122 @@ class ScreenshotsModel extends BasicModel
 {
     const INVALID_TARGET = 'Invalid target specified.';
     const INVALID_CATEGORY = 'Invalid category specified.';
+    const SUBCATEGORY_COLUMN = '(case when game.series_id is null then screenshot.id else game.series_id end)';
+    const CATEGORY_COLUMN = '(case when count > 1 then game.company_id else \'other\' end)';
 
-    /* Get all screenshots. */
-    public function getAllScreenshots()
+    public function getAllCategories()
     {
-        $screenshots = ScreenshotQuery::create()->find();
+        $categories = ScreenshotQuery::create()->findCategories();
         $data = [];
-        foreach ($screenshots as $screenshot) {
-            $category = $screenshot->getCategory();
-            if (isset($data[$category])) {
-                $data[$screenshot->getCategory()]->addFiles($screenshot->getFiles());
-            } else {
-                $data[$screenshot->getCategory()] = $screenshot;
+        foreach ($categories as $category) {
+            extract($category);
+            if (!isset($data[$category_key])) {
+                $data[$category_key] = [
+                    'title' =>  "$category_name Games",
+                    'category' => $category_key,
+                    'games' => [],
+                ];
             }
+            $data[$category_key]['games'][$subcategory_key] = $subcategory_name;
         }
         return $data;
     }
 
-    public function getGroupedScreenshots()
+    /* Get all screenshots in one category. */
+    public function getScreenshotsByCompanyId($companyId)
     {
-        $screenshots = $this->getAllScreenshots();
-        $entries = [];
-
-        // create top level company categories
-        foreach ($screenshots as $screenshot) {
-            $game = $screenshot->getGame();
-            $company = $game->getCompany();
-            $companyId = $company ? $company->getId() : 'other';
-            $companyName = $company ? $company->getName() : 'Other';
+        $data = $this->getFromCache($companyId);
+        if (!$data) {
+            $screenshots = ScreenshotQuery::create()
+            ->useGameQuery()
+                ->filterByCompanyId($companyId)
+            ->endUse()
+            ->withColumn(self::SUBCATEGORY_COLUMN, 'subcategory')
+            ->find();
 
-            if (!isset($entries[$companyId])) {
-                $entries[$companyId] = [
-                    'title' => $companyName . " Games",
-                    'category' => $companyId,
-                    'games' => [],
-                ];
+            if ($screenshots->count() === 0) {
+                throw new \ErrorException(self::INVALID_CATEGORY);
             }
-            $entries[$companyId]['games'][] = $screenshot;
-        }
 
-        // Create Other top level category and sort everything
-        if (!isset($entries['other'])) {
-            $entries['other'] = [
-                'title' => 'Other Games',
-                'category' => 'other',
-                'games' => []
+            $data = [
+                'title' => $screenshots[0]->getGame()->getCompany()->getName() . ' Games',
+                'category' => $companyId,
+                'games' => $this->combineSubcategories($screenshots)
             ];
         }
+        return $data;
+    }
 
-        foreach ($entries as $key => $category) {
-            if (count($entries[$key]['games']) < 2) {
-                $entries['other']['games'] = \array_merge($entries['other']['games'], $entries[$key]['games']);
-                unset($entries[$key]);
-            } else {
-                \sort($entries[$key]['games'], SORT_STRING);
+    /* Get screenshots for a specific target. */
+    public function getScreenshotsBySubcategory($target)
+    {
+        $data = $this->getFromCache($target);
+        if (!$data) {
+            $screenshots = ScreenshotQuery::create()
+                ->joinGame()
+                ->withColumn(self::SUBCATEGORY_COLUMN, 'subcategory')
+                ->where('subcategory = ?', $target, \PDO::PARAM_STR)
+                ->find();
+
+            $combinedScreenshot = $this->combineScreenshots($screenshots);
+            if (!$combinedScreenshot) {
+                throw new \ErrorException(self::INVALID_TARGET);
             }
-        }
 
-        if ($entries['other']['games']) {
-            \sort($entries['other']['games'], SORT_STRING);
-        } else {
-            unset($entries['other']);
+            $data = [$combinedScreenshot];
         }
-
-        \ksort($entries);
-
-        return $entries;
+        return $data;
     }
 
-    /* Get all screenshots in one category. */
-    public function getCategoryScreenshots($category)
+    /**
+     * Combines multiple screenshots into a single screenshot
+     *
+     * @param  ObjectCollection $screenshots
+     * @return Screenshot|bool
+     */
+    private function combineScreenshots(iterable $screenshots)
     {
-        $screenshots = $this->getGroupedScreenshots();
-        foreach ($screenshots as $screenshot) {
-            if ($screenshot['category'] == $category) {
-                return $screenshot;
+        $count = $screenshots->count();
+        if ($count === 0) {
+            return false;
+        } elseif ($count === 1) {
+            $screenshots[0]->getFiles();
+        } else {
+            $shot = $screenshots[0];
+            $shot->getFiles();
+            for ($i=1; $i < $count; $i++) {
+                $shot->addFiles($screenshots[$i]->getFiles());
             }
+            return $shot;
         }
-        throw new \ErrorException(self::INVALID_CATEGORY);
     }
 
-    /* Get screenshots for a specific target. */
-    public function getTargetScreenshots($target)
+    /**
+     * combineSubcategories
+     *
+     * @param  ObjectCollection $screenshots
+     * @return Screenshot[]
+     */
+    private function combineSubcategories(iterable $screenshots)
     {
-        $sshots = $this->getGroupedScreenshots();
-        foreach ($sshots as $shots) {
-            foreach ($shots['games'] as $starget) {
-                if ($starget->getCategory() == $target) {
-                    return $starget;
-                }
+        $combined = [];
+
+        foreach ($screenshots as $screenshot) {
+            $subcategory = $screenshot->getSubcategory();
+            if (isset($combined[$subcategory])) {
+                $combined[$subcategory]->addFiles($screenshot->getFiles());
+            } else {
+                $screenshot->getFiles();
+                $combined[$subcategory] = $screenshot;
             }
         }
-        throw new \ErrorException(self::INVALID_TARGET);
+        \sort($combined, SORT_STRING);
+        return $combined;
     }
 
     /* Get a random screenshot (an object and not a filename) .*/
     public function getRandomScreenshot()
     {
-        $sshots = $this->getAllScreenshots();
-        $item = $sshots[array_rand($sshots)];
-
-        $screenshot = [
-            'category' => $item->getCategory(),
-            'screenshot' => $item
-        ];
-        unset($sshots);
-        return $screenshot;
+        return ScreenshotQuery::create()->findRandom();
     }
 }
diff --git a/include/OrmObjects/Screenshot.php b/include/OrmObjects/Screenshot.php
index a2b09943..efe8f29a 100644
--- a/include/OrmObjects/Screenshot.php
+++ b/include/OrmObjects/Screenshot.php
@@ -15,6 +15,8 @@ use ScummVM\OrmObjects\Base\Screenshot as BaseScreenshot;
  */
 class Screenshot extends BaseScreenshot
 {
+    private $files;
+
     public function getFiles()
     {
         if (!$this->files) {
diff --git a/include/OrmObjects/ScreenshotQuery.php b/include/OrmObjects/ScreenshotQuery.php
index 8d5b132d..14c7c5e2 100644
--- a/include/OrmObjects/ScreenshotQuery.php
+++ b/include/OrmObjects/ScreenshotQuery.php
@@ -3,6 +3,11 @@
 namespace ScummVM\OrmObjects;
 
 use ScummVM\OrmObjects\Base\ScreenshotQuery as BaseScreenshotQuery;
+use Propel\Runtime\Connection\ConnectionInterface;
+use Propel\Runtime\Exception\PropelException;
+use Propel\Runtime\Propel;
+use ScummVM\OrmObjects\Screenshot as ChildScreenshot;
+use ScummVM\OrmObjects\Map\ScreenshotTableMap;
 
 /**
  * Skeleton subclass for performing query and update operations on the 'screenshot' table.
@@ -15,5 +20,80 @@ use ScummVM\OrmObjects\Base\ScreenshotQuery as BaseScreenshotQuery;
  */
 class ScreenshotQuery extends BaseScreenshotQuery
 {
+    public function findRandom(ConnectionInterface $con = null)
+    {
+        if ($con === null) {
+            $con = Propel::getServiceContainer()->getReadConnection(ScreenshotTableMap::DATABASE_NAME);
+        }
 
+        $sql = 'SELECT id, variant, platform_id, language, filemask, auto_id FROM screenshot ORDER BY RANDOM() LIMIT 1';
+        try {
+            $stmt = $con->prepare($sql);
+            $stmt->execute();
+        } catch (\Exception $e) {
+            Propel::log($e->getMessage(), Propel::LOG_ERR);
+            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
+        }
+        $obj = null;
+        if ($row = $stmt->fetch(\PDO::FETCH_NUM)) {
+            /** @var ChildScreenshot $obj */
+            $obj = new ChildScreenshot();
+            $obj->hydrate($row);
+            ScreenshotTableMap::addInstanceToPool($obj, null);
+        }
+        $stmt->closeCursor();
+
+        return $obj;
+    }
+
+    public function findCategories(ConnectionInterface $con = null)
+    {
+        if ($con === null) {
+            $con = Propel::getServiceContainer()->getReadConnection(ScreenshotTableMap::DATABASE_NAME);
+        }
+
+        $sql = "SELECT (CASE
+                        WHEN c.cnt > 1 THEN game.company_id
+                        ELSE 'other'
+                    END) AS category_key,
+                (CASE
+                        WHEN c.cnt > 1 THEN company.name
+                        ELSE 'Other'
+                    END) AS category_name,
+                (CASE
+                        WHEN game.series_id IS NULL THEN screenshot.id
+                        ELSE game.series_id
+                    END) AS subcategory_key,
+                (CASE
+                        WHEN game.series_id IS NULL THEN game.name
+                        ELSE series.name || ' (Series)'
+                    END) AS subcategory_name
+                FROM screenshot
+                JOIN game ON game.id = screenshot.id
+                JOIN company ON game.company_id = company.id
+                LEFT JOIN series ON game.series_id = series.id
+                JOIN
+                (SELECT game.company_id,
+                    Count(DISTINCT((CASE
+                                        WHEN game.series_id IS NULL THEN screenshot.id
+                                        ELSE game.series_id
+                                    END))) AS cnt
+                FROM screenshot
+                JOIN game ON game.id = screenshot.id
+                GROUP BY game.company_id) AS c ON c.company_id = game.company_id
+                GROUP BY subcategory_key
+                ORDER BY category_name,
+                         subcategory_name";
+        try {
+            $stmt = $con->prepare($sql);
+            $stmt->execute();
+        } catch (\Exception $e) {
+            Propel::log($e->getMessage(), Propel::LOG_ERR);
+            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), 0, $e);
+        }
+        $obj = $stmt->fetchAll(\PDO::FETCH_ASSOC);
+        $stmt->closeCursor();
+
+        return $obj;
+    }
 }
diff --git a/include/Pages/ScreenshotsPage.php b/include/Pages/ScreenshotsPage.php
index 2d678964..584d18a4 100644
--- a/include/Pages/ScreenshotsPage.php
+++ b/include/Pages/ScreenshotsPage.php
@@ -31,18 +31,18 @@ class ScreenshotsPage extends Controller
             return $this->getCategory($category, $game);
         }
 
-        $screenshot  = $this->screenshotsModel->getGroupedScreenshots();
+        $screenshot  = $this->screenshotsModel->getAllCategories();
         $random_shot = $this->screenshotsModel->getRandomScreenshot();
 
         $this->template = 'pages/screenshots.tpl';
 
         return $this->renderPage(
-            array(
+            [
                 'title' => $this->getConfigVars('screenshotsTitle'),
                 'content_title' => $this->getConfigVars('screenshotsContentTitle'),
                 'screenshots' => $screenshot,
                 'random_shot' => $random_shot,
-            )
+            ]
         );
     }
 
@@ -50,24 +50,23 @@ class ScreenshotsPage extends Controller
     public function getCategory($category, $game)
     {
         if (empty($game)) {
-            $screenshots = $this->screenshotsModel->getCategoryScreenshots($category);
+            $screenshots = $this->screenshotsModel->getScreenshotsByCompanyId($category);
         } else {
-            $screenshots = array(
+            $screenshots = [
                 'category' => $category,
-                'games' => array($this->screenshotsModel->getTargetScreenshots($game))
-            );
+                'games' => $this->screenshotsModel->getScreenshotsBySubcategory($game)
+            ];
         }
-
         $this->template = 'pages/screenshots_category.tpl';
 
         return $this->renderPage(
-            array(
+            [
                 'title' => $this->getConfigVars('screenshotsTitle'),
                 'content_title' => $this->getConfigVars('screenshotsContentTitle'),
                 'screenshots' => $screenshots,
                 'category' => $category,
                 'game' => $game,
-            )
+            ]
         );
     }
 }
diff --git a/templates/components/list_items.tpl b/templates/components/list_items.tpl
index 6361289b..f28c0a4a 100644
--- a/templates/components/list_items.tpl
+++ b/templates/components/list_items.tpl
@@ -1,6 +1,6 @@
 {if is_array($list) && $list|@count > 0}
     <ul class="downloads">
-        {foreach from=$list item=item}
+        {foreach from=$list item=item key=key}
             {if $item instanceof ScummVM\Objects\File}
                 {assign var='data' value=$item->getExtraInfo()}
                 <li class="file">
@@ -36,11 +36,10 @@
                 <li class="link">
                     <a href="{$item->getURL()}">{$item->getName()}</a>: {$item->getDescription()}
                 </li>
-            {elseif $item instanceof ScummVM\OrmObjects\Screenshot}
+            {elseif $type === 'screenshot_categories'}
                 <li class="file">
-                    <span class="sprite-games-{$item->getCategory()} sprite"></span>
-                    <a href="{'/screenshots/'|lang}{$arr.category}/{$item->getCategory()}/">{$item->getName()}</a>
-                    <span class="green">({$item->getFiles()|@count} shots)</span>
+                    <span class="sprite-games-{$key} sprite"></span>
+                    <a href="{'/screenshots/'|lang}{$screenshot.category}/{$key}/">{$item}</a>
                 </li>
             {/if}
         {/foreach}
diff --git a/templates/components/random_screenshot.tpl b/templates/components/random_screenshot.tpl
index 69b9ecaa..cf720217 100644
--- a/templates/components/random_screenshot.tpl
+++ b/templates/components/random_screenshot.tpl
@@ -1,4 +1,4 @@
-{assign var='rand_files' value=$random_shot.screenshot->getFiles()}
+{assign var='rand_files' value=$random_shot->getFiles()}
 {assign var='rand_max' value=$rand_files|@count}
 {assign var='rand_pos' value=0|rand:($rand_max-1)}
 {assign var='rand_file' value=$rand_files[$rand_pos]}
@@ -14,4 +14,4 @@
     window.addEventListener('DOMContentLoaded', function() {
         baguetteBox.run('.gallery');
     });
-</script>
\ No newline at end of file
+</script>
diff --git a/templates/pages/screenshots.tpl b/templates/pages/screenshots.tpl
index dd0d03ef..4a7f023b 100644
--- a/templates/pages/screenshots.tpl
+++ b/templates/pages/screenshots.tpl
@@ -3,8 +3,8 @@
         <div class="navigation col-1-2 col-md-1">
             <h4 class="subhead">{#screenshotsNavigation#}</h4>
             <ul>
-                {foreach from=$screenshots item=arr}
-                    <li><a href="{'/screenshots/'|lang}#{$arr.category}">{eval var=$arr.title}</a></li>
+                {foreach from=$screenshots item=screenshot}
+                    <li><a href="{'/screenshots/'|lang}#{$screenshot.category}">{eval var=$screenshot.title}</a></li>
                 {/foreach}
             </ul>
         </div>
@@ -15,14 +15,14 @@
 {/capture}
 
 {capture "content"}
-{foreach from=$screenshots item=arr}
-<div class="subhead" id="{$arr.category}">
-    <a href="{'/screenshots/'|lang}{$arr.category}/">{$arr.title}</a>
+{foreach from=$screenshots item=screenshot}
+<div class="subhead" id="{$screenshot.category}">
+    <a href="{'/screenshots/'|lang}{$screenshot.category}/">{$screenshot.title}</a>
 </div>
-<div class="scr-content scr-content-{$arr.category}">
-    {include file='components/list_items.tpl' list=$arr.games type='games'}
+<div class="scr-content scr-content-{$screenshot.category}">
+    {include file='components/list_items.tpl' list=$screenshot.games type='screenshot_categories'}
 </div>
 {/foreach}
 {/capture}
 
-{include file="components/box.tpl" head=#screenshotsHeading# intro=$smarty.capture.intro content=$smarty.capture.content}
\ No newline at end of file
+{include file="components/box.tpl" head=#screenshotsHeading# intro=$smarty.capture.intro content=$smarty.capture.content}
diff --git a/templates/pages/screenshots_category.tpl b/templates/pages/screenshots_category.tpl
index ffab29a1..d30bf231 100644
--- a/templates/pages/screenshots_category.tpl
+++ b/templates/pages/screenshots_category.tpl
@@ -1,9 +1,6 @@
 {* List all screenshots for an entry or category. *}
 {capture "content"}
     {foreach from=$screenshots.games item=g name=cat_loop}
-        {if $game and $game != $g->getCategory()}
-            {continue}
-        {/if}
         <div class="gallery">
             <div class="row">
                 <h3 class="subhead"><a href="{'/screenshots/'|lang}{$category}/{$g->getCategory()}/">{$g->getName()}</a></h3>
@@ -21,9 +18,6 @@
                 {/foreach}
             </div>
         </div>
-        {if $game and $game == $g->getCategory()}
-            {break}
-        {/if}
     {/foreach}
 {/capture}
 
@@ -39,4 +33,4 @@
     document.addEventListener('DOMContentLoaded', function() {
         baguetteBox.run('.gallery');
     });
-</script>
\ No newline at end of file
+</script>


Commit: 6589516321b1298229519dcf2108d220a6621d6a
    https://github.com/scummvm/scummvm-web/commit/6589516321b1298229519dcf2108d220a6621d6a
Author: Mataniko (mataniko at gmail.com)
Date: 2020-12-31T04:49:44-05:00

Commit Message:
WEB: Restore number of shots in screenshots page

Changed paths:
    include/DataUtils.php
    include/Models/ScreenshotsModel.php
    include/OrmObjects/ScreenshotQuery.php
    schema.xml
    templates/components/list_items.tpl


diff --git a/include/DataUtils.php b/include/DataUtils.php
index 84fed39f..046043f6 100644
--- a/include/DataUtils.php
+++ b/include/DataUtils.php
@@ -124,6 +124,15 @@ class DataUtils
                     if ($object === 'Demo') {
                         $item['platform_id'] = $item['platform'];
                     }
+                    if ($object === 'Screenshot') {
+                        // Add number of shots
+                        $item['num_shots'] = count(
+                            array_filter(
+                                glob("./public_html" . DIR_SCREENSHOTS . "/". $item['filemask']),
+                                function (string $file) {
+                                    return \strpos($file, "_full.");
+                                }));
+                    }
                     $dbItem->fromArray($item, TableMap::TYPE_FIELDNAME);
                     $dbItem->save();
                 } catch (\Exception $ex) {
@@ -136,3 +145,7 @@ class DataUtils
 }
 
 DataUtils::updateData();
+// $dir = "./public_html" . DIR_SCREENSHOTS . "/". 'sierra/bc/bc_dos_en_1_*';
+// echo $dir;
+// var_dump(glob($dir));
+// echo count(glob("./" . DIR_SCREENSHOTS . "/". 'sierra/bc/bc_dos_en_1_*'));
diff --git a/include/Models/ScreenshotsModel.php b/include/Models/ScreenshotsModel.php
index 5eb8bb5c..f40129fd 100644
--- a/include/Models/ScreenshotsModel.php
+++ b/include/Models/ScreenshotsModel.php
@@ -27,7 +27,10 @@ class ScreenshotsModel extends BasicModel
                     'games' => [],
                 ];
             }
-            $data[$category_key]['games'][$subcategory_key] = $subcategory_name;
+            $data[$category_key]['games'][$subcategory_key] = [
+                'name' => $subcategory_name,
+                'count' => $count
+            ];
         }
         return $data;
     }
diff --git a/include/OrmObjects/ScreenshotQuery.php b/include/OrmObjects/ScreenshotQuery.php
index 14c7c5e2..922eb4bd 100644
--- a/include/OrmObjects/ScreenshotQuery.php
+++ b/include/OrmObjects/ScreenshotQuery.php
@@ -67,7 +67,8 @@ class ScreenshotQuery extends BaseScreenshotQuery
                 (CASE
                         WHEN game.series_id IS NULL THEN game.name
                         ELSE series.name || ' (Series)'
-                    END) AS subcategory_name
+                    END) AS subcategory_name,
+                SUM(num_shots) as count
                 FROM screenshot
                 JOIN game ON game.id = screenshot.id
                 JOIN company ON game.company_id = company.id
diff --git a/schema.xml b/schema.xml
index eec38724..c3f238f6 100644
--- a/schema.xml
+++ b/schema.xml
@@ -69,6 +69,7 @@
     <column name="platform_id" type="varchar" size="24" required="true"/>
     <column name="language" type="varchar" size="8" required="true"/>
     <column name="filemask" type="varchar" size="255" required="true"/>
+    <column name="num_shots" type="SMALLINT" required="true"/>
     <foreign-key foreignTable="game" onDelete="CASCADE">
       <reference local="id" foreign="id"/>
     </foreign-key>
diff --git a/templates/components/list_items.tpl b/templates/components/list_items.tpl
index f28c0a4a..a6d8b943 100644
--- a/templates/components/list_items.tpl
+++ b/templates/components/list_items.tpl
@@ -39,7 +39,8 @@
             {elseif $type === 'screenshot_categories'}
                 <li class="file">
                     <span class="sprite-games-{$key} sprite"></span>
-                    <a href="{'/screenshots/'|lang}{$screenshot.category}/{$key}/">{$item}</a>
+                    <a href="{'/screenshots/'|lang}{$screenshot.category}/{$key}/">{$item.name}</a>
+                    <span class="download-extras">({$item.count} shots)</span>
                 </li>
             {/if}
         {/foreach}




More information about the Scummvm-git-logs mailing list