1
0
Fork 0
mirror of https://codeberg.org/demostf/api.git synced 2026-06-03 18:04:08 +02:00

update flight

This commit is contained in:
Robin Appelman 2024-03-17 00:40:49 +01:00
commit ae176a65e4
7 changed files with 47 additions and 23 deletions

View file

@ -3,7 +3,7 @@
"description": "api implementation for demos.tf", "description": "api implementation for demos.tf",
"license": "MIT", "license": "MIT",
"require": { "require": {
"mikecao/flight": "1.3.8", "mikecao/flight": "^3.6",
"vlucas/phpdotenv": "^v5.4.1", "vlucas/phpdotenv": "^v5.4.1",
"ircmaxell/random-lib": "^v1.2.0", "ircmaxell/random-lib": "^v1.2.0",
"ehesp/steam-login": "^1.2", "ehesp/steam-login": "^1.2",

49
composer.lock generated
View file

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "094bfec81f03e13792962cc1c6ace48f", "content-hash": "2c8e8023cc115681b5a10a72c32961ac",
"packages": [ "packages": [
{ {
"name": "doctrine/cache", "name": "doctrine/cache",
@ -628,29 +628,39 @@
}, },
{ {
"name": "mikecao/flight", "name": "mikecao/flight",
"version": "v1.3.8", "version": "v3.6.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/mikecao/flight.git", "url": "https://github.com/flightphp/core.git",
"reference": "b3120f8db2ae3b358c1c7a412a92d7aa008a57b4" "reference": "735dafefb9b49ef46f26a511efe224d575c28cc7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/mikecao/flight/zipball/b3120f8db2ae3b358c1c7a412a92d7aa008a57b4", "url": "https://api.github.com/repos/flightphp/core/zipball/735dafefb9b49ef46f26a511efe224d575c28cc7",
"reference": "b3120f8db2ae3b358c1c7a412a92d7aa008a57b4", "reference": "735dafefb9b49ef46f26a511efe224d575c28cc7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.0" "ext-json": "*",
"php": "^7.4|^8.0|^8.1|^8.2|^8.3"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4.6" "ext-pdo_sqlite": "*",
"phpstan/extension-installer": "^1.3",
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^9.5",
"rregeer/phpunit-coverage-check": "^0.3.1",
"squizlabs/php_codesniffer": "^3.8"
},
"suggest": {
"latte/latte": "Latte template engine",
"phpstan/phpstan": "PHP Static Analyzer",
"tracy/tracy": "Tracy debugger"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
"files": [ "files": [
"flight/autoload.php", "flight/autoload.php"
"flight/Flight.php"
] ]
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
@ -663,15 +673,26 @@
"email": "mike@mikecao.com", "email": "mike@mikecao.com",
"homepage": "http://www.mikecao.com/", "homepage": "http://www.mikecao.com/",
"role": "Original Developer" "role": "Original Developer"
},
{
"name": "Franyer Sánchez",
"email": "franyeradriansanchez@gmail.com",
"homepage": "https://faslatam.000webhostapp.com",
"role": "Maintainer"
},
{
"name": "n0nag0n",
"email": "n0nag0n@sky-9.com",
"role": "Maintainer"
} }
], ],
"description": "Flight is a fast, simple, extensible framework for PHP. Flight enables you to quickly and easily build RESTful web applications.", "description": "Flight is a fast, simple, extensible framework for PHP. Flight enables you to quickly and easily build RESTful web applications. This is the maintained fork of mikecao/flight",
"homepage": "http://flightphp.com", "homepage": "http://flightphp.com",
"support": { "support": {
"issues": "https://github.com/mikecao/flight/issues", "issues": "https://github.com/flightphp/core/issues",
"source": "https://github.com/mikecao/flight/tree/master" "source": "https://github.com/flightphp/core/tree/v3.6.0"
}, },
"time": "2020-01-23T05:33:11+00:00" "time": "2024-03-02T21:06:28+00:00"
}, },
{ {
"name": "monolog/monolog", "name": "monolog/monolog",

View file

@ -32,6 +32,7 @@
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
gnumake gnumake
php php
phpPackages.composer
npmLd npmLd
nodeLd nodeLd
]; ];

View file

@ -12,7 +12,7 @@ in
src = sourceByRegex ./. ["composer.*" "(src|test)(/.*)?"]; src = sourceByRegex ./. ["composer.*" "(src|test)(/.*)?"];
vendorHash = "sha256-ympq8XIdABkdjshYX7hJIO6XfFdYm0RA9s3f/n7om3I="; vendorHash = "sha256-EYWCR2aJAoyWvEX+SML4Fb3F3KGcUtwCgqhAGT6ZjZ4=";
composerStrictValidation = false; composerStrictValidation = false;

View file

@ -10,10 +10,10 @@ catch_workers_output = yes
clear_env = no clear_env = no
pm = dynamic pm = dynamic
pm.max_children = 250 pm.max_children = 25
pm.start_servers = 75 pm.start_servers = 5
pm.min_spare_servers = 50 pm.min_spare_servers = 5
pm.max_spare_servers = 200 pm.max_spare_servers = 15
access.log = /proc/self/fd/2 access.log = /proc/self/fd/2
listen = 9000 listen = 9000
access.log = /proc/self/fd/2 access.log = /proc/self/fd/2

View file

@ -121,7 +121,7 @@ class DemoController extends BaseController {
public function listDemos(): void { public function listDemos(): void {
$page = (int) $this->query('page', '1'); $page = (int) $this->query('page', '1');
$order = 'ASC' === strtoupper($this->query('order', 'DESC')) ? 'ASC' : 'DESC'; $order = 'ASC' === strtoupper($this->query('order', 'DESC')) ? 'ASC' : 'DESC';
$this->json($this->demoListProvider->listDemos((int) $page, $this->getFilter(), $order)); $this->json($this->demoListProvider->listDemos($page, $this->getFilter(), $order));
} }
public function listProfile(string $steamId): void { public function listProfile(string $steamId): void {
@ -129,13 +129,13 @@ class DemoController extends BaseController {
$where = $this->getFilter(); $where = $this->getFilter();
$where['players'][] = $steamId; $where['players'][] = $steamId;
$order = 'ASC' === $this->query('order', 'DESC') ? 'ASC' : 'DESC'; $order = 'ASC' === $this->query('order', 'DESC') ? 'ASC' : 'DESC';
$this->json($this->demoListProvider->listProfile((int) $page, $where, $order)); $this->json($this->demoListProvider->listProfile($page, $where, $order));
} }
public function listUploads(string $steamId): void { public function listUploads(string $steamId): void {
$page = (int) $this->query('page', '1'); $page = (int) $this->query('page', '1');
$order = 'ASC' === $this->query('order', 'DESC') ? 'ASC' : 'DESC'; $order = 'ASC' === $this->query('order', 'DESC') ? 'ASC' : 'DESC';
$this->json($this->demoListProvider->listUploads($steamId, (int) $page, $this->getFilter(), $order)); $this->json($this->demoListProvider->listUploads($steamId, $page, $this->getFilter(), $order));
} }
public function chat(string $demoId): void { public function chat(string $demoId): void {

View file

@ -32,6 +32,8 @@ $userController = new Controllers\UserController($container->getRequest(), $cont
$infoController = new Controllers\InfoController($container->getRequest(), $container->getResponse(), $infoController = new Controllers\InfoController($container->getRequest(), $container->getResponse(),
$container->getInfoProvider()); $container->getInfoProvider());
Flight::set('flight.v2.output_buffering', true);
Flight::route('/*', function () { Flight::route('/*', function () {
header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Origin: *');