Updated Index library in Seria.
This commit is contained in:
parent
be44b474e7
commit
9025435dff
37 changed files with 291 additions and 404 deletions
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"require": {
|
||||
"flashwave/index": "^0.2408.40014",
|
||||
"flashwave/sasae": "^1.1",
|
||||
"flashwave/syokuhou": "^1.2",
|
||||
"flashwave/index": "^0.2410",
|
||||
"erusev/parsedown": "~1.6",
|
||||
"sentry/sdk": "^4.0"
|
||||
},
|
||||
|
|
333
composer.lock
generated
333
composer.lock
generated
|
@ -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": "a825e4d5e3378939f2eb894d05add96f",
|
||||
"content-hash": "0fcc2129a9e1c99597116e91c7bb2df1",
|
||||
"packages": [
|
||||
{
|
||||
"name": "erusev/parsedown",
|
||||
|
@ -58,23 +58,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": {
|
||||
|
@ -96,85 +101,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",
|
||||
|
@ -461,16 +388,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": {
|
||||
|
@ -505,9 +432,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",
|
||||
|
@ -610,16 +537,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": {
|
||||
|
@ -683,7 +610,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": [
|
||||
{
|
||||
|
@ -695,7 +622,7 @@
|
|||
"type": "custom"
|
||||
}
|
||||
],
|
||||
"time": "2024-07-16T13:45:27+00:00"
|
||||
"time": "2024-08-08T14:40:50+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
|
@ -766,16 +693,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": {
|
||||
|
@ -830,7 +757,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": [
|
||||
{
|
||||
|
@ -846,7 +773,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-06-28T10:03:55+00:00"
|
||||
"time": "2024-09-20T08:28:38+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/options-resolver",
|
||||
|
@ -917,20 +844,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": "*"
|
||||
|
@ -976,7 +903,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": [
|
||||
{
|
||||
|
@ -992,26 +919,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"
|
||||
|
@ -1060,7 +986,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": [
|
||||
{
|
||||
|
@ -1076,24 +1002,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"
|
||||
|
@ -1141,7 +1067,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": [
|
||||
{
|
||||
|
@ -1157,24 +1083,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": "*"
|
||||
|
@ -1221,7 +1147,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": [
|
||||
{
|
||||
|
@ -1237,24 +1163,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": {
|
||||
|
@ -1268,80 +1194,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"
|
||||
|
@ -1352,10 +1205,6 @@
|
|||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ion Bazan",
|
||||
"email": "ion.bazan@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
|
@ -1365,7 +1214,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",
|
||||
|
@ -1374,7 +1223,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": [
|
||||
{
|
||||
|
@ -1390,27 +1239,27 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-05-31T15:07:36+00:00"
|
||||
"time": "2024-09-09T11:45:10+00:00"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
|
@ -1446,7 +1295,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": [
|
||||
{
|
||||
|
@ -1458,28 +1307,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",
|
||||
|
@ -1525,7 +1374,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": [
|
||||
{
|
||||
|
@ -1537,22 +1386,22 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-05-16T10:04:27+00:00"
|
||||
"time": "2024-09-09T17:55:12+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "phpstan/phpstan",
|
||||
"version": "1.11.9",
|
||||
"version": "1.12.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpstan/phpstan.git",
|
||||
"reference": "e370bcddadaede0c1716338b262346f40d296f82"
|
||||
"reference": "7e6c6cb7cecb0a6254009a1a8a7d54ec99812b17"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/e370bcddadaede0c1716338b262346f40d296f82",
|
||||
"reference": "e370bcddadaede0c1716338b262346f40d296f82",
|
||||
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/7e6c6cb7cecb0a6254009a1a8a7d54ec99812b17",
|
||||
"reference": "7e6c6cb7cecb0a6254009a1a8a7d54ec99812b17",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -1597,7 +1446,7 @@
|
|||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2024-08-01T16:25:18+00:00"
|
||||
"time": "2024-09-26T12:45:22+00:00"
|
||||
}
|
||||
],
|
||||
"aliases": [],
|
||||
|
|
|
@ -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_20230915_233145 implements IDbMigration {
|
||||
public function migrate(IDbConnection $conn): void {
|
||||
final class ExistingStructure_20230915_233145 implements DbMigration {
|
||||
public function migrate(DbConnection $conn): void {
|
||||
$hasTorrents = false;
|
||||
$hasTorrentsFiles = false;
|
||||
$hasTorrentsPeers = false;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?php
|
||||
namespace Seria;
|
||||
|
||||
use Index\Data\DbTools;
|
||||
use Syokuhou\SharpConfig;
|
||||
use Index\Config\Fs\FsConfig;
|
||||
use Index\Db\DbTools;
|
||||
|
||||
define('SERIA_STARTUP', microtime(true));
|
||||
define('SERIA_ROOT', __DIR__);
|
||||
|
@ -17,7 +17,7 @@ error_reporting(SERIA_DEBUG ? -1 : 0);
|
|||
mb_internal_encoding('UTF-8');
|
||||
date_default_timezone_set('GMT');
|
||||
|
||||
$cfg = SharpConfig::fromFile(SERIA_ROOT . '/seria.cfg');
|
||||
$cfg = FsConfig::fromFile(SERIA_ROOT . '/seria.cfg');
|
||||
|
||||
if($cfg->hasValues('sentry:dsn'))
|
||||
(function($cfg) {
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
namespace Seria\Auth;
|
||||
|
||||
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']);
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace Seria;
|
|||
|
||||
use Index\XNumber;
|
||||
use Index\Colour\Colour;
|
||||
use Index\Colour\ColourRGB;
|
||||
use Index\Colour\ColourRgb;
|
||||
|
||||
final class Colours {
|
||||
public const RATIO_GOOD = 0x008000;
|
||||
|
@ -55,6 +55,6 @@ final class Colours {
|
|||
public static function cached(int $raw): Colour {
|
||||
if(array_key_exists($raw, self::$colourCache))
|
||||
return self::$colourCache[$raw];
|
||||
return self::$colourCache[$raw] = ColourRGB::fromRawRGB($raw);
|
||||
return self::$colourCache[$raw] = ColourRgb::fromRawRgb($raw);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
<?php
|
||||
namespace Seria;
|
||||
|
||||
use Index\Http\Routing\{HttpGet,RouteHandler};
|
||||
use Sasae\SasaeEnvironment;
|
||||
use Index\Http\Routing\{HttpGet,RouteHandler,RouteHandlerTrait};
|
||||
use Index\Templating\TplEnvironment;
|
||||
|
||||
class HomeRoutes implements RouteHandler {
|
||||
use RouteHandlerTrait;
|
||||
|
||||
class HomeRoutes extends RouteHandler {
|
||||
public function __construct(
|
||||
private ?SasaeEnvironment $templating
|
||||
private ?TplEnvironment $templating
|
||||
) {}
|
||||
|
||||
#[HttpGet('/')]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
namespace Seria;
|
||||
|
||||
use Index\Http\Routing\{HttpRouter,IRouter,IRouteHandler};
|
||||
use Index\Http\Routing\{HttpRouter,Router,RouteHandler};
|
||||
|
||||
class RoutingContext {
|
||||
private HttpRouter $router;
|
||||
|
@ -12,11 +12,11 @@ class RoutingContext {
|
|||
$this->router->registerContentHandler(new StringableContentHandler); // this should really be in Index lol but i can't be bothered rn!
|
||||
}
|
||||
|
||||
public function getRouter(): IRouter {
|
||||
public function getRouter(): Router {
|
||||
return $this->router;
|
||||
}
|
||||
|
||||
public function register(IRouteHandler $handler): void {
|
||||
public function register(RouteHandler $handler): void {
|
||||
$this->router->register($handler);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
<?php
|
||||
namespace Seria;
|
||||
|
||||
use Index\Http\{HttpResponseBuilder,HttpRequest};
|
||||
use Index\Http\ErrorHandling\IErrorHandler;
|
||||
use Index\Http\{HttpErrorHandler,HttpResponseBuilder,HttpRequest};
|
||||
|
||||
class RoutingErrorHandler implements IErrorHandler {
|
||||
class RoutingErrorHandler implements HttpErrorHandler {
|
||||
public function __construct(
|
||||
private SeriaContext $context
|
||||
) {}
|
||||
|
|
|
@ -2,29 +2,29 @@
|
|||
namespace Seria;
|
||||
|
||||
use InvalidArgumentException;
|
||||
use Index\CSRFP;
|
||||
use Index\Data\IDbTransactions;
|
||||
use Index\Data\Migration\{IDbMigrationRepo,DbMigrationManager,FsDbMigrationRepo};
|
||||
use Sasae\SasaeEnvironment;
|
||||
use Syokuhou\IConfig;
|
||||
use Index\CsrfToken;
|
||||
use Index\Config\Config;
|
||||
use Index\Db\DbTransactions;
|
||||
use Index\Db\Migration\{DbMigrationManager,DbMigrationRepo,FsDbMigrationRepo};
|
||||
use Index\Templating\TplEnvironment;
|
||||
use Seria\Auth\AuthInfo;
|
||||
use Seria\Torrents\TorrentsContext;
|
||||
use Seria\Users\UsersContext;
|
||||
|
||||
final class SeriaContext {
|
||||
private IDbTransactions $dbConn;
|
||||
private IConfig $config;
|
||||
private ?SasaeEnvironment $templating = null;
|
||||
private DbTransactions $dbConn;
|
||||
private Config $config;
|
||||
private ?TplEnvironment $templating = null;
|
||||
|
||||
private AuthInfo $authInfo;
|
||||
private SiteInfo $siteInfo;
|
||||
|
||||
private CSRFP $csrfp;
|
||||
private CsrfToken $csrfp;
|
||||
|
||||
private TorrentsContext $torrentsCtx;
|
||||
private UsersContext $usersCtx;
|
||||
|
||||
public function __construct(IDbTransactions $dbConn, IConfig $config) {
|
||||
public function __construct(DbTransactions $dbConn, Config $config) {
|
||||
$this->dbConn = $dbConn;
|
||||
$this->config = $config;
|
||||
|
||||
|
@ -35,7 +35,7 @@ final class SeriaContext {
|
|||
$this->usersCtx = new UsersContext($dbConn);
|
||||
}
|
||||
|
||||
public function getDbConn(): IDbTransactions {
|
||||
public function getDbConn(): DbTransactions {
|
||||
return $this->dbConn;
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ final class SeriaContext {
|
|||
return new DbMigrationManager($this->dbConn, 'ser_' . DbMigrationManager::DEFAULT_TABLE);
|
||||
}
|
||||
|
||||
public function createMigrationRepo(): IDbMigrationRepo {
|
||||
public function createMigrationRepo(): DbMigrationRepo {
|
||||
return new FsDbMigrationRepo(SERIA_DIR_MIGRATIONS);
|
||||
}
|
||||
|
||||
|
@ -68,16 +68,16 @@ final class SeriaContext {
|
|||
return $this->usersCtx;
|
||||
}
|
||||
|
||||
public function getTemplating(): ?SasaeEnvironment {
|
||||
public function getTemplating(): ?TplEnvironment {
|
||||
return $this->templating;
|
||||
}
|
||||
|
||||
public function getCSRFP(): CSRFP {
|
||||
public function getCSRFP(): CsrfToken {
|
||||
return $this->csrfp;
|
||||
}
|
||||
|
||||
public function startCSRFP(string $secretKey, string $identity): void {
|
||||
$this->csrfp = new CSRFP($secretKey, $identity);
|
||||
$this->csrfp = new CsrfToken($secretKey, $identity);
|
||||
}
|
||||
|
||||
public function startTemplating(): void {
|
||||
|
@ -87,12 +87,12 @@ final class SeriaContext {
|
|||
'display_timings_info' => SERIA_DEBUG, // + isFlash
|
||||
];
|
||||
|
||||
$this->templating = new SasaeEnvironment(
|
||||
$this->templating = new TplEnvironment(
|
||||
SERIA_DIR_TEMPLATES,
|
||||
cache: SERIA_DEBUG ? null : ['Seria', GitInfo::hash(true)],
|
||||
debug: SERIA_DEBUG,
|
||||
);
|
||||
$this->templating->addExtension(new SeriaSasaeExtension($this, $this->siteInfo));
|
||||
$this->templating->addExtension(new TemplatingExtension($this, $this->siteInfo));
|
||||
$this->templating->addGlobal('globals', $globals);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
namespace Seria;
|
||||
|
||||
use Syokuhou\IConfig;
|
||||
use Index\Config\Config;
|
||||
use Seria\Users\UserInfo;
|
||||
|
||||
class SiteInfo {
|
||||
public function __construct(private IConfig $config) {}
|
||||
public function __construct(private Config $config) {}
|
||||
|
||||
public function getName(): string {
|
||||
return $this->config->getString('name');
|
||||
|
|
|
@ -2,17 +2,15 @@
|
|||
namespace Seria;
|
||||
|
||||
use Stringable;
|
||||
use Index\Http\HttpResponseBuilder;
|
||||
use Index\Http\Content\StringContent;
|
||||
use Index\Http\ContentHandling\IContentHandler;
|
||||
use Index\Http\{HttpContentHandler,HttpResponseBuilder,StringHttpContent};
|
||||
|
||||
class StringableContentHandler implements IContentHandler {
|
||||
class StringableContentHandler implements HttpContentHandler {
|
||||
public function match(mixed $content): bool {
|
||||
return $content instanceof Stringable;
|
||||
}
|
||||
|
||||
/** @param Stringable $content */
|
||||
public function handle(HttpResponseBuilder $response, mixed $content): void {
|
||||
$response->setContent(new StringContent((string)$content));
|
||||
$response->setContent(new StringHttpContent((string)$content));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ use Twig\Extension\AbstractExtension;
|
|||
use Twig\TwigFunction;
|
||||
use Seria\Torrents\TorrentPeers;
|
||||
|
||||
final class SeriaSasaeExtension extends AbstractExtension {
|
||||
final class TemplatingExtension extends AbstractExtension {
|
||||
private TorrentPeers $peers;
|
||||
|
||||
public function __construct(
|
|
@ -1,20 +1,37 @@
|
|||
<?php
|
||||
namespace Seria\Torrents;
|
||||
|
||||
use Index\Bencode\IBencodeSerialisable;
|
||||
use Index\Bencode\{BencodeProperty,BencodeSerializable,BencodeSerializableTrait};
|
||||
|
||||
class AnnounceEmpty implements BencodeSerializable {
|
||||
use BencodeSerializableTrait;
|
||||
|
||||
class AnnounceEmpty implements IBencodeSerialisable {
|
||||
public function __construct(
|
||||
private bool $compactPeers
|
||||
) {}
|
||||
|
||||
public function bencodeSerialise(): mixed {
|
||||
return [
|
||||
'interval' => 0,
|
||||
'min interval' => 0,
|
||||
'complete' => 0,
|
||||
'incomplete' => 0,
|
||||
'peers' => $this->compactPeers ? '' : [],
|
||||
];
|
||||
#[BencodeProperty('interval')]
|
||||
public function getInterval(): int {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#[BencodeProperty('min interval')]
|
||||
public function getMinimumInterval(): int {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#[BencodeProperty('complete')]
|
||||
public function getComplete(): int {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#[BencodeProperty('incomplete')]
|
||||
public function getIncomplete(): int {
|
||||
return 0;
|
||||
}
|
||||
|
||||
#[BencodeProperty('peers')]
|
||||
public function getIncomplete(): string|array {
|
||||
return $this->compactPeers ? '' : [];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
<?php
|
||||
namespace Seria\Torrents;
|
||||
|
||||
use Index\Bencode\IBencodeSerialisable;
|
||||
use Index\Bencode\{BencodeProperty,BencodeSerializable,BencodeSerializableTrait};
|
||||
|
||||
class AnnounceFailure implements BencodeSerializable {
|
||||
use BencodeSerializableTrait;
|
||||
|
||||
class AnnounceFailure implements IBencodeSerialisable {
|
||||
public function __construct(private string $reason) {}
|
||||
|
||||
public function bencodeSerialise(): mixed {
|
||||
return ['failure reason' => $this->reason];
|
||||
#[BencodeProperty('failure reason')]
|
||||
public function getReason(): string {
|
||||
return $this->reason;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
<?php
|
||||
namespace Seria\Torrents;
|
||||
|
||||
use Index\Bencode\IBencodeSerialisable;
|
||||
use Index\Bencode\{BencodeProperty,BencodeSerializable,BencodeSerializableTrait};
|
||||
|
||||
class AnnounceInfo implements BencodeSerializable {
|
||||
use BencodeSerializableTrait;
|
||||
|
||||
class AnnounceInfo implements IBencodeSerialisable {
|
||||
// todo: keep these in a field in ser_torrents so we don't need this slightly filthy hack anymore
|
||||
// also useful for ipv6 peer support
|
||||
private int $completePeers = 0;
|
||||
|
@ -53,25 +55,44 @@ class AnnounceInfo implements IBencodeSerialisable {
|
|||
return $peers;
|
||||
}
|
||||
|
||||
public function createPeersList(): array|string {
|
||||
#[BencodeProperty('interval')]
|
||||
public function getInterval(): int {
|
||||
return $this->interval;
|
||||
}
|
||||
|
||||
#[BencodeProperty('min interval')]
|
||||
public function getMinimumInterval(): int {
|
||||
return $this->minInterval;
|
||||
}
|
||||
|
||||
#[BencodeProperty('complete')]
|
||||
public function getComplete(): int {
|
||||
return $this->completePeers;
|
||||
}
|
||||
|
||||
#[BencodeProperty('incomplete')]
|
||||
public function getIncomplete(): int {
|
||||
return $this->incompletePeers;
|
||||
}
|
||||
|
||||
// #[BencodeProperty('downloaded')]
|
||||
// public function getDownloaded(): int {
|
||||
// return 0; // todo: keep track of how many completes
|
||||
// }
|
||||
|
||||
#[BencodeProperty('peers')]
|
||||
public function getPeers(): string|array {
|
||||
if($this->compactPeers)
|
||||
return $this->createCompactPeersList();
|
||||
|
||||
if($this->noPeerIds)
|
||||
return $this->createPeersListWithoutIds();
|
||||
|
||||
return $this->createPeersListWithIds();
|
||||
}
|
||||
|
||||
public function bencodeSerialise(): mixed {
|
||||
$peers = $this->createPeersList();
|
||||
|
||||
return [
|
||||
'interval' => $this->interval,
|
||||
'min interval' => $this->minInterval,
|
||||
'complete' => $this->completePeers,
|
||||
'incomplete' => $this->incompletePeers,
|
||||
//'downloaded' => 0, todo: keep track of how many completes
|
||||
'peers' => $peers,
|
||||
//'peers6' => '', todo: support ipv6 someday
|
||||
];
|
||||
}
|
||||
// #[BencodeProperty('peers6')]
|
||||
// public function getPeersV6(): int {
|
||||
// return ''; // todo: support ipv6 someday
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -3,10 +3,12 @@ namespace Seria\Torrents;
|
|||
|
||||
use RuntimeException;
|
||||
use Index\Bencode\Bencode;
|
||||
use Index\Http\Routing\{HttpGet,RouteHandler};
|
||||
use Index\Http\Routing\{HttpGet,RouteHandler,RouteHandlerTrait};
|
||||
use Seria\Users\UsersContext;
|
||||
|
||||
class AnnounceRouting extends RouteHandler {
|
||||
class AnnounceRouting implements RouteHandler {
|
||||
use RouteHandlerTrait;
|
||||
|
||||
public const INTERVAL = 1800;
|
||||
public const INTERVAL_MIN = 30;
|
||||
|
||||
|
@ -20,7 +22,8 @@ class AnnounceRouting extends RouteHandler {
|
|||
#[HttpGet('/announce/([A-Za-z0-9]+)')]
|
||||
#[HttpGet('/announce.php/([A-Za-z0-9]+)')]
|
||||
public function getAnnounce($response, $request, string $key = '') {
|
||||
if(strlen(inet_pton($_SERVER['REMOTE_ADDR'])) !== 4)
|
||||
$remoteAddr = $request->getRemoteAddress();
|
||||
if(strlen(inet_pton($remoteAddr)) !== 4)
|
||||
return new AnnounceFailure('Tracker is only supported over IPv4, please reset your DNS cache.');
|
||||
|
||||
$torrents = $this->torrentsCtx->getTorrents();
|
||||
|
@ -48,8 +51,6 @@ class AnnounceRouting extends RouteHandler {
|
|||
if(strlen($peerId) !== 20)
|
||||
return new AnnounceFailure('Invalid peer id.');
|
||||
|
||||
$address = $_SERVER['REMOTE_ADDR'];
|
||||
|
||||
$port = (int)$request->getParam('port');
|
||||
if($port < 1 || $port > 0xFFFF)
|
||||
return new AnnounceFailure('Invalid port number.');
|
||||
|
@ -96,7 +97,7 @@ class AnnounceRouting extends RouteHandler {
|
|||
if($peerInfo === null) {
|
||||
// could probably skip this is the event is 'stopped'
|
||||
$peerInfo = $peers->createPeer(
|
||||
$torrentInfo, $userInfo, $peerId, $address, $port, self::INTERVAL,
|
||||
$torrentInfo, $userInfo, $peerId, $remoteAddr, $port, self::INTERVAL,
|
||||
$userAgent, $key, $bytesUploaded, $bytesDownloaded, $bytesRemaining
|
||||
);
|
||||
} else {
|
||||
|
@ -118,7 +119,7 @@ class AnnounceRouting extends RouteHandler {
|
|||
);
|
||||
|
||||
$peers->updatePeer(
|
||||
$torrentInfo, $peerInfo, $address, $port, self::INTERVAL,
|
||||
$torrentInfo, $peerInfo, $remoteAddr, $port, self::INTERVAL,
|
||||
$userAgent, $bytesUploaded, $bytesDownloaded, $bytesRemaining
|
||||
);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ use Exception;
|
|||
use InvalidArgumentException;
|
||||
use RuntimeException;
|
||||
use Index\Bencode\Bencode;
|
||||
use Index\Data\{DbTools,IDbTransactions};
|
||||
use Index\Db\{DbTools,DbTransactions};
|
||||
use Seria\Users\UserInfo;
|
||||
|
||||
class TorrentBuilder {
|
||||
|
@ -101,7 +101,7 @@ class TorrentBuilder {
|
|||
return hash('sha1', Bencode::encode($info), true);
|
||||
}
|
||||
|
||||
public function create(IDbTransactions $dbConn, TorrentsContext $torrentsCtx): string {
|
||||
public function create(DbTransactions $dbConn, TorrentsContext $torrentsCtx): string {
|
||||
$torrents = $torrentsCtx->getTorrents();
|
||||
$pieces = $torrentsCtx->getPieces();
|
||||
$files = $torrentsCtx->getFiles();
|
||||
|
|
|
@ -3,20 +3,22 @@ namespace Seria\Torrents;
|
|||
|
||||
use Exception;
|
||||
use RuntimeException;
|
||||
use Index\CSRFP;
|
||||
use Index\Data\IDbTransactions;
|
||||
use Index\Http\Routing\{HttpGet,HttpMiddleware,HttpPost,RouteHandler};
|
||||
use Sasae\SasaeEnvironment;
|
||||
use Index\CsrfToken;
|
||||
use Index\Db\DbTransactions;
|
||||
use Index\Http\Routing\{HttpGet,HttpMiddleware,HttpPost,RouteHandler,RouteHandlerTrait};
|
||||
use Index\Templating\TplEnvironment;
|
||||
use Seria\Auth\AuthInfo;
|
||||
use Seria\Users\UsersContext;
|
||||
|
||||
class TorrentCreateRouting extends RouteHandler {
|
||||
class TorrentCreateRouting implements RouteHandler {
|
||||
use RouteHandlerTrait;
|
||||
|
||||
public function __construct(
|
||||
private IDbTransactions $dbConn,
|
||||
private DbTransactions $dbConn,
|
||||
private AuthInfo $authInfo,
|
||||
private TorrentsContext $torrentsCtx,
|
||||
private CSRFP $csrfp,
|
||||
private ?SasaeEnvironment $templating
|
||||
private CsrfToken $csrfp,
|
||||
private ?TplEnvironment $templating
|
||||
) {}
|
||||
|
||||
#[HttpMiddleware('/create')]
|
||||
|
|
|
@ -1,16 +1,18 @@
|
|||
<?php
|
||||
namespace Seria\Torrents;
|
||||
|
||||
use Index\Bencode\IBencodeSerialisable;
|
||||
use Index\Data\IDbResult;
|
||||
use Index\Bencode\{BencodeProperty,BencodeSerializable,BencodeSerializableTrait};
|
||||
use Index\Db\DbResult;
|
||||
|
||||
readonly class TorrentFileInfo implements BencodeSerializable {
|
||||
use BencodeSerializableTrait;
|
||||
|
||||
readonly class TorrentFileInfo implements IBencodeSerialisable {
|
||||
private string $id;
|
||||
private string $torrentId;
|
||||
private int $length;
|
||||
private string $path;
|
||||
|
||||
public function __construct(IDbResult $result) {
|
||||
public function __construct(DbResult $result) {
|
||||
$this->id = $result->getString(0);
|
||||
$this->torrentId = $result->getString(1);
|
||||
$this->length = $result->getInteger(2);
|
||||
|
@ -25,6 +27,7 @@ readonly class TorrentFileInfo implements IBencodeSerialisable {
|
|||
return $this->torrentId;
|
||||
}
|
||||
|
||||
#[BencodeProperty('length')]
|
||||
public function getLength(): int {
|
||||
return $this->length;
|
||||
}
|
||||
|
@ -33,10 +36,8 @@ readonly class TorrentFileInfo implements IBencodeSerialisable {
|
|||
return $this->path;
|
||||
}
|
||||
|
||||
public function bencodeSerialise(): mixed {
|
||||
return [
|
||||
'length' => $this->length,
|
||||
'path' => explode('/', $this->path),
|
||||
];
|
||||
#[BencodeProperty('path')]
|
||||
public function getPathArray(): array {
|
||||
return explode('/', $this->path);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,13 +3,12 @@ namespace Seria\Torrents;
|
|||
|
||||
use InvalidArgumentException;
|
||||
use RuntimeException;
|
||||
use Index\Data\DbStatementCache;
|
||||
use Index\Data\IDbConnection;
|
||||
use Index\Db\{DbConnection,DbStatementCache};
|
||||
|
||||
class TorrentFiles {
|
||||
private DbStatementCache $cache;
|
||||
|
||||
public function __construct(IDbConnection $dbConn) {
|
||||
public function __construct(DbConnection $dbConn) {
|
||||
$this->cache = new DbStatementCache($dbConn);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
namespace Seria\Torrents;
|
||||
|
||||
use Index\Data\IDbResult;
|
||||
use Index\Db\DbResult;
|
||||
|
||||
readonly class TorrentInfo {
|
||||
private string $id;
|
||||
|
@ -15,7 +15,7 @@ readonly class TorrentInfo {
|
|||
private int $private;
|
||||
private string $comment;
|
||||
|
||||
public function __construct(IDbResult $result) {
|
||||
public function __construct(DbResult $result) {
|
||||
$this->id = $result->getString(0);
|
||||
$this->userId = $result->isNull(1) ? null : $result->getString(1);
|
||||
$this->infoHash = $result->getString(2);
|
||||
|
|
|
@ -2,23 +2,25 @@
|
|||
namespace Seria\Torrents;
|
||||
|
||||
use RuntimeException;
|
||||
use Index\CSRFP;
|
||||
use Index\Http\Routing\{HttpGet,HttpMiddleware,HttpPost,RouteHandler};
|
||||
use Sasae\SasaeEnvironment;
|
||||
use Syokuhou\IConfig;
|
||||
use Index\CsrfToken;
|
||||
use Index\Config\Config;
|
||||
use Index\Http\Routing\{HttpGet,HttpMiddleware,HttpPost,RouteHandler,RouteHandlerTrait};
|
||||
use Index\Templating\TplEnvironment;
|
||||
use Seria\Auth\AuthInfo;
|
||||
use Seria\Users\UsersContext;
|
||||
|
||||
class TorrentInfoRouting extends RouteHandler {
|
||||
class TorrentInfoRouting implements RouteHandler {
|
||||
use RouteHandlerTrait;
|
||||
|
||||
private ?TorrentInfo $torrentInfo = null;
|
||||
|
||||
public function __construct(
|
||||
private IConfig $config,
|
||||
private Config $config,
|
||||
private AuthInfo $authInfo,
|
||||
private TorrentsContext $torrentsCtx,
|
||||
private UsersContext $usersCtx,
|
||||
private CSRFP $csrfp,
|
||||
private ?SasaeEnvironment $templating
|
||||
private CsrfToken $csrfp,
|
||||
private ?TplEnvironment $templating
|
||||
) {}
|
||||
|
||||
#[HttpGet('/download/([0-9]+)')]
|
||||
|
|
|
@ -2,17 +2,19 @@
|
|||
namespace Seria\Torrents;
|
||||
|
||||
use RuntimeException;
|
||||
use Index\Http\Routing\{HttpGet,RouteHandler};
|
||||
use Sasae\SasaeEnvironment;
|
||||
use Index\Http\Routing\{HttpGet,RouteHandler,RouteHandlerTrait};
|
||||
use Index\Templating\TplEnvironment;
|
||||
use Seria\Auth\AuthInfo;
|
||||
use Seria\Users\UsersContext;
|
||||
|
||||
class TorrentListRouting extends RouteHandler {
|
||||
class TorrentListRouting implements RouteHandler {
|
||||
use RouteHandlerTrait;
|
||||
|
||||
public function __construct(
|
||||
private AuthInfo $authInfo,
|
||||
private TorrentsContext $torrentsCtx,
|
||||
private UsersContext $usersCtx,
|
||||
private ?SasaeEnvironment $templating
|
||||
private ?TplEnvironment $templating
|
||||
) {}
|
||||
|
||||
#[HttpGet('/available')]
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
namespace Seria\Torrents;
|
||||
|
||||
use Index\Data\IDbResult;
|
||||
use Index\Db\DbResult;
|
||||
use Seria\Users\UserInfo;
|
||||
|
||||
readonly class TorrentPeerInfo {
|
||||
|
@ -18,7 +18,7 @@ readonly class TorrentPeerInfo {
|
|||
private int $bytesDownloaded;
|
||||
private int $bytesLeft;
|
||||
|
||||
public function __construct(IDbResult $result) {
|
||||
public function __construct(DbResult $result) {
|
||||
$this->id = $result->getString(0);
|
||||
$this->torrentId = $result->getString(1);
|
||||
$this->userId = $result->isNull(2) ? null : $result->getString(2);
|
||||
|
|
|
@ -3,16 +3,13 @@ namespace Seria\Torrents;
|
|||
|
||||
use InvalidArgumentException;
|
||||
use RuntimeException;
|
||||
use Index\Data\DbStatementCache;
|
||||
use Index\Data\IDbConnection;
|
||||
use Index\Db\{DbConnection,DbStatementCache};
|
||||
use Seria\Users\UserInfo;
|
||||
|
||||
class TorrentPeers {
|
||||
private IDbConnection $dbConn;
|
||||
private DbStatementCache $cache;
|
||||
|
||||
public function __construct(IDbConnection $dbConn) {
|
||||
$this->dbConn = $dbConn;
|
||||
public function __construct(private DbConnection $dbConn) {
|
||||
$this->cache = new DbStatementCache($dbConn);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<?php
|
||||
namespace Seria\Torrents;
|
||||
|
||||
use Index\Data\IDbResult;
|
||||
use Index\Db\DbResult;
|
||||
|
||||
readonly class TorrentPieceInfo {
|
||||
private string $id;
|
||||
private string $torrentId;
|
||||
private string $hash;
|
||||
|
||||
public function __construct(IDbResult $result) {
|
||||
public function __construct(DbResult $result) {
|
||||
$this->id = $result->getString(0);
|
||||
$this->torrentId = $result->getString(1);
|
||||
$this->hash = $result->getString(2);
|
||||
|
|
|
@ -3,13 +3,12 @@ namespace Seria\Torrents;
|
|||
|
||||
use InvalidArgumentException;
|
||||
use RuntimeException;
|
||||
use Index\Data\DbStatementCache;
|
||||
use Index\Data\IDbConnection;
|
||||
use Index\Db\{DbConnection,DbStatementCache};
|
||||
|
||||
class TorrentPieces {
|
||||
private DbStatementCache $cache;
|
||||
|
||||
public function __construct(IDbConnection $dbConn) {
|
||||
public function __construct(DbConnection $dbConn) {
|
||||
$this->cache = new DbStatementCache($dbConn);
|
||||
}
|
||||
|
||||
|
|
|
@ -3,15 +3,13 @@ namespace Seria\Torrents;
|
|||
|
||||
use InvalidArgumentException;
|
||||
use RuntimeException;
|
||||
use Index\Data\DbStatementCache;
|
||||
use Index\Data\IDbConnection;
|
||||
use Index\Db\{DbConnection,DbStatementCache};
|
||||
use Seria\Users\UserInfo;
|
||||
|
||||
class Torrents {
|
||||
private IDbConnection $dbConn;
|
||||
private DbStatementCache $cache;
|
||||
|
||||
public function __construct(IDbConnection $dbConn) {
|
||||
public function __construct(private DbConnection $dbConn) {
|
||||
$this->dbConn = $dbConn;
|
||||
$this->cache = new DbStatementCache($dbConn);
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
namespace Seria\Torrents;
|
||||
|
||||
use Index\Bencode\Bencode;
|
||||
use Index\Data\IDbConnection;
|
||||
use Index\Db\DbConnection;
|
||||
use Seria\GitInfo;
|
||||
use Seria\Users\UserInfo;
|
||||
|
||||
|
@ -12,7 +12,7 @@ class TorrentsContext {
|
|||
private TorrentPeers $peers;
|
||||
private TorrentPieces $pieces;
|
||||
|
||||
public function __construct(IDbConnection $dbConn) {
|
||||
public function __construct(DbConnection $dbConn) {
|
||||
$this->torrents = new Torrents($dbConn);
|
||||
$this->files = new TorrentFiles($dbConn);
|
||||
$this->peers = new TorrentPeers($dbConn);
|
||||
|
|
|
@ -2,17 +2,19 @@
|
|||
namespace Seria\Users;
|
||||
|
||||
use RuntimeException;
|
||||
use Index\Http\Routing\{HttpGet,RouteHandler};
|
||||
use Sasae\SasaeEnvironment;
|
||||
use Index\Http\Routing\{HttpGet,RouteHandler,RouteHandlerTrait};
|
||||
use Index\Templating\TplEnvironment;
|
||||
use Seria\Auth\AuthInfo;
|
||||
use Seria\Torrents\{TorrentsContext,TorrentInfo,TorrentPeerInfo};
|
||||
|
||||
class ProfileRoutes extends RouteHandler {
|
||||
class ProfileRoutes implements RouteHandler {
|
||||
use RouteHandlerTrait;
|
||||
|
||||
public function __construct(
|
||||
private AuthInfo $authInfo,
|
||||
private TorrentsContext $torrentsCtx,
|
||||
private UsersContext $usersCtx,
|
||||
private ?SasaeEnvironment $templating
|
||||
private ?TplEnvironment $templating
|
||||
) {}
|
||||
|
||||
#[HttpGet('/profile/([a-zA-Z0-9\-_]+)')]
|
||||
|
|
|
@ -1,18 +1,20 @@
|
|||
<?php
|
||||
namespace Seria\Users;
|
||||
|
||||
use Index\CSRFP;
|
||||
use Index\Http\Routing\{HttpGet,HttpMiddleware,HttpPost,RouteHandler};
|
||||
use Sasae\SasaeEnvironment;
|
||||
use Index\CsrfToken;
|
||||
use Index\Http\Routing\{HttpGet,HttpMiddleware,HttpPost,RouteHandler,RouteHandlerTrait};
|
||||
use Index\Templating\TplEnvironment;
|
||||
use Seria\Auth\AuthInfo;
|
||||
use Seria\Users\UsersContext;
|
||||
|
||||
class SettingsRoutes extends RouteHandler {
|
||||
class SettingsRoutes implements RouteHandler {
|
||||
use RouteHandlerTrait;
|
||||
|
||||
public function __construct(
|
||||
private AuthInfo $authInfo,
|
||||
private UsersContext $usersCtx,
|
||||
private CSRFP $csrfp,
|
||||
private ?SasaeEnvironment $templating
|
||||
private CsrfToken $csrfp,
|
||||
private ?TplEnvironment $templating
|
||||
) {}
|
||||
|
||||
#[HttpMiddleware('/settings')]
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace Seria\Users;
|
|||
|
||||
use RuntimeException;
|
||||
use Index\Colour\Colour;
|
||||
use Index\Data\IDbResult;
|
||||
use Index\Db\DbResult;
|
||||
use Seria\Colours;
|
||||
|
||||
readonly class UserInfo {
|
||||
|
@ -16,7 +16,7 @@ readonly class UserInfo {
|
|||
private int $bytesDownloaded;
|
||||
private int $bytesUploaded;
|
||||
|
||||
public function __construct(IDbResult $result) {
|
||||
public function __construct(DbResult $result) {
|
||||
$this->id = $result->getString(0);
|
||||
$this->name = $result->getString(1);
|
||||
|
||||
|
|
|
@ -5,15 +5,12 @@ use InvalidArgumentException;
|
|||
use RuntimeException;
|
||||
use Index\XString;
|
||||
use Index\Colour\Colour;
|
||||
use Index\Data\DbStatementCache;
|
||||
use Index\Data\DbTools;
|
||||
use Index\Data\IDbConnection;
|
||||
use Index\Net\IPAddress;
|
||||
use Index\Db\{DbConnection,DbStatementCache,DbTools};
|
||||
|
||||
class Users {
|
||||
private DbStatementCache $cache;
|
||||
|
||||
public function __construct(IDbConnection $dbConn) {
|
||||
public function __construct(DbConnection $dbConn) {
|
||||
$this->cache = new DbStatementCache($dbConn);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
namespace Seria\Users;
|
||||
|
||||
use Index\Data\IDbConnection;
|
||||
use Index\Db\DbConnection;
|
||||
|
||||
class UsersContext {
|
||||
private Users $users;
|
||||
|
||||
public function __construct(IDbConnection $dbConn) {
|
||||
public function __construct(DbConnection $dbConn) {
|
||||
$this->users = new Users($dbConn);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
use Index\Data\Migration\FsDbMigrationRepo;
|
||||
|
||||
require_once __DIR__ . '/../seria.php';
|
||||
|
||||
try {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env php
|
||||
<?php
|
||||
use Index\Data\Migration\FsDbMigrationRepo;
|
||||
use Index\Db\Migration\FsDbMigrationRepo;
|
||||
|
||||
require_once __DIR__ . '/../seria.php';
|
||||
|
||||
|
|
Loading…
Reference in a new issue