Compare commits

..

2 commits

Author SHA1 Message Date
da130e5855 Updated to use URL registry. 2024-10-05 15:25:27 +00:00
f0ddb6727e Updated Index library in Mince. 2024-10-05 14:48:18 +00:00
37 changed files with 285 additions and 419 deletions

View file

@ -1,8 +1,6 @@
{
"require": {
"flashwave/index": "^0.2408.40014",
"flashwave/sasae": "^1.1",
"flashwave/syokuhou": "^1.2",
"flashwave/index": "^0.2410",
"ramsey/uuid": "^4.7",
"sentry/sdk": "^4.0",
"nesbot/carbon": "^3.7"

359
composer.lock generated
View file

@ -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": "1c95218980bc9a8618d881ff3609d3e8",
"content-hash": "c55991a4602fd82deb63b990f03b7455",
"packages": [
{
"name": "brick/math",
@ -137,23 +137,28 @@
},
{
"name": "flashwave/index",
"version": "v0.2408.40014",
"version": "v0.2410.51409",
"source": {
"type": "git",
"url": "https://patchii.net/flash/index.git",
"reference": "fbca708fbd75e8ecc6b36b39c1307a67bf250808"
"reference": "c43c6eb334f85edf8fa7b5e4058b3ba35a27d960"
},
"require": {
"ext-mbstring": "*",
"php": ">=8.3"
"php": ">=8.3",
"twig/html-extra": "^3.13",
"twig/twig": "^3.14"
},
"require-dev": {
"phpstan/phpstan": "^1.11",
"phpunit/phpunit": "^11.2"
},
"suggest": {
"ext-mysqli": "Support for the Index\\Data\\MariaDB namespace (both mysqlnd and libmysql are supported).",
"ext-sqlite3": "Support for the Index\\Data\\SQLite namespace."
"ext-memcache": "Support for the Index\\Cache\\Memcached namespace (only if you can't use ext-memcached for some reason).",
"ext-memcached": "Support for the Index\\Cache\\Memcached namespace (you should use this instead of ext-memcache).",
"ext-mysqli": "Support for the Index\\Db\\MariaDb namespace (both mysqlnd and libmysql are supported).",
"ext-redis": "Support for the Index\\Cache\\Valkey namespace.",
"ext-sqlite3": "Support for the Index\\Db\\Sqlite namespace."
},
"type": "library",
"autoload": {
@ -175,85 +180,7 @@
],
"description": "Composer package for the common library for my projects.",
"homepage": "https://railgun.sh/index",
"time": "2024-08-04T00:14:17+00:00"
},
{
"name": "flashwave/sasae",
"version": "v1.1.0",
"source": {
"type": "git",
"url": "https://patchii.net/flash/sasae.git",
"reference": "ad63107a4387aa35c45bce71c2d6262a15b96f9d"
},
"require": {
"flashwave/index": "^0.2408.40014",
"php": ">=8.3",
"twig/html-extra": "^3.10",
"twig/twig": "^3.10"
},
"require-dev": {
"phpstan/phpstan": "^1.11",
"phpunit/phpunit": "^11.2"
},
"type": "library",
"autoload": {
"psr-4": {
"Sasae\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"bsd-3-clause-clear"
],
"authors": [
{
"name": "flashwave",
"email": "packagist@flash.moe",
"homepage": "https://flash.moe",
"role": "mom"
}
],
"description": "A wrapper for Twig with added common functionality.",
"homepage": "https://railgun.sh/sasae",
"time": "2024-08-04T00:48:17+00:00"
},
{
"name": "flashwave/syokuhou",
"version": "v1.2.0",
"source": {
"type": "git",
"url": "https://patchii.net/flash/syokuhou.git",
"reference": "129a46c0d917382f9bc195cce278be51984eb87d"
},
"require": {
"flashwave/index": "^0.2408.40014",
"php": ">=8.3"
},
"require-dev": {
"phpstan/phpstan": "^1.11",
"phpunit/phpunit": "^11.2"
},
"type": "library",
"autoload": {
"psr-4": {
"Syokuhou\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"bsd-3-clause-clear"
],
"authors": [
{
"name": "flashwave",
"email": "packagist@flash.moe",
"homepage": "https://flash.moe",
"role": "mom"
}
],
"description": "Configuration library for PHP.",
"homepage": "https://railgun.sh/syokuhou",
"time": "2024-08-04T01:07:23+00:00"
"time": "2024-10-05T14:10:08+00:00"
},
{
"name": "guzzlehttp/psr7",
@ -432,16 +359,16 @@
},
{
"name": "nesbot/carbon",
"version": "3.7.0",
"version": "3.8.0",
"source": {
"type": "git",
"url": "https://github.com/briannesbitt/Carbon.git",
"reference": "cb4374784c87d0a0294e8513a52eb63c0aff3139"
"reference": "bbd3eef89af8ba66a3aa7952b5439168fbcc529f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/cb4374784c87d0a0294e8513a52eb63c0aff3139",
"reference": "cb4374784c87d0a0294e8513a52eb63c0aff3139",
"url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/bbd3eef89af8ba66a3aa7952b5439168fbcc529f",
"reference": "bbd3eef89af8ba66a3aa7952b5439168fbcc529f",
"shasum": ""
},
"require": {
@ -534,7 +461,7 @@
"type": "tidelift"
}
],
"time": "2024-07-16T22:29:20+00:00"
"time": "2024-08-19T06:22:39+00:00"
},
{
"name": "psr/clock",
@ -694,16 +621,16 @@
},
{
"name": "psr/log",
"version": "3.0.0",
"version": "3.0.2",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001"
"reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001",
"reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001",
"url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3",
"shasum": ""
},
"require": {
@ -738,9 +665,9 @@
"psr-3"
],
"support": {
"source": "https://github.com/php-fig/log/tree/3.0.0"
"source": "https://github.com/php-fig/log/tree/3.0.2"
},
"time": "2021-07-14T16:46:02+00:00"
"time": "2024-09-11T13:17:53+00:00"
},
{
"name": "ralouphie/getallheaders",
@ -1024,16 +951,16 @@
},
{
"name": "sentry/sentry",
"version": "4.8.1",
"version": "4.9.0",
"source": {
"type": "git",
"url": "https://github.com/getsentry/sentry-php.git",
"reference": "61770efd8b7888e0bdd7d234f0ba67b066e47d04"
"reference": "788ec170f51ebb22f2809a1e3f78b19ccd39b70d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/getsentry/sentry-php/zipball/61770efd8b7888e0bdd7d234f0ba67b066e47d04",
"reference": "61770efd8b7888e0bdd7d234f0ba67b066e47d04",
"url": "https://api.github.com/repos/getsentry/sentry-php/zipball/788ec170f51ebb22f2809a1e3f78b19ccd39b70d",
"reference": "788ec170f51ebb22f2809a1e3f78b19ccd39b70d",
"shasum": ""
},
"require": {
@ -1097,7 +1024,7 @@
],
"support": {
"issues": "https://github.com/getsentry/sentry-php/issues",
"source": "https://github.com/getsentry/sentry-php/tree/4.8.1"
"source": "https://github.com/getsentry/sentry-php/tree/4.9.0"
},
"funding": [
{
@ -1109,7 +1036,7 @@
"type": "custom"
}
],
"time": "2024-07-16T13:45:27+00:00"
"time": "2024-08-08T14:40:50+00:00"
},
{
"name": "symfony/clock",
@ -1254,16 +1181,16 @@
},
{
"name": "symfony/mime",
"version": "v7.1.2",
"version": "v7.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/mime.git",
"reference": "26a00b85477e69a4bab63b66c5dce64f18b0cbfc"
"reference": "711d2e167e8ce65b05aea6b258c449671cdd38ff"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/mime/zipball/26a00b85477e69a4bab63b66c5dce64f18b0cbfc",
"reference": "26a00b85477e69a4bab63b66c5dce64f18b0cbfc",
"url": "https://api.github.com/repos/symfony/mime/zipball/711d2e167e8ce65b05aea6b258c449671cdd38ff",
"reference": "711d2e167e8ce65b05aea6b258c449671cdd38ff",
"shasum": ""
},
"require": {
@ -1318,7 +1245,7 @@
"mime-type"
],
"support": {
"source": "https://github.com/symfony/mime/tree/v7.1.2"
"source": "https://github.com/symfony/mime/tree/v7.1.5"
},
"funding": [
{
@ -1334,7 +1261,7 @@
"type": "tidelift"
}
],
"time": "2024-06-28T10:03:55+00:00"
"time": "2024-09-20T08:28:38+00:00"
},
{
"name": "symfony/options-resolver",
@ -1405,20 +1332,20 @@
},
{
"name": "symfony/polyfill-ctype",
"version": "v1.30.0",
"version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-ctype.git",
"reference": "0424dff1c58f028c451efff2045f5d92410bd540"
"reference": "a3cc8b044a6ea513310cbd48ef7333b384945638"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540",
"reference": "0424dff1c58f028c451efff2045f5d92410bd540",
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638",
"reference": "a3cc8b044a6ea513310cbd48ef7333b384945638",
"shasum": ""
},
"require": {
"php": ">=7.1"
"php": ">=7.2"
},
"provide": {
"ext-ctype": "*"
@ -1464,7 +1391,7 @@
"portable"
],
"support": {
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0"
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0"
},
"funding": [
{
@ -1480,26 +1407,25 @@
"type": "tidelift"
}
],
"time": "2024-05-31T15:07:36+00:00"
"time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-intl-idn",
"version": "v1.30.0",
"version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-idn.git",
"reference": "a6e83bdeb3c84391d1dfe16f42e40727ce524a5c"
"reference": "c36586dcf89a12315939e00ec9b4474adcb1d773"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a6e83bdeb3c84391d1dfe16f42e40727ce524a5c",
"reference": "a6e83bdeb3c84391d1dfe16f42e40727ce524a5c",
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/c36586dcf89a12315939e00ec9b4474adcb1d773",
"reference": "c36586dcf89a12315939e00ec9b4474adcb1d773",
"shasum": ""
},
"require": {
"php": ">=7.1",
"symfony/polyfill-intl-normalizer": "^1.10",
"symfony/polyfill-php72": "^1.10"
"php": ">=7.2",
"symfony/polyfill-intl-normalizer": "^1.10"
},
"suggest": {
"ext-intl": "For best performance"
@ -1548,7 +1474,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.30.0"
"source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.31.0"
},
"funding": [
{
@ -1564,24 +1490,24 @@
"type": "tidelift"
}
],
"time": "2024-05-31T15:07:36+00:00"
"time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-intl-normalizer",
"version": "v1.30.0",
"version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-intl-normalizer.git",
"reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb"
"reference": "3833d7255cc303546435cb650316bff708a1c75c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb",
"reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb",
"url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c",
"reference": "3833d7255cc303546435cb650316bff708a1c75c",
"shasum": ""
},
"require": {
"php": ">=7.1"
"php": ">=7.2"
},
"suggest": {
"ext-intl": "For best performance"
@ -1629,7 +1555,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0"
"source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0"
},
"funding": [
{
@ -1645,24 +1571,24 @@
"type": "tidelift"
}
],
"time": "2024-05-31T15:07:36+00:00"
"time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-mbstring",
"version": "v1.30.0",
"version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
"reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c"
"reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c",
"reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c",
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341",
"reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341",
"shasum": ""
},
"require": {
"php": ">=7.1"
"php": ">=7.2"
},
"provide": {
"ext-mbstring": "*"
@ -1709,7 +1635,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0"
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0"
},
"funding": [
{
@ -1725,24 +1651,24 @@
"type": "tidelift"
}
],
"time": "2024-06-19T12:30:46+00:00"
"time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-php72",
"version": "v1.30.0",
"name": "symfony/polyfill-php81",
"version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php72.git",
"reference": "10112722600777e02d2745716b70c5db4ca70442"
"url": "https://github.com/symfony/polyfill-php81.git",
"reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/10112722600777e02d2745716b70c5db4ca70442",
"reference": "10112722600777e02d2745716b70c5db4ca70442",
"url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
"reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c",
"shasum": ""
},
"require": {
"php": ">=7.1"
"php": ">=7.2"
},
"type": "library",
"extra": {
@ -1756,80 +1682,7 @@
"bootstrap.php"
],
"psr-4": {
"Symfony\\Polyfill\\Php72\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
"polyfill",
"portable",
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php72/tree/v1.30.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": "2024-06-19T12:30:46+00:00"
},
{
"name": "symfony/polyfill-php80",
"version": "v1.30.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php80.git",
"reference": "77fa7995ac1b21ab60769b7323d600a991a90433"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433",
"reference": "77fa7995ac1b21ab60769b7323d600a991a90433",
"shasum": ""
},
"require": {
"php": ">=7.1"
},
"type": "library",
"extra": {
"thanks": {
"name": "symfony/polyfill",
"url": "https://github.com/symfony/polyfill"
}
},
"autoload": {
"files": [
"bootstrap.php"
],
"psr-4": {
"Symfony\\Polyfill\\Php80\\": ""
"Symfony\\Polyfill\\Php81\\": ""
},
"classmap": [
"Resources/stubs"
@ -1840,10 +1693,6 @@
"MIT"
],
"authors": [
{
"name": "Ion Bazan",
"email": "ion.bazan@gmail.com"
},
{
"name": "Nicolas Grekas",
"email": "p@tchwork.com"
@ -1853,7 +1702,7 @@
"homepage": "https://symfony.com/contributors"
}
],
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
"description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions",
"homepage": "https://symfony.com",
"keywords": [
"compatibility",
@ -1862,7 +1711,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0"
"source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0"
},
"funding": [
{
@ -1878,24 +1727,24 @@
"type": "tidelift"
}
],
"time": "2024-05-31T15:07:36+00:00"
"time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/polyfill-php83",
"version": "v1.30.0",
"version": "v1.31.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php83.git",
"reference": "dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9"
"reference": "2fb86d65e2d424369ad2905e83b236a8805ba491"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9",
"reference": "dbdcdf1a4dcc2743591f1079d0c35ab1e2dcbbc9",
"url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/2fb86d65e2d424369ad2905e83b236a8805ba491",
"reference": "2fb86d65e2d424369ad2905e83b236a8805ba491",
"shasum": ""
},
"require": {
"php": ">=7.1"
"php": ">=7.2"
},
"type": "library",
"extra": {
@ -1938,7 +1787,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php83/tree/v1.30.0"
"source": "https://github.com/symfony/polyfill-php83/tree/v1.31.0"
},
"funding": [
{
@ -1954,20 +1803,20 @@
"type": "tidelift"
}
],
"time": "2024-06-19T12:35:24+00:00"
"time": "2024-09-09T11:45:10+00:00"
},
{
"name": "symfony/translation",
"version": "v7.1.3",
"version": "v7.1.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "8d5e50c813ba2859a6dfc99a0765c550507934a1"
"reference": "235535e3f84f3dfbdbde0208ede6ca75c3a489ea"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/8d5e50c813ba2859a6dfc99a0765c550507934a1",
"reference": "8d5e50c813ba2859a6dfc99a0765c550507934a1",
"url": "https://api.github.com/repos/symfony/translation/zipball/235535e3f84f3dfbdbde0208ede6ca75c3a489ea",
"reference": "235535e3f84f3dfbdbde0208ede6ca75c3a489ea",
"shasum": ""
},
"require": {
@ -2032,7 +1881,7 @@
"description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/translation/tree/v7.1.3"
"source": "https://github.com/symfony/translation/tree/v7.1.5"
},
"funding": [
{
@ -2048,7 +1897,7 @@
"type": "tidelift"
}
],
"time": "2024-07-26T12:41:01+00:00"
"time": "2024-09-16T06:30:38+00:00"
},
{
"name": "symfony/translation-contracts",
@ -2130,23 +1979,23 @@
},
{
"name": "twig/html-extra",
"version": "v3.10.0",
"version": "v3.13.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/html-extra.git",
"reference": "1c045fc28ace0dcaf464f8e0d4e2aca6347d5fda"
"reference": "8229e750091171c1f11801a525927811c7ac5a7e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/html-extra/zipball/1c045fc28ace0dcaf464f8e0d4e2aca6347d5fda",
"reference": "1c045fc28ace0dcaf464f8e0d4e2aca6347d5fda",
"url": "https://api.github.com/repos/twigphp/html-extra/zipball/8229e750091171c1f11801a525927811c7ac5a7e",
"reference": "8229e750091171c1f11801a525927811c7ac5a7e",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"php": ">=8.0.2",
"symfony/deprecation-contracts": "^2.5|^3",
"symfony/mime": "^5.4|^6.4|^7.0",
"twig/twig": "^3.0"
"twig/twig": "^3.13|^4.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^6.4|^7.0"
@ -2182,7 +2031,7 @@
"twig"
],
"support": {
"source": "https://github.com/twigphp/html-extra/tree/v3.10.0"
"source": "https://github.com/twigphp/html-extra/tree/v3.13.0"
},
"funding": [
{
@ -2194,28 +2043,28 @@
"type": "tidelift"
}
],
"time": "2024-05-11T07:35:57+00:00"
"time": "2024-09-03T13:08:40+00:00"
},
{
"name": "twig/twig",
"version": "v3.10.3",
"version": "v3.14.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "67f29781ffafa520b0bbfbd8384674b42db04572"
"reference": "126b2c97818dbff0cdf3fbfc881aedb3d40aae72"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/67f29781ffafa520b0bbfbd8384674b42db04572",
"reference": "67f29781ffafa520b0bbfbd8384674b42db04572",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/126b2c97818dbff0cdf3fbfc881aedb3d40aae72",
"reference": "126b2c97818dbff0cdf3fbfc881aedb3d40aae72",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"php": ">=8.0.2",
"symfony/deprecation-contracts": "^2.5|^3",
"symfony/polyfill-ctype": "^1.8",
"symfony/polyfill-mbstring": "^1.3",
"symfony/polyfill-php80": "^1.22"
"symfony/polyfill-php81": "^1.29"
},
"require-dev": {
"psr/container": "^1.0|^2.0",
@ -2261,7 +2110,7 @@
],
"support": {
"issues": "https://github.com/twigphp/Twig/issues",
"source": "https://github.com/twigphp/Twig/tree/v3.10.3"
"source": "https://github.com/twigphp/Twig/tree/v3.14.0"
},
"funding": [
{
@ -2273,7 +2122,7 @@
"type": "tidelift"
}
],
"time": "2024-05-16T10:04:27+00:00"
"time": "2024-09-09T17:55:12+00:00"
}
],
"packages-dev": [],

View file

@ -1,9 +1,9 @@
<?php
use Index\Data\IDbConnection;
use Index\Data\Migration\IDbMigration;
use Index\Db\DbConnection;
use Index\Db\Migration\DbMigration;
final class ExistingStructure_20230816_161818 implements IDbMigration {
public function migrate(IDbConnection $conn): void {
final class ExistingStructure_20230816_161818 implements DbMigration {
public function migrate(DbConnection $conn): void {
$hasWhiteList2020 = false;
$hasWhiteList2022 = false;

View file

@ -1,9 +1,9 @@
<?php
use Index\Data\IDbConnection;
use Index\Data\Migration\IDbMigration;
use Index\Db\DbConnection;
use Index\Db\Migration\DbMigration;
final class CreateServersTable_20230817_001507 implements IDbMigration {
public function migrate(IDbConnection $conn): void {
final class CreateServersTable_20230817_001507 implements DbMigration {
public function migrate(DbConnection $conn): void {
$conn->execute('
CREATE TABLE servers (
server_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,

View file

@ -1,9 +1,9 @@
<?php
use Index\Data\IDbConnection;
use Index\Data\Migration\IDbMigration;
use Index\Db\DbConnection;
use Index\Db\Migration\DbMigration;
final class CreateNewTables_20230822_231052 implements IDbMigration {
public function migrate(IDbConnection $conn): void {
final class CreateNewTables_20230822_231052 implements DbMigration {
public function migrate(DbConnection $conn): void {
$conn->execute('
CREATE TABLE verifications (
verify_code BINARY(10) NOT NULL,

View file

@ -1,9 +1,9 @@
<?php
use Index\Data\IDbConnection;
use Index\Data\Migration\IDbMigration;
use Index\Db\DbConnection;
use Index\Db\Migration\DbMigration;
final class RemoveWhitelistTables_20230823_233728 implements IDbMigration {
public function migrate(IDbConnection $conn): void {
final class RemoveWhitelistTables_20230823_233728 implements DbMigration {
public function migrate(DbConnection $conn): void {
$conn->execute('DROP TABLE whitelist');
$conn->execute('DROP TABLE whitelist_2022');
}

View file

@ -1,8 +1,8 @@
<?php
namespace Mince;
use Index\Data\DbTools;
use Syokuhou\SharpConfig;
use Index\Config\Fs\FsConfig;
use Index\Db\DbTools;
define('MCR_STARTUP', microtime(true));
define('MCR_ROOT', __DIR__);
@ -19,7 +19,7 @@ error_reporting(MCR_DEBUG ? -1 : 0);
mb_internal_encoding('UTF-8');
date_default_timezone_set('GMT');
$cfg = SharpConfig::fromFile(MCR_ROOT . '/mince.cfg');
$cfg = FsConfig::fromFile(MCR_ROOT . '/mince.cfg');
if($cfg->hasValues('sentry:dsn'))
(function($cfg) {

View file

@ -1,9 +1,10 @@
<?php
namespace Mince;
use Index\CSRFP;
use Index\CsrfToken;
use Index\Http\Routing\HttpRouter;
use Sasae\SasaeEnvironment;
use Index\Templating\TplEnvironment;
use Index\Urls\ArrayUrlRegistry;
require_once __DIR__ . '/../mince.php';
@ -17,12 +18,12 @@ if($authInfo->success) {
$userInfo = $users->getUser($authInfo->user_id);
} else $userInfo = null;
$csrfp = new CSRFP(
$csrfp = new CsrfToken(
$cfg->getString('csrfp:secret', 'wowof'),
$authInfo->success ? $authToken : $_SERVER['REMOTE_ADDR']
);
$templating = new SasaeEnvironment(MCR_DIR_TPL, ['Mince'], debug: MCR_DEBUG);
$templating = new TplEnvironment(MCR_DIR_TPL, ['Mince'], debug: MCR_DEBUG);
$templating->addGlobal('globals', [
'title' => 'Flashii Minecraft Servers',
'is_authed' => $userInfo !== null,
@ -36,13 +37,25 @@ $authorisations->prune();
$verifications = new Verifications($db);
$verifications->prune();
$urls = new ArrayUrlRegistry;
$templating->addFunction('url', $urls->format(...));
$router = new HttpRouter(errorHandler: new RouterErrorHandler($templating));
$router->use('/', function($response, $request) { $response->setPoweredBy('Mince'); });
$router->register(new RpcRoutes($users, $accountLinks, $authorisations, $verifications, $cfg->getString('rpc:secret'), $cfg->getString('urls:clients')));
$router->register(new HomeRoutes($templating, new Servers($db), $authInfo, $cfg->getString('site:login')));
$router->register(new ClientsRoutes($templating, $accountLinks, $authorisations, $verifications, $csrfp, $authInfo));
$router->register(new SkinsRoutes($templating, $accountLinks, new Skins($db), new Capes($db), $csrfp, $authInfo, $cfg->getString('urls:skins_base')));
$homeRoutes = new HomeRoutes($templating, $urls, new Servers($db), $authInfo, $cfg->getString('site:login'));
$router->register($homeRoutes);
$urls->register($homeRoutes);
$clientRoutes = new ClientsRoutes($templating, $urls, $accountLinks, $authorisations, $verifications, $csrfp, $authInfo);
$router->register($clientRoutes);
$urls->register($clientRoutes);
$skinsRoutes = new SkinsRoutes($templating, $urls, $accountLinks, new Skins($db), new Capes($db), $csrfp, $authInfo, $cfg->getString('urls:skins_base'));
$router->register($skinsRoutes);
$urls->register($skinsRoutes);
MojangInterop::registerRoutes($router);

View file

@ -2,7 +2,7 @@
namespace Mince;
use Carbon\CarbonImmutable;
use Index\Data\IDbResult;
use Index\Db\DbResult;
use Ramsey\Uuid\{Uuid,UuidInterface};
class AccountLinkInfo {
@ -13,7 +13,7 @@ class AccountLinkInfo {
private int $created
) {}
public static function fromResult(IDbResult $result): self {
public static function fromResult(DbResult $result): self {
return new AccountLinkInfo(
userId: $result->getString(0),
uuid: $result->getString(1),

View file

@ -3,13 +3,13 @@ namespace Mince;
use InvalidArgumentException;
use RuntimeException;
use Index\Data\{DbStatementCache,IDbConnection};
use Index\Db\{DbConnection,DbStatementCache};
use Ramsey\Uuid\UuidInterface;
class AccountLinks {
private DbStatementCache $cache;
public function __construct(IDbConnection $dbConn) {
public function __construct(DbConnection $dbConn) {
$this->cache = new DbStatementCache($dbConn);
}

View file

@ -2,8 +2,7 @@
namespace Mince;
use Carbon\CarbonImmutable;
use Index\Data\IDbResult;
use Index\Net\IPAddress;
use Index\Db\DbResult;
use Ramsey\Uuid\{Uuid,UuidInterface};
class AuthorisationInfo {
@ -16,7 +15,7 @@ class AuthorisationInfo {
private ?int $used,
) {}
public static function fromResult(IDbResult $result): self {
public static function fromResult(DbResult $result): self {
return new AuthorisationInfo(
id: $result->getString(0),
uuid: $result->getString(1),
@ -39,14 +38,10 @@ class AuthorisationInfo {
return Uuid::fromBytes($this->uuid);
}
public function getAddressRaw(): string {
public function getAddress(): string {
return $this->addr;
}
public function getAddress(): IPAddress {
return IPAddress::parse($this->addr);
}
public function getRequestedTime(): int {
return $this->requested;
}

View file

@ -3,15 +3,14 @@ namespace Mince;
use InvalidArgumentException;
use RuntimeException;
use Index\Data\{DbStatementCache,IDbConnection};
use Index\Net\IPAddress;
use Index\Db\{DbConnection,DbStatementCache};
use Ramsey\Uuid\UuidInterface;
class Authorisations {
private IDbConnection $dbConn;
private DbConnection $dbConn;
private DbStatementCache $cache;
public function __construct(IDbConnection $dbConn) {
public function __construct(DbConnection $dbConn) {
$this->dbConn = $dbConn;
$this->cache = new DbStatementCache($dbConn);
}
@ -38,7 +37,7 @@ class Authorisations {
public function getAuthorisation(
?string $authId = null,
AccountLinkInfo|UuidInterface|string|null $uuid = null,
IPAddress|string|null $remoteAddr = null
?string $remoteAddr = null
): AuthorisationInfo {
$hasAuthId = $authId !== null;
$hasUuid = $uuid !== null;
@ -64,9 +63,6 @@ class Authorisations {
}
if($hasRemoteAddr) {
if($remoteAddr instanceof IPAddress)
$remoteAddr = (string)$remoteAddr;
$query .= sprintf(' %s auth_addr = INET6_ATON(?)', ++$args > 1 ? 'AND' : 'WHERE');
$values[] = $remoteAddr;
}
@ -90,7 +86,7 @@ class Authorisations {
public function createAuthorisation(
AccountLinkInfo|VerificationInfo|UuidInterface|string $uuid,
IPAddress|string|null $remoteAddr = null,
?string $remoteAddr = null,
bool $grant = false
): void {
if($uuid instanceof VerificationInfo) {
@ -104,8 +100,6 @@ class Authorisations {
$uuid = $uuid->getUUIDRaw();
elseif($uuid instanceof UuidInterface)
$uuid = $uuid->getBytes();
if($remoteAddr instanceof IPAddress)
$remoteAddr = (string)$remoteAddr;
}
$stmt = $this->cache->get(sprintf(

View file

@ -2,7 +2,7 @@
namespace Mince;
use Carbon\CarbonImmutable;
use Index\Data\IDbResult;
use Index\Db\DbResult;
class CapeInfo {
public function __construct(
@ -11,7 +11,7 @@ class CapeInfo {
private int $updated,
) {}
public static function fromResult(IDbResult $result): self {
public static function fromResult(DbResult $result): self {
return new CapeInfo(
userId: $result->getString(0),
hash: $result->getString(1),

View file

@ -3,12 +3,12 @@ namespace Mince;
use InvalidArgumentException;
use RuntimeException;
use Index\Data\{DbStatementCache,IDbConnection};
use Index\Db\{DbConnection,DbStatementCache};
class Capes {
private DbStatementCache $cache;
public function __construct(IDbConnection $dbConn) {
public function __construct(DbConnection $dbConn) {
$this->cache = new DbStatementCache($dbConn);
}

View file

@ -2,10 +2,10 @@
namespace Mince;
use stdClass;
use Syokuhou\IConfig;
use Index\Config\Config;
final class ChatAuth {
public static function attempt(IConfig $config, string $cookie): object {
public static function attempt(Config $config, string $cookie): object {
if(!empty($cookie)) {
$method = 'Misuzu';
$signature = sprintf('verify#%s#%s#%s', $method, $cookie, $_SERVER['REMOTE_ADDR']);

View file

@ -3,18 +3,22 @@ namespace Mince;
use InvalidArgumentException;
use RuntimeException;
use Index\CSRFP;
use Index\Http\Routing\{RouteHandler,HttpGet,HttpMiddleware,HttpPost};
use Index\CsrfToken;
use Index\Http\Routing\{HttpGet,HttpMiddleware,HttpPost,RouteHandler,RouteHandlerTrait};
use Index\Templating\TplEnvironment;
use Index\Urls\{UrlFormat,UrlRegistry,UrlSource,UrlSourceTrait};
use Ramsey\Uuid\Uuid;
use Sasae\SasaeEnvironment;
class ClientsRoutes extends RouteHandler {
class ClientsRoutes implements RouteHandler, UrlSource {
use RouteHandlerTrait, UrlSourceTrait;
public function __construct(
private SasaeEnvironment $templating,
private TplEnvironment $templating,
private UrlRegistry $urls,
private AccountLinks $accountLinks,
private Authorisations $authorisations,
private Verifications $verifications,
private CSRFP $csrfp,
private CsrfToken $csrfp,
private object $authInfo
) {}
@ -42,6 +46,7 @@ class ClientsRoutes extends RouteHandler {
];
#[HttpGet('/clients')]
#[UrlFormat('clients:index', '/clients', ['error' => '<error>'])]
public function getClients($response, $request) {
$template = $this->templating->load('clients/index');
@ -74,16 +79,17 @@ class ClientsRoutes extends RouteHandler {
}
#[HttpPost('/clients/link')]
#[UrlFormat('clients:link', '/clients/link')]
public function postLink($response, $request) {
if($this->accountLinks->checkHasLink($this->authInfo->user_id)) {
$response->redirect('/clients?error=link:already');
$response->redirect($this->urls->format('clients:index', ['error' => 'link:already']));
return;
}
$body = $request->getContent();
$code = (string)$body->getParam('code');
if(strlen($code) !== 10) {
$response->redirect('/clients?error=link:format');
$response->redirect($this->urls->format('clients:index', ['error' => 'link:format']));
return;
}
@ -92,7 +98,7 @@ class ClientsRoutes extends RouteHandler {
try {
$verifyInfo = $this->verifications->getVerification(code: $code);
} catch(RuntimeException $ex) {
$response->redirect('/clients?error=link:code');
$response->redirect($this->urls->format('clients:index', ['error' => 'link:code']));
return;
}
@ -100,16 +106,18 @@ class ClientsRoutes extends RouteHandler {
$this->accountLinks->createLink($this->authInfo->user_id, $verifyInfo);
$this->authorisations->createAuthorisation($verifyInfo, grant: true);
$response->redirect('/clients');
$response->redirect($this->urls->format('clients:index'));
}
#[HttpPost('/clients/unlink')]
#[UrlFormat('clients:unlink', '/clients/unlink')]
public function postUnlink($response) {
$this->accountLinks->deleteLink(userInfo: $this->authInfo->user_id);
$response->redirect('/clients');
$response->redirect($this->urls->format('clients:index'));
}
#[HttpPost('/clients/authorise')]
#[UrlFormat('clients:authorise', '/clients/authorise')]
public function postAuthorise($response, $request) {
$body = $request->getContent();
$authId = (string)$body->getParam('auth');
@ -135,10 +143,11 @@ class ClientsRoutes extends RouteHandler {
$this->authorisations->setAuthorisationGranted($authInfo);
$response->redirect('/clients');
$response->redirect($this->urls->format('clients:index'));
}
#[HttpPost('/clients/deauthorise')]
#[UrlFormat('clients:deauthorise', '/clients/deauthorise')]
public function postDeauthorise($response, $request) {
$body = $request->getContent();
$authId = (string)$body->getParam('auth');
@ -168,6 +177,6 @@ class ClientsRoutes extends RouteHandler {
$this->authorisations->deleteAuthorisations(authInfo: $authInfo);
}
$response->redirect('/clients');
$response->redirect($this->urls->format('clients:index'));
}
}

View file

@ -1,18 +1,23 @@
<?php
namespace Mince;
use Index\Http\Routing\{HttpGet,RouteHandler};
use Sasae\SasaeEnvironment;
use Index\Http\Routing\{HttpGet,RouteHandler,RouteHandlerTrait};
use Index\Urls\{UrlFormat,UrlRegistry,UrlSource,UrlSourceTrait};
use Index\Templating\TplEnvironment;
class HomeRoutes implements RouteHandler, UrlSource {
use RouteHandlerTrait, UrlSourceTrait;
class HomeRoutes extends RouteHandler {
public function __construct(
private SasaeEnvironment $templating,
private TplEnvironment $templating,
private UrlRegistry $urls,
private Servers $servers,
private object $userInfo,
private string $loginUrl
) {}
#[HttpGet('/')]
#[UrlFormat('index', '/')]
public function getIndex($response, $request) {
return $this->templating->render('index', [
'servers' => iterator_to_array($this->servers->getServers(deleted: false)),
@ -20,22 +25,25 @@ class HomeRoutes extends RouteHandler {
}
#[HttpGet('/login')]
#[UrlFormat('login', '/login')]
public function getLogin($response) {
$response->redirect($this->userInfo->success ? '/' : $this->loginUrl);
$response->redirect($this->userInfo->success ? $this->urls->format('index') : $this->loginUrl);
}
#[HttpGet('/downloads')]
#[UrlFormat('downloads', '/downloads')]
public function getDownloads() {
return $this->templating->render('downloads');
}
#[HttpGet('/guide')]
#[UrlFormat('guide', '/guide')]
public function getGuide() {
return $this->templating->render('guide');
}
#[HttpGet('/index.php')]
public function getRedirect($response) {
$response->redirect('/', true);
$response->redirect($this->urls->format('index'), true);
}
}

View file

@ -3,7 +3,7 @@ namespace Mince;
use stdClass;
use Index\Http\{HttpResponseBuilder,HttpRequest};
use Index\Http\Routing\IRouter;
use Index\Http\Routing\Router;
use Ramsey\Uuid\{Uuid,UuidInterface};
final class MojangInterop {
@ -33,7 +33,7 @@ final class MojangInterop {
return $uuid->getVersion() === 4;
}
public static function registerRoutes(IRouter $router): void {
public static function registerRoutes(Router $router): void {
$router->get('/uuid', fn($response, $request) => self::uuidResolver($response, $request));
$router->get('/blockedservers', fn($response, $request) => self::proxyBlockServers($response, $request));
}

View file

@ -1,13 +1,12 @@
<?php
namespace Mince;
use Index\Http\{HttpResponseBuilder,HttpRequest};
use Index\Http\ErrorHandling\IErrorHandler;
use Sasae\SasaeEnvironment;
use Index\Http\{HttpErrorHandler,HttpResponseBuilder,HttpRequest};
use Index\Templating\TplEnvironment;
class RouterErrorHandler implements IErrorHandler {
class RouterErrorHandler implements HttpErrorHandler {
public function __construct(
private SasaeEnvironment $templating
private TplEnvironment $templating
) {}
public function handle(HttpResponseBuilder $response, HttpRequest $request, int $code, string $message): void {

View file

@ -5,10 +5,12 @@ use stdClass;
use InvalidArgumentException;
use RuntimeException;
use Stringable;
use Index\Http\Routing\{HttpMiddleware,HttpPost,RouteHandler};
use Index\Http\Routing\{HttpMiddleware,HttpPost,RouteHandler,RouteHandlerTrait};
use Ramsey\Uuid\Uuid;
class RpcRoutes extends RouteHandler {
class RpcRoutes implements RouteHandler {
use RouteHandlerTrait;
public function __construct(
private Users $users,
private AccountLinks $accountLinks,

View file

@ -2,7 +2,7 @@
namespace Mince;
use Carbon\CarbonImmutable;
use Index\Data\IDbResult;
use Index\Db\DbResult;
class ServerInfo {
public function __construct(
@ -17,7 +17,7 @@ class ServerInfo {
private ?int $deleted,
) {}
public static function fromResult(IDbResult $result): self {
public static function fromResult(DbResult $result): self {
return new ServerInfo(
id: $result->getString(0),
name: $result->getString(1),

View file

@ -1,14 +1,12 @@
<?php
namespace Mince;
use Index\Data\{DbStatementCache,IDbConnection};
use Index\Db\{DbConnection,DbStatementCache};
class Servers {
//private IDbConnection $dbConn;
private DbStatementCache $cache;
public function __construct(IDbConnection $dbConn) {
//$this->dbConn = $dbConn;
public function __construct(DbConnection $dbConn) {
$this->cache = new DbStatementCache($dbConn);
}

View file

@ -2,7 +2,7 @@
namespace Mince;
use Carbon\CarbonImmutable;
use Index\Data\IDbResult;
use Index\Db\DbResult;
class SkinInfo {
public function __construct(
@ -12,7 +12,7 @@ class SkinInfo {
private int $updated,
) {}
public static function fromResult(IDbResult $result): self {
public static function fromResult(DbResult $result): self {
return new SkinInfo(
userId: $result->getString(0),
hash: $result->getString(1),

View file

@ -3,14 +3,14 @@ namespace Mince;
use InvalidArgumentException;
use RuntimeException;
use Index\Data\{DbStatementCache,IDbConnection};
use Index\Db\{DbConnection,DbStatementCache};
class Skins {
public const MODELS = ['classic', 'slim'];
private DbStatementCache $cache;
public function __construct(IDbConnection $dbConn) {
public function __construct(DbConnection $dbConn) {
$this->cache = new DbStatementCache($dbConn);
}

View file

@ -6,23 +6,27 @@ use ImagickException;
use ImagickPixel;
use InvalidArgumentException;
use RuntimeException;
use Index\{CSRFP,XString};
use Index\Http\Routing\{RouteHandler,HttpGet,HttpMiddleware,HttpPost};
use Index\{CsrfToken,XString};
use Index\Http\Routing\{HttpGet,HttpMiddleware,HttpPost,RouteHandler,RouteHandlerTrait};
use Index\Templating\TplEnvironment;
use Index\Urls\{UrlFormat,UrlRegistry,UrlSource,UrlSourceTrait};
use Ramsey\Uuid\{Uuid,UuidInterface};
use Sasae\SasaeEnvironment;
class SkinsRoutes extends RouteHandler {
class SkinsRoutes implements RouteHandler, UrlSource {
use RouteHandlerTrait, UrlSourceTrait;
private const TEXTURES_DIR = '/textures';
private const TEXTURES_PATH = MCR_DIR_PUB . self::TEXTURES_DIR;
private AccountLinkInfo $linkInfo;
public function __construct(
private SasaeEnvironment $templating,
private TplEnvironment $templating,
private UrlRegistry $urls,
private AccountLinks $accountLinks,
private Skins $skins,
private Capes $capes,
private CSRFP $csrfp,
private CsrfToken $csrfp,
private object $authInfo,
private string $baseUrl
) {
@ -59,7 +63,7 @@ class SkinsRoutes extends RouteHandler {
try {
$this->linkInfo = $this->accountLinks->getLink(userInfo: $this->authInfo->user_id);
} catch(RuntimeException $ex) {
$response->redirect('/clients');
$response->redirect($this->urls->format('clients:index'));
return true;
}
@ -86,6 +90,7 @@ class SkinsRoutes extends RouteHandler {
];
#[HttpGet('/skins')]
#[UrlFormat('skins:index', '/skins', ['error' => '<error>'])]
public function getSkins($response, $request) {
$skinInfo = $this->skins->getSkin($this->linkInfo);
$skinPath = $skinInfo === null ? null : $this->getRemotePath($skinInfo->getHash(), false);
@ -119,6 +124,7 @@ class SkinsRoutes extends RouteHandler {
}
#[HttpPost('/skins/upload-skin')]
#[UrlFormat('skins:skin:upload', '/skins/upload-skin')]
public function postUploadSkin($response, $request) {
$body = $request->getContent();
if(!$body->hasUploadedFile('texture'))
@ -128,12 +134,12 @@ class SkinsRoutes extends RouteHandler {
$model = (string)$body->getParam('model');
if(!in_array($model, Skins::MODELS)) {
$response->redirect('/skins?error=skin:model');
$response->redirect($this->urls->format('skins:index', ['error' => 'skin:model']));
return;
}
if($texture->getSize() > 512000) {
$response->redirect('/skins?error=skin:size');
$response->redirect($this->urls->format('skins:index', ['error' => 'skin:size']));
return;
}
@ -151,7 +157,7 @@ class SkinsRoutes extends RouteHandler {
$imagick->writeImage();
$imagick->destroy();
} catch(ImagickException $ex) {
$response->redirect('/skins?error=skin:format');
$response->redirect($this->urls->format('skins:index', ['error' => 'skin:format']));
return;
}
@ -178,10 +184,11 @@ class SkinsRoutes extends RouteHandler {
$this->deleteLocalFileMaybe($hash);
}
$response->redirect('/skins');
$response->redirect($this->urls->format('skins:index'));
}
#[HttpPost('/skins/delete-skin')]
#[UrlFormat('skins:skin:delete', '/skins/delete-skin')]
public function postDeleteSkin($response) {
$skinInfo = $this->skins->getSkin($this->linkInfo);
if($skinInfo !== null) {
@ -189,10 +196,11 @@ class SkinsRoutes extends RouteHandler {
$this->deleteLocalFileMaybe($skinInfo->getHash());
}
$response->redirect('/skins');
$response->redirect($this->urls->format('skins:index'));
}
#[HttpPost('/skins/upload-cape')]
#[UrlFormat('skins:cape:upload', '/skins/upload-cape')]
public function postUploadCape($response, $request) {
$body = $request->getContent();
if(!$body->hasUploadedFile('texture'))
@ -200,7 +208,7 @@ class SkinsRoutes extends RouteHandler {
$texture = $body->getUploadedFile('texture');
if($texture->getSize() > 256000) {
$response->redirect('/skins?error=cape:size');
$response->redirect($this->urls->format('skins:index', ['error' => 'cape:size']));
return;
}
@ -215,7 +223,7 @@ class SkinsRoutes extends RouteHandler {
$imagick->writeImage();
$imagick->destroy();
} catch(ImagickException $ex) {
$response->redirect('/skins?error=cape:format');
$response->redirect($this->urls->format('skins:index', ['error' => 'cape:format']));
return;
}
@ -241,10 +249,11 @@ class SkinsRoutes extends RouteHandler {
$this->deleteLocalFileMaybe($hash);
}
$response->redirect('/skins');
$response->redirect($this->urls->format('skins:index'));
}
#[HttpPost('/skins/delete-cape')]
#[UrlFormat('skins:cape:delete', '/skins/delete-cape')]
public function postDeleteCape($response) {
$capeInfo = $this->capes->getCape($this->linkInfo);
if($capeInfo !== null) {
@ -252,10 +261,11 @@ class SkinsRoutes extends RouteHandler {
$this->deleteLocalFileMaybe($capeInfo->getHash());
}
$response->redirect('/skins');
$response->redirect($this->urls->format('skins:index'));
}
#[HttpPost('/skins/import')]
#[UrlFormat('skins:import', '/skins/import')]
public function postImport($response, $request) {
$body = $request->getContent();
$userAgent = $request->getHeaderLine('User-Agent');
@ -322,7 +332,7 @@ class SkinsRoutes extends RouteHandler {
}
}
$response->redirect('/skins');
$response->redirect($this->urls->format('skins:index'));
}
private function getProfileInfo(UuidInterface $uuid, bool $includeProfileActions) {

View file

@ -1,8 +1,8 @@
<?php
namespace Mince;
use Index\Colour\{Colour,ColourRGB};
use Index\Data\IDbResult;
use Index\Colour\{Colour,ColourRgb};
use Index\Db\DbResult;
class UserInfo {
public function __construct(
@ -11,7 +11,7 @@ class UserInfo {
private ?int $colour,
) {}
public static function fromResult(IDbResult $result): self {
public static function fromResult(DbResult $result): self {
return new UserInfo(
id: $result->getString(0),
name: $result->getString(1),
@ -36,6 +36,6 @@ class UserInfo {
}
public function getColour(): Colour {
return $this->colour === null ? Colour::none() : ColourRGB::fromRawRGB($this->colour);
return $this->colour === null ? Colour::none() : ColourRgb::fromRawRGB($this->colour);
}
}

View file

@ -2,12 +2,12 @@
namespace Mince;
use RuntimeException;
use Index\Data\{DbStatementCache,IDbConnection};
use Index\Db\{DbConnection,DbStatementCache};
class Users {
private DbStatementCache $cache;
public function __construct(IDbConnection $dbConn) {
public function __construct(DbConnection $dbConn) {
$this->cache = new DbStatementCache($dbConn);
}

View file

@ -2,8 +2,7 @@
namespace Mince;
use Carbon\CarbonImmutable;
use Index\Data\IDbResult;
use Index\Net\IPAddress;
use Index\Db\DbResult;
use Ramsey\Uuid\{Uuid,UuidInterface};
class VerificationInfo {
@ -15,7 +14,7 @@ class VerificationInfo {
private int $created,
) {}
public static function fromResult(IDbResult $result): self {
public static function fromResult(DbResult $result): self {
return new VerificationInfo(
code: $result->getString(0),
uuid: $result->getString(1),
@ -41,14 +40,10 @@ class VerificationInfo {
return $this->name;
}
public function getAddressRaw(): string {
public function getAddress(): string {
return $this->addr;
}
public function getAddress(): IPAddress {
return IPAddress::parse($this->addr);
}
public function getCreatedTime(): int {
return $this->created;
}

View file

@ -4,17 +4,16 @@ namespace Mince;
use InvalidArgumentException;
use RuntimeException;
use Index\XString;
use Index\Data\{DbStatementCache,IDbConnection};
use Index\Net\IPAddress;
use Index\Db\{DbConnection,DbStatementCache};
use Ramsey\Uuid\UuidInterface;
class Verifications {
private const CODE_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567';
private IDbConnection $dbConn;
private DbConnection $dbConn;
private DbStatementCache $cache;
public function __construct(IDbConnection $dbConn) {
public function __construct(DbConnection $dbConn) {
$this->dbConn = $dbConn;
$this->cache = new DbStatementCache($dbConn);
}
@ -30,7 +29,7 @@ class Verifications {
public function getVerification(
?string $code = null,
UuidInterface|string|null $uuid = null,
IPAddress|string|null $remoteAddr = null
?string $remoteAddr = null
): VerificationInfo {
$hasCode = $code !== null;
$hasUuid = $uuid !== null;
@ -54,9 +53,6 @@ class Verifications {
}
if($hasRemoteAddr) {
if($remoteAddr instanceof IPAddress)
$remoteAddr = (string)$remoteAddr;
$query .= sprintf(' %s verify_addr = INET6_ATON(?)', ++$args > 1 ? 'AND' : 'WHERE');
$values[] = $remoteAddr;
}
@ -81,12 +77,10 @@ class Verifications {
public function createVerification(
UuidInterface|string $uuid,
string $name,
IPAddress|string $remoteAddr
string $remoteAddr
): string {
if($uuid instanceof UuidInterface)
$uuid = $uuid->getBytes();
if($remoteAddr instanceof IPAddress)
$remoteAddr = (string)$remoteAddr;
$code = self::generateCode();

View file

@ -17,7 +17,7 @@
<p style="color: red;">{{ error.message }}</p>
{% endif %}
<form method="post" action="/clients/link">
<form method="post" action="{{ url('clients:link') }}">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<label>
<div class="label-header">Link code</div>
@ -69,13 +69,13 @@
</td>
<td class="actions">
{% if client.isPending %}
<form method="post" action="/clients/authorise">
<form method="post" action="{{ url('clients:authorise') }}">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<input type="hidden" name="auth" value="{{ client.id }}">
<input class="action action-authorise js-authorise-button" type="submit" value="Approve" disabled onclick="return confirm('Are you sure?');">
</form>
{% endif %}
<form method="post" action="/clients/deauthorise">
<form method="post" action="{{ url('clients:deauthorise') }}">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<input type="hidden" name="auth" value="{{ client.id }}">
<input class="action action-deauthorise" type="submit" value="{% if client.isPending %}Deny{% else %}Deauthorise{% endif %}">
@ -92,7 +92,7 @@
<div class="section accmegadeauth">
<h2>Crowd Control</h2>
<p>Provided for those who prefer the nuclear option. Pressing the first button will deauthorise all clients, the other one will only remove pending ones.</p>
<form method="post" action="/clients/deauthorise">
<form method="post" action="{{ url('clients:deauthorise') }}">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<button class="form-btn-red" name="auth" value="all">Deauthorise all clients</button>
<button class="form-btn-green" name="auth" value="pending">Deny pending clients</button>
@ -103,7 +103,7 @@
<h2>Linked Minecraft account</h2>
<p>This is the Minecraft account currently associated with your Flashii ID. Revoking revoke your access to the servers. <strong>If you're planning on changing your username, please keep in mind that your stats and inventory on the servers WILL NOT carry over automatically.</strong></p>
<p>Your account has been linked with <b>{{ link.name }}</b> since <b>{{ link.createdTime|date('Y-m-d H:i:s T') }}</b>.</p>
<form method="post" action="/clients/unlink">
<form method="post" action="{{ url('clients:unlink') }}">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<input type="submit" value="Unlink account">
</form>

View file

@ -21,7 +21,7 @@
<div class="section downloads-item">
<h2>MultiMC/PolyMC/Prism Launcher spoofed accounts file</h2>
<p>This file is used in the <a href="/guide">guide</a> to allow you to add an Offline account of your own.</p>
<p>This file is used in the <a href="{{ url('guide') }}">guide</a> to allow you to add an Offline account of your own.</p>
<ul>
<li><a href="/dl/accounts.json" download>Download accounts.json</a></li>

View file

@ -94,7 +94,7 @@
<p>Press the <strong>Add Instance</strong> button on the top left.</p>
<p>
Under <strong>Custom</strong> make sure the version the server you want to connect to is currently running is selected.
The versions of the servers are listing on the <a href="/">home page</a> along with their addresses for your convenience.
The versions of the servers are listing on the <a href="{{ url('index') }}">home page</a> along with their addresses for your convenience.
</p>
<p>If you plan on using our client side mod, select <strong>Fabric</strong> under <strong>Mod Loader</strong> and just pick whatever the latest version is, which is also what should be selected by default.</p>
<p>When you've done those things, press OK.</p>
@ -104,7 +104,7 @@
<div class="section" id="gac5">
<h3><a href="#gac5">Step 5. Installing the Flashii Extensions client side mod (Optional)</a></h3>
<p>
You can download the Flashii Extensions mod from the <a href="/downloads">downloads page</a>, the latest version of the mod is the first thing linked in the list.
You can download the Flashii Extensions mod from the <a href="{{ url('downloads') }}">downloads page</a>, the latest version of the mod is the first thing linked in the list.
Save it anywhere you like as long as you remember where you saved it.
</p>
<p>
@ -124,7 +124,7 @@
<div class="section" id="ctos">
<h2><a href="#ctos">Connecting to a server</a></h2>
<p>We're assuming you've already picked a server to play from from the <a href="/">home page</a> and have added it to your server list.</p>
<p>We're assuming you've already picked a server to play from from the <a href="{{ url('index') }}">home page</a> and have added it to your server list.</p>
</div>
<div class="section" id="ctos1">

View file

@ -35,7 +35,11 @@
<div class="section">
<h2>Authentication and Skins</h2>
<p>Because of the deprecation of Mojang/Minecraft accounts and the general distrust in Microsoft's ability to not suspend your account for no reason, our servers run in offline mode with an authentication plugin. This means you can play the game with any username you want without logging in with a Microsoft account in your launcher, so long as someone else isn't already using that name. You don't have to install any mods on your client for the authentication side of things to work, in order to be able to see skins of other players you'll need to install a mod though. You can grab the mod through the <a href="/downloads">downloads</a> page and if you're not sure what to do you can follow the <a href="/guide">guide</a> page!</p>
<p>
Because of the deprecation of Mojang/Minecraft accounts and the general distrust in Microsoft's ability to not suspend your account for no reason, our servers run in offline mode with an authentication plugin.
This means you can play the game with any username you want without logging in with a Microsoft account in your launcher, so long as someone else isn't already using that name.
You don't have to install any mods on your client for the authentication side of things to work, in order to be able to see skins of other players you'll need to install a mod though.
You can grab the mod through the <a href="{{ url('downloads') }}">downloads</a> page and if you're not sure what to do you can follow the <a href="{{ url('guide') }}">guide</a> page!</p>
</div>
{#

View file

@ -14,19 +14,19 @@
<a href="/"><img src="/assets/weblogo.png" alt="Flashii Minecraft"></a>
</div>
<div class="header-menu">
<a href="/">Home</a>
<a href="/downloads">Downloads</a>
<a href="/guide">Guide</a>
<a href="{{ url('index') }}">Home</a>
<a href="{{ url('downloads') }}">Downloads</a>
<a href="{{ url('guide') }}">Guide</a>
{% if globals.is_authed %}
<a href="/clients">Clients</a>
<a href="/skins">Skins</a>
<a href="{{ url('clients:index') }}">Clients</a>
<a href="{{ url('skins:index') }}">Skins</a>
{% endif %}
</div>
<div class="header-user">
{% if globals.is_authed %}
Logged in as <span style="color: {{ globals.user.colour }}">{{ globals.user.name }}</span>
{% else %}
<a href="/login">Log in</a>
<a href="{{ url('login') }}">Log in</a>
{% endif %}
</div>
</div>

View file

@ -5,7 +5,7 @@
{% block content %}
<div class="section skins-header">
<h1>Skins</h1>
<p>Because our servers run in offline mode with our own authentication plugin, skins are downloaded from Mojang's servers. To make up for this we also have a client side mod that substitutes the skin and cape server with our own. You can find the mod on the <a href="/downloads">downloads page</a>. Please keep your textures clean.</p>
<p>Because our servers run in offline mode with our own authentication plugin, skins are downloaded from Mojang's servers. To make up for this we also have a client side mod that substitutes the skin and cape server with our own. You can find the mod on the <a href="{{ url('downloads') }}">downloads page</a>. Please keep your textures clean.</p>
</div>
<div class="section skin">
@ -17,7 +17,7 @@
{% endif %}
<div class="skins-form">
<form method="post" action="/skins/upload-skin" enctype="multipart/form-data">
<form method="post" action="{{ url('skins:skin:upload') }}" enctype="multipart/form-data">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<input type="file" name="texture">
<select name="model">
@ -28,7 +28,7 @@
<input type="submit" value="Upload Skin" class="skins-form-upload">
</form>
{% if skin is not null %}
<form method="post" action="/skins/delete-skin">
<form method="post" action="{{ url('skins:skin:delete') }}">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<input type="submit" value="Delete Skin" class="skins-form-delete">
</form>
@ -51,13 +51,13 @@
{% endif %}
<div class="skins-form">
<form method="post" action="/skins/upload-cape" enctype="multipart/form-data">
<form method="post" action="{{ url('skins:cape:upload') }}" enctype="multipart/form-data">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<input type="file" name="texture">
<input type="submit" value="Upload Cape" class="skins-form-upload">
</form>
{% if cape is not null %}
<form method="post" action="/skins/delete-cape">
<form method="post" action="{{ url('skins:cape:delete') }}">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<input type="submit" value="Delete Cape" class="skins-form-delete">
</form>
@ -74,7 +74,7 @@
<div class="section skinimport">
<h2>Import from Mojang account</h2>
<p>Import skin and cape textures from a Mojang Minecraft account. If you linked the same username as your actual Minecraft account, you can just press Import without anything.</p>
<form method="post" action="/skins/import">
<form method="post" action="{{ url('skins:import') }}">
<input type="hidden" name="csrfp" value="{{ globals.csrfp }}">
<label>
<div class="label-header">Minecraft Username</div>

View file

@ -1,7 +1,6 @@
#!/usr/bin/env php
<?php
use Index\Data\Migration\DbMigrationManager;
use Index\Data\Migration\FsDbMigrationRepo;
use Index\Db\Migration\{DbMigrationManager,FsDbMigrationRepo};
require_once __DIR__ . '/../mince.php';

View file

@ -1,7 +1,6 @@
#!/usr/bin/env php
<?php
use Index\Data\Migration\DbMigrationManager;
use Index\Data\Migration\FsDbMigrationRepo;
use Index\Db\Migration\DbMigrationManager;
require_once __DIR__ . '/../mince.php';