From 80654602b1e7c290fedf675e137bee20a12ed9bf Mon Sep 17 00:00:00 2001 From: Sam Wilson Date: Sun, 8 Dec 2024 17:18:34 +0800 Subject: [PATCH] Update Addwiki to version 3 (and other PHP deps) --- composer.json | 2 +- composer.lock | 479 ++++++++++++++++++++++++++++++++++++++------------ src/Site.php | 6 +- src/Twig.php | 13 +- 4 files changed, 378 insertions(+), 122 deletions(-) diff --git a/composer.json b/composer.json index 13a34cb..32c65ee 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "ext-json": "*", "ext-pdo": "*", "ext-sqlite3": "*", - "addwiki/mediawiki-api-base": "^2.7", + "addwiki/mediawiki-api-base": "^3", "endroid/qr-code": "^4.1", "league/flysystem": "^1.0", "myclabs/php-enum": "^1.5", diff --git a/composer.lock b/composer.lock index a8c04e7..c9ed12f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,26 +4,27 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ef6729d3d7e4a40998c991b7d08b99ff", + "content-hash": "68f967fd82c076b369b098113268e674", "packages": [ { "name": "addwiki/mediawiki-api-base", - "version": "2.8.0", + "version": "3.0.0", "source": { "type": "git", "url": "https://github.com/addwiki/mediawiki-api-base.git", - "reference": "d8eff31b54fd39d90eb14457e5ce478cfdf08394" + "reference": "9db3892b18e79e8f47d59624ae85cabe93cd42ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/addwiki/mediawiki-api-base/zipball/d8eff31b54fd39d90eb14457e5ce478cfdf08394", - "reference": "d8eff31b54fd39d90eb14457e5ce478cfdf08394", + "url": "https://api.github.com/repos/addwiki/mediawiki-api-base/zipball/9db3892b18e79e8f47d59624ae85cabe93cd42ef", + "reference": "9db3892b18e79e8f47d59624ae85cabe93cd42ef", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "~6.3|~7.0", + "guzzlehttp/guzzle": "~6.3||~7.0", "guzzlehttp/promises": "~1.0", - "php": ">=7.3", + "mediawiki/oauthclient": "^1.1", + "php": ">=7.4", "psr/log": "~1.0" }, "require-dev": { @@ -32,17 +33,18 @@ "phpunit/phpunit": "~9" }, "suggest": { - "etsy/phan": "Allows running static analysis on the package (requires PHP 7+)" + "ext-dom": "Needed if you want to discover APIs using only page URLs", + "ext-simplexml": "Needed if you want to discover APIs using only page URLs" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.8-dev" + "dev-main": "3.0-dev" } }, "autoload": { "psr-4": { - "Mediawiki\\Api\\": "src/" + "Addwiki\\Mediawiki\\Api\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -60,9 +62,9 @@ "mediawiki" ], "support": { - "source": "https://github.com/addwiki/mediawiki-api-base/tree/2.8.0" + "source": "https://github.com/addwiki/mediawiki-api-base/tree/3.0.0" }, - "time": "2021-02-16T19:46:17+00:00" + "time": "2021-10-23T08:50:12+00:00" }, { "name": "bacon/bacon-qr-code", @@ -709,16 +711,16 @@ }, { "name": "league/commonmark", - "version": "2.5.3", + "version": "2.6.0", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "b650144166dfa7703e62a22e493b853b58d874b0" + "reference": "d150f911e0079e90ae3c106734c93137c184f932" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/b650144166dfa7703e62a22e493b853b58d874b0", - "reference": "b650144166dfa7703e62a22e493b853b58d874b0", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d150f911e0079e90ae3c106734c93137c184f932", + "reference": "d150f911e0079e90ae3c106734c93137c184f932", "shasum": "" }, "require": { @@ -743,8 +745,9 @@ "phpstan/phpstan": "^1.8.2", "phpunit/phpunit": "^9.5.21 || ^10.5.9 || ^11.0.0", "scrutinizer/ocular": "^1.8.1", - "symfony/finder": "^5.3 | ^6.0 || ^7.0", - "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 || ^7.0", + "symfony/finder": "^5.3 | ^6.0 | ^7.0", + "symfony/process": "^5.4 | ^6.0 | ^7.0", + "symfony/yaml": "^2.3 | ^3.0 | ^4.0 | ^5.0 | ^6.0 | ^7.0", "unleashedtech/php-coding-standard": "^3.1.1", "vimeo/psalm": "^4.24.0 || ^5.0.0" }, @@ -754,7 +757,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.6-dev" + "dev-main": "2.7-dev" } }, "autoload": { @@ -811,7 +814,7 @@ "type": "tidelift" } ], - "time": "2024-08-16T11:46:16+00:00" + "time": "2024-12-07T15:34:16+00:00" }, { "name": "league/config", @@ -1045,6 +1048,66 @@ ], "time": "2024-09-21T08:32:55+00:00" }, + { + "name": "mediawiki/oauthclient", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/wikimedia/mediawiki-oauthclient-php.git", + "reference": "ace642e67b8292a5e351c50daca7d3f2b25fa4cb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wikimedia/mediawiki-oauthclient-php/zipball/ace642e67b8292a5e351c50daca7d3f2b25fa4cb", + "reference": "ace642e67b8292a5e351c50daca7d3f2b25fa4cb", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-json": "*", + "php": ">=7.2.9", + "psr/log": "^1.0" + }, + "require-dev": { + "mediawiki/mediawiki-codesniffer": "37.0.0", + "mediawiki/minus-x": "1.1.1", + "php-parallel-lint/php-console-highlighter": "0.5.0", + "php-parallel-lint/php-parallel-lint": "1.3.0", + "phpunit/phpunit": "^8.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "MediaWiki\\OAuthClient\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-3.0-or-later" + ], + "authors": [ + { + "name": "Andy Smith", + "homepage": "http://termie.pbworks.com/w/page/20571888/AndySmith" + }, + { + "name": "Chris Steipp", + "email": "csteipp@wikimedia.org" + }, + { + "name": "Bryan Davis", + "email": "bd808@wikimedia.org" + } + ], + "description": "PHP OAuth client for use with Wikipedia and other MediaWiki-based wikis running the OAuth extension", + "homepage": "https://www.mediawiki.org/wiki/oauthclient-php", + "support": { + "docs": "https://www.mediawiki.org/wiki/oauthclient-php", + "issues": "https://phabricator.wikimedia.org/tag/oauth/", + "source": "https://github.com/wikimedia/oauthclient-php/" + }, + "time": "2021-10-21T13:34:48+00:00" + }, { "name": "myclabs/php-enum", "version": "1.8.4", @@ -1849,16 +1912,16 @@ }, { "name": "simplepie/simplepie", - "version": "1.8.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/simplepie/simplepie.git", - "reference": "65b095d87bc00898d8fa7737bdbcda93a3fbcc55" + "reference": "a567b8ab9b6145a23e6a9ec2b6b74f56d52f7ad1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/simplepie/simplepie/zipball/65b095d87bc00898d8fa7737bdbcda93a3fbcc55", - "reference": "65b095d87bc00898d8fa7737bdbcda93a3fbcc55", + "url": "https://api.github.com/repos/simplepie/simplepie/zipball/a567b8ab9b6145a23e6a9ec2b6b74f56d52f7ad1", + "reference": "a567b8ab9b6145a23e6a9ec2b6b74f56d52f7ad1", "shasum": "" }, "require": { @@ -1919,9 +1982,9 @@ ], "support": { "issues": "https://github.com/simplepie/simplepie/issues", - "source": "https://github.com/simplepie/simplepie/tree/1.8.0" + "source": "https://github.com/simplepie/simplepie/tree/1.8.1" }, - "time": "2023-01-20T08:37:35+00:00" + "time": "2024-11-22T16:33:20+00:00" }, { "name": "symfony/cache", @@ -2022,16 +2085,16 @@ }, { "name": "symfony/cache-contracts", - "version": "v2.5.3", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/cache-contracts.git", - "reference": "fee6db04d913094e2fb55ff8e7db5685a8134463" + "reference": "517c3a3619dadfa6952c4651767fcadffb4df65e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/fee6db04d913094e2fb55ff8e7db5685a8134463", - "reference": "fee6db04d913094e2fb55ff8e7db5685a8134463", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/517c3a3619dadfa6952c4651767fcadffb4df65e", + "reference": "517c3a3619dadfa6952c4651767fcadffb4df65e", "shasum": "" }, "require": { @@ -2081,7 +2144,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/cache-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/cache-contracts/tree/v2.5.4" }, "funding": [ { @@ -2097,7 +2160,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/console", @@ -2200,16 +2263,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.3", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d" + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", - "reference": "80d075412b557d41002320b96a096ca65aa2c98d", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/605389f2a7e5625f273b53960dc46aeaf9c62918", + "reference": "605389f2a7e5625f273b53960dc46aeaf9c62918", "shasum": "" }, "require": { @@ -2247,7 +2310,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.4" }, "funding": [ { @@ -2263,7 +2326,7 @@ "type": "tidelift" } ], - "time": "2023-01-24T14:02:46+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/filesystem", @@ -3099,16 +3162,16 @@ }, { "name": "symfony/service-contracts", - "version": "v2.5.3", + "version": "v2.5.4", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3" + "reference": "f37b419f7aea2e9abf10abd261832cace12e3300" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a2329596ddc8fd568900e3fc76cba42489ecc7f3", - "reference": "a2329596ddc8fd568900e3fc76cba42489ecc7f3", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f37b419f7aea2e9abf10abd261832cace12e3300", + "reference": "f37b419f7aea2e9abf10abd261832cace12e3300", "shasum": "" }, "require": { @@ -3162,7 +3225,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v2.5.3" + "source": "https://github.com/symfony/service-contracts/tree/v2.5.4" }, "funding": [ { @@ -3178,7 +3241,7 @@ "type": "tidelift" } ], - "time": "2023-04-21T15:04:16+00:00" + "time": "2024-09-25T14:11:13+00:00" }, { "name": "symfony/string", @@ -3983,49 +4046,55 @@ }, { "name": "ergebnis/composer-normalize", - "version": "2.44.0", + "version": "2.45.0", "source": { "type": "git", "url": "https://github.com/ergebnis/composer-normalize.git", - "reference": "bd0c446426bb837ae0cc9f97948167e658bd11d2" + "reference": "bb82b484bed2556da6311b9eff779fa7e73ce937" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/composer-normalize/zipball/bd0c446426bb837ae0cc9f97948167e658bd11d2", - "reference": "bd0c446426bb837ae0cc9f97948167e658bd11d2", + "url": "https://api.github.com/repos/ergebnis/composer-normalize/zipball/bb82b484bed2556da6311b9eff779fa7e73ce937", + "reference": "bb82b484bed2556da6311b9eff779fa7e73ce937", "shasum": "" }, "require": { "composer-plugin-api": "^2.0.0", - "ergebnis/json": "^1.2.0", - "ergebnis/json-normalizer": "^4.5.0", - "ergebnis/json-printer": "^3.5.0", + "ergebnis/json": "^1.4.0", + "ergebnis/json-normalizer": "^4.8.0", + "ergebnis/json-printer": "^3.7.0", "ext-json": "*", - "justinrainbow/json-schema": "^5.2.12", - "localheinz/diff": "^1.1.1", + "justinrainbow/json-schema": "^5.2.12 || ^6.0.0", + "localheinz/diff": "^1.2.0", "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" }, "require-dev": { - "composer/composer": "^2.7.7", - "ergebnis/license": "^2.5.0", - "ergebnis/php-cs-fixer-config": "^6.37.0", - "ergebnis/phpunit-slow-test-detector": "^2.16.0", - "fakerphp/faker": "^1.23.1", + "composer/composer": "^2.8.3", + "ergebnis/license": "^2.6.0", + "ergebnis/php-cs-fixer-config": "^6.39.0", + "ergebnis/phpunit-slow-test-detector": "^2.17.0", + "fakerphp/faker": "^1.24.1", "infection/infection": "~0.26.6", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.12", + "phpstan/phpstan-deprecation-rules": "^1.2.1", + "phpstan/phpstan-phpunit": "^1.4.1", + "phpstan/phpstan-strict-rules": "^1.6.1", "phpunit/phpunit": "^9.6.20", - "psalm/plugin-phpunit": "~0.19.0", - "rector/rector": "^1.2.5", - "symfony/filesystem": "^5.4.41", - "vimeo/psalm": "^5.26.1" + "rector/rector": "^1.2.10", + "symfony/filesystem": "^5.4.41" }, "type": "composer-plugin", "extra": { "class": "Ergebnis\\Composer\\Normalize\\NormalizePlugin", + "branch-alias": { + "dev-main": "2.44-dev" + }, + "plugin-optional": true, "composer-normalize": { "indent-size": 2, "indent-style": "space" - }, - "plugin-optional": true + } }, "autoload": { "psr-4": { @@ -4056,7 +4125,7 @@ "security": "https://github.com/ergebnis/composer-normalize/blob/main/.github/SECURITY.md", "source": "https://github.com/ergebnis/composer-normalize" }, - "time": "2024-09-30T21:56:22+00:00" + "time": "2024-12-04T18:36:37+00:00" }, { "name": "ergebnis/json", @@ -4128,16 +4197,16 @@ }, { "name": "ergebnis/json-normalizer", - "version": "4.7.0", + "version": "4.8.0", "source": { "type": "git", "url": "https://github.com/ergebnis/json-normalizer.git", - "reference": "36d86389095736944a5954ec440552bbe92e425f" + "reference": "e3a477b62808f377f4fc69a50f9eb66ec102747b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ergebnis/json-normalizer/zipball/36d86389095736944a5954ec440552bbe92e425f", - "reference": "36d86389095736944a5954ec440552bbe92e425f", + "url": "https://api.github.com/repos/ergebnis/json-normalizer/zipball/e3a477b62808f377f4fc69a50f9eb66ec102747b", + "reference": "e3a477b62808f377f4fc69a50f9eb66ec102747b", "shasum": "" }, "require": { @@ -4146,7 +4215,7 @@ "ergebnis/json-printer": "^3.5.0", "ergebnis/json-schema-validator": "^4.2.0", "ext-json": "*", - "justinrainbow/json-schema": "^5.2.12", + "justinrainbow/json-schema": "^5.2.12 || ^6.0.0", "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" }, "require-dev": { @@ -4172,7 +4241,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "4.7-dev" + "dev-main": "4.8-dev" }, "composer-normalize": { "indent-size": 2, @@ -4206,7 +4275,7 @@ "security": "https://github.com/ergebnis/json-normalizer/blob/main/.github/SECURITY.md", "source": "https://github.com/ergebnis/json-normalizer" }, - "time": "2024-11-17T20:34:42+00:00" + "time": "2024-12-04T16:48:55+00:00" }, { "name": "ergebnis/json-pointer", @@ -4468,25 +4537,142 @@ }, "time": "2021-06-11T22:34:44+00:00" }, + { + "name": "icecave/parity", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/icecave/parity.git", + "reference": "0109fef58b3230d23b20b2ac52ecdf477218d300" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/icecave/parity/zipball/0109fef58b3230d23b20b2ac52ecdf477218d300", + "reference": "0109fef58b3230d23b20b2ac52ecdf477218d300", + "shasum": "" + }, + "require": { + "icecave/repr": "~1", + "php": ">=5.3" + }, + "require-dev": { + "eloquent/liberator": "~1", + "icecave/archer": "~1" + }, + "suggest": { + "eloquent/asplode": "Drop-in exception-based error handling." + }, + "type": "library", + "autoload": { + "psr-0": { + "Icecave\\Parity": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "James Harris", + "email": "james.harris@icecave.com.au", + "homepage": "https://github.com/jmalloc" + } + ], + "description": "A customizable deep comparison library.", + "homepage": "https://github.com/IcecaveStudios/parity", + "keywords": [ + "compare", + "comparison", + "equal", + "equality", + "greater", + "less", + "sort", + "sorting" + ], + "support": { + "issues": "https://github.com/icecave/parity/issues", + "source": "https://github.com/icecave/parity/tree/1.0.0" + }, + "time": "2014-01-17T05:56:27+00:00" + }, + { + "name": "icecave/repr", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/icecave/repr.git", + "reference": "8a3d2953adf5f464a06e3e2587aeacc97e2bed07" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/icecave/repr/zipball/8a3d2953adf5f464a06e3e2587aeacc97e2bed07", + "reference": "8a3d2953adf5f464a06e3e2587aeacc97e2bed07", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "icecave/archer": "~1" + }, + "suggest": { + "eloquent/asplode": "Drop-in exception-based error handling." + }, + "type": "library", + "autoload": { + "psr-4": { + "Icecave\\Repr\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "James Harris", + "email": "james.harris@icecave.com.au", + "homepage": "https://github.com/jmalloc" + } + ], + "description": "A library for generating string representations of any value, inspired by Python's reprlib library.", + "homepage": "https://github.com/IcecaveStudios/repr", + "keywords": [ + "human", + "readable", + "repr", + "representation", + "string" + ], + "support": { + "issues": "https://github.com/icecave/repr/issues", + "source": "https://github.com/icecave/repr/tree/1.0.1" + }, + "time": "2014-07-25T05:44:41+00:00" + }, { "name": "justinrainbow/json-schema", - "version": "5.3.0", + "version": "6.0.0", "source": { "type": "git", "url": "https://github.com/jsonrainbow/json-schema.git", - "reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8" + "reference": "a38c6198d53b09c0702f440585a4f4a5d9137bd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8", - "reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/a38c6198d53b09c0702f440585a4f4a5d9137bd9", + "reference": "a38c6198d53b09c0702f440585a4f4a5d9137bd9", "shasum": "" }, "require": { - "php": ">=7.1" + "icecave/parity": "1.0.0", + "marc-mabe/php-enum": "^2.0 || ^3.0 || ^4.0", + "php": ">=5.3.3" }, "require-dev": { - "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", + "friendsofphp/php-cs-fixer": "~2.2.20 || ~2.19.0", "json-schema/json-schema-test-suite": "1.2.0", "phpunit/phpunit": "^4.8.35" }, @@ -4494,6 +4680,11 @@ "bin/validate-json" ], "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.x-dev" + } + }, "autoload": { "psr-4": { "JsonSchema\\": "src/JsonSchema/" @@ -4522,36 +4713,36 @@ } ], "description": "A library to validate a json schema.", - "homepage": "https://github.com/justinrainbow/json-schema", + "homepage": "https://github.com/jsonrainbow/json-schema", "keywords": [ "json", "schema" ], "support": { "issues": "https://github.com/jsonrainbow/json-schema/issues", - "source": "https://github.com/jsonrainbow/json-schema/tree/5.3.0" + "source": "https://github.com/jsonrainbow/json-schema/tree/6.0.0" }, - "time": "2024-07-06T21:00:26+00:00" + "time": "2024-07-30T17:49:21+00:00" }, { "name": "localheinz/diff", - "version": "1.1.1", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/localheinz/diff.git", - "reference": "851bb20ea8358c86f677f5f111c4ab031b1c764c" + "reference": "ec413943c2b518464865673fd5b38f7df867a010" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/localheinz/diff/zipball/851bb20ea8358c86f677f5f111c4ab031b1c764c", - "reference": "851bb20ea8358c86f677f5f111c4ab031b1c764c", + "url": "https://api.github.com/repos/localheinz/diff/zipball/ec413943c2b518464865673fd5b38f7df867a010", + "reference": "ec413943c2b518464865673fd5b38f7df867a010", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "php": "~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0" }, "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", + "phpunit/phpunit": "^7.5.0 || ^8.5.23", "symfony/process": "^4.2 || ^5" }, "type": "library", @@ -4583,15 +4774,83 @@ "unified diff" ], "support": { - "source": "https://github.com/localheinz/diff/tree/main" + "issues": "https://github.com/localheinz/diff/issues", + "source": "https://github.com/localheinz/diff/tree/1.2.0" }, - "funding": [ + "time": "2024-12-04T14:16:01+00:00" + }, + { + "name": "marc-mabe/php-enum", + "version": "v4.7.1", + "source": { + "type": "git", + "url": "https://github.com/marc-mabe/php-enum.git", + "reference": "7159809e5cfa041dca28e61f7f7ae58063aae8ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/marc-mabe/php-enum/zipball/7159809e5cfa041dca28e61f7f7ae58063aae8ed", + "reference": "7159809e5cfa041dca28e61f7f7ae58063aae8ed", + "shasum": "" + }, + "require": { + "ext-reflection": "*", + "php": "^7.1 | ^8.0" + }, + "require-dev": { + "phpbench/phpbench": "^0.16.10 || ^1.0.4", + "phpstan/phpstan": "^1.3.1", + "phpunit/phpunit": "^7.5.20 | ^8.5.22 | ^9.5.11", + "vimeo/psalm": "^4.17.0 | ^5.26.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-3.x": "3.2-dev", + "dev-master": "4.7-dev" + } + }, + "autoload": { + "psr-4": { + "MabeEnum\\": "src/" + }, + "classmap": [ + "stubs/Stringable.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ { - "url": "https://github.com/sebastianbergmann", - "type": "github" + "name": "Marc Bennewitz", + "email": "dev@mabe.berlin", + "homepage": "https://mabe.berlin/", + "role": "Lead" } ], - "time": "2020-07-06T04:49:32+00:00" + "description": "Simple and fast implementation of enumerations with native PHP", + "homepage": "https://github.com/marc-mabe/php-enum", + "keywords": [ + "enum", + "enum-map", + "enum-set", + "enumeration", + "enumerator", + "enummap", + "enumset", + "map", + "set", + "type", + "type-hint", + "typehint" + ], + "support": { + "issues": "https://github.com/marc-mabe/php-enum/issues", + "source": "https://github.com/marc-mabe/php-enum/tree/v4.7.1" + }, + "time": "2024-11-28T04:54:44+00:00" }, { "name": "microsoft/tolerant-php-parser", @@ -5222,16 +5481,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.6.0", + "version": "5.6.1", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c" + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/f3558a4c23426d12bffeaab463f8a8d8b681193c", - "reference": "f3558a4c23426d12bffeaab463f8a8d8b681193c", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", + "reference": "e5e784149a09bd69d9a5e3b01c5cbd2e2bd653d8", "shasum": "" }, "require": { @@ -5280,9 +5539,9 @@ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", "support": { "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.0" + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.1" }, - "time": "2024-11-12T11:25:25+00:00" + "time": "2024-12-07T09:39:29+00:00" }, { "name": "phpdocumentor/type-resolver", @@ -5710,16 +5969,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.21", + "version": "9.6.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa" + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "shasum": "" }, "require": { @@ -5730,7 +5989,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.0", + "myclabs/deep-copy": "^1.12.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", @@ -5793,7 +6052,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, "funding": [ { @@ -5809,7 +6068,7 @@ "type": "tidelift" } ], - "time": "2024-09-19T10:50:18+00:00" + "time": "2024-12-05T13:48:26+00:00" }, { "name": "roslov/psr12ext", @@ -7028,16 +7287,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.4.47", + "version": "v5.4.48", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "e13e8dfa8eaab2b0536ef365beddc2af723a9ac0" + "reference": "42f18f170aa86d612c3559cfb3bd11a375df32c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e13e8dfa8eaab2b0536ef365beddc2af723a9ac0", - "reference": "e13e8dfa8eaab2b0536ef365beddc2af723a9ac0", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/42f18f170aa86d612c3559cfb3bd11a375df32c8", + "reference": "42f18f170aa86d612c3559cfb3bd11a375df32c8", "shasum": "" }, "require": { @@ -7097,7 +7356,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.47" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.48" }, "funding": [ { diff --git a/src/Site.php b/src/Site.php index 6ad4693..6e3c850 100644 --- a/src/Site.php +++ b/src/Site.php @@ -4,8 +4,8 @@ namespace App; +use Addwiki\Mediawiki\Api\Client\Action\ActionApi; use Exception; -use Mediawiki\Api\MediawikiApi; use stdClass; use Symfony\Component\Finder\Finder; use Symfony\Component\Yaml\Yaml; @@ -140,8 +140,8 @@ public function getLang(): string /** * @param string $apiUrl The URL to api.php for a MediaWiki wiki. */ - public function getMediawikiApi(string $apiUrl): MediawikiApi + public function getMediawikiApi(string $apiUrl): ActionApi { - return new MediawikiApi($apiUrl); + return new ActionApi($apiUrl); } } diff --git a/src/Twig.php b/src/Twig.php index f698791..9dd6afd 100644 --- a/src/Twig.php +++ b/src/Twig.php @@ -4,6 +4,7 @@ namespace App; +use Addwiki\Mediawiki\Api\Client\Action\Request\ActionRequest; use App\Command\CommandBase; use DateTime; use DateTimeZone; @@ -21,7 +22,6 @@ use League\CommonMark\Extension\CommonMark\Node\Inline\Image; use League\CommonMark\Extension\Footnote\FootnoteExtension; use League\CommonMark\MarkdownConverter; -use Mediawiki\Api\FluentRequest; use Psr\Cache\CacheItemPoolInterface; use Samwilson\CommonMarkLatex\LatexRendererExtension; use Samwilson\CommonMarkShortcodes\Shortcode; @@ -215,11 +215,10 @@ public function functionWikidata(string $wikidataId): array return $cacheItem->get(); } $api = $this->site->getMediawikiApi('https://www.wikidata.org/w/api.php'); - $request = FluentRequest::factory() - ->setAction('wbgetentities') + $request = ActionRequest::simpleGet('wbgetentities') ->setParam('ids', $wikidataId); CommandBase::writeln('Wikidata fetch info: ' . $wikidataId); - $result = $api->getRequest($request); + $result = $api->request($request); self::$data['wikidata'][$wikidataId] = $result['entities'][$wikidataId]; $cacheItem->set(self::$data['wikidata'][$wikidataId]); $cache->save($cacheItem); @@ -335,8 +334,7 @@ public function functionCommons(string $filename): array return $cacheItem->get(); } $api = $this->site->getMediawikiApi('https://commons.wikimedia.org/w/api.php'); - $fileInfoResponse = $api->getRequest(FluentRequest::factory() - ->setAction('query') + $fileInfoResponse = $api->request(ActionRequest::simpleGet('query') ->addParams([ 'prop' => 'imageinfo', 'iiprop' => 'url', @@ -349,8 +347,7 @@ public function functionCommons(string $filename): array throw new Exception('Commons file does not exist: ' . $filename); } CommandBase::writeln("Commons fetch info: $filename"); - $mediaInfoResponse = $api->getRequest(FluentRequest::factory() - ->setAction('wbgetentities') + $mediaInfoResponse = $api->request(ActionRequest::simpleGet('wbgetentities') ->addParams(['ids' => 'M' . $fileInfo['pageid']])); $mediaInfo = array_shift($mediaInfoResponse['entities']); self::$data['commons'][$filename] = array_merge($fileInfo, $mediaInfo);