You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an optional JSON manifest format for OGSpy mods. version.json should become the preferred metadata source while every existing version.txt mod continues to work indefinitely.
This is a metadata-format refactor: it must preserve the current mod install, update, enable/disable, cache, and routing behavior.
Current problem
Mod metadata is stored in a line-oriented version.txt file. Besides the displayed version, this format controls the values required to install and run a mod:
display name
version
title, menu, action, root, link, active, and admin_only
minimum supported OGSpy version
optional toolbar version
The parser is repeated across the mod lifecycle and relies on positional lines, which makes metadata difficult to extend and validate safely.
Affected code paths
includes/mod.php: mod_list(), mod_install(), mod_update(), install_mod(), and update_mod()
model/Mod_Model.php: persists normalized version and routing metadata
When present, version.json is the authoritative metadata source.
When version.json is absent, OGSpy reads the existing version.txt format exactly as today. This fallback is permanent; no deprecation deadline is introduced.
When version.json exists but is malformed or lacks required values, mod discovery/install/update must produce a controlled, logged metadata error. Do not silently fall back to version.txt in that situation.
Both formats are normalized to the same internal metadata structure before database, cache, and routing code consumes them.
Manifest shape
Define and document a versioned schema. It must include the current required metadata, for example:
Optional typed metadata may include description, authors, license, homepage, requirements.php, requirements.extensions, toolbar_min_version, and a changelog.
Acceptance criteria
Define and document the version.json schema, required fields, value types, and validation errors.
Extract duplicated metadata parsing from includes/mod.php into one reader/validator that returns normalized metadata.
Update mod_list(), mod_install(), mod_update(), install_mod(), and update_mod() to use the normalized reader.
Verify that equivalent JSON and legacy manifests produce identical database rows and mod-cache entries.
Log and reject malformed or incomplete version.json instead of falling back when that file exists.
Add focused automated tests for valid JSON listing/install/update, legacy fallback, malformed JSON, missing fields, and incompatible OGSpy versions.
Provide an example manifest and conversion/documentation guidance for mod maintainers.
Explicit non-goals
Do not remove version.txt or schedule a deprecation date.
Do not change the ogspy_mod database schema.
Do not add automatic resolution or installation of inter-mod dependencies.
Do not redesign the administration UI or alter normal install/update/uninstall workflows.
Implementation notes
Migrate bundled mods only where conversion can be mechanically verified. It is acceptable for bundled legacy mods to keep version.txt while the new parser, documentation, tests, and a representative version.json example are introduced.
Summary
Add an optional JSON manifest format for OGSpy mods.
version.jsonshould become the preferred metadata source while every existingversion.txtmod continues to work indefinitely.This is a metadata-format refactor: it must preserve the current mod install, update, enable/disable, cache, and routing behavior.
Current problem
Mod metadata is stored in a line-oriented
version.txtfile. Besides the displayed version, this format controls the values required to install and run a mod:title,menu,action,root,link,active, andadmin_onlyThe parser is repeated across the mod lifecycle and relies on positional lines, which makes metadata difficult to extend and validate safely.
Affected code paths
includes/mod.php:mod_list(),mod_install(),mod_update(),install_mod(), andupdate_mod()model/Mod_Model.php: persists normalized version and routing metadataincludes/cache.php:generate_mod_cache()views/admin_mod.php: install/update/listing controlsindex.php: mod action routingmod/*/version.txt: existing legacy manifestsProposed contract
version.jsonat its root.version.jsonis the authoritative metadata source.version.jsonis absent, OGSpy reads the existingversion.txtformat exactly as today. This fallback is permanent; no deprecation deadline is introduced.version.jsonexists but is malformed or lacks required values, mod discovery/install/update must produce a controlled, logged metadata error. Do not silently fall back toversion.txtin that situation.Manifest shape
Define and document a versioned schema. It must include the current required metadata, for example:
{ "name": "Production", "version": "1.6.0", "config": { "title": "production", "menu": "production", "action": "production", "root": "production", "link": "production.php", "active": true, "admin_only": false }, "requirements": { "ogspy": ">=3.3.8" } }Optional typed metadata may include
description,authors,license,homepage,requirements.php,requirements.extensions,toolbar_min_version, and a changelog.Acceptance criteria
version.jsonschema, required fields, value types, and validation errors.includes/mod.phpinto one reader/validator that returns normalized metadata.mod_list(),mod_install(),mod_update(),install_mod(), andupdate_mod()to use the normalized reader.version.jsoninstead of falling back when that file exists.Explicit non-goals
version.txtor schedule a deprecation date.ogspy_moddatabase schema.Implementation notes
Migrate bundled mods only where conversion can be mechanically verified. It is acceptable for bundled legacy mods to keep
version.txtwhile the new parser, documentation, tests, and a representativeversion.jsonexample are introduced.