Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit ae176a6

Browse files
committed
update flight
1 parent fef8fee commit ae176a6

File tree

7 files changed

+47
-23
lines changed

7 files changed

+47
-23
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "api implementation for demos.tf",
44
"license": "MIT",
55
"require": {
6-
"mikecao/flight": "1.3.8",
6+
"mikecao/flight": "^3.6",
77
"vlucas/phpdotenv": "^v5.4.1",
88
"ircmaxell/random-lib": "^v1.2.0",
99
"ehesp/steam-login": "^1.2",

composer.lock

Lines changed: 35 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
nativeBuildInputs = with pkgs; [
3333
gnumake
3434
php
35+
phpPackages.composer
3536
npmLd
3637
nodeLd
3738
];

package.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ in
1212

1313
src = sourceByRegex ./. ["composer.*" "(src|test)(/.*)?"];
1414

15-
vendorHash = "sha256-ympq8XIdABkdjshYX7hJIO6XfFdYm0RA9s3f/n7om3I=";
15+
vendorHash = "sha256-EYWCR2aJAoyWvEX+SML4Fb3F3KGcUtwCgqhAGT6ZjZ4=";
1616

1717
composerStrictValidation = false;
1818

php-fpm.conf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ catch_workers_output = yes
1010

1111
clear_env = no
1212
pm = dynamic
13-
pm.max_children = 250
14-
pm.start_servers = 75
15-
pm.min_spare_servers = 50
16-
pm.max_spare_servers = 200
13+
pm.max_children = 25
14+
pm.start_servers = 5
15+
pm.min_spare_servers = 5
16+
pm.max_spare_servers = 15
1717
access.log = /proc/self/fd/2
1818
listen = 9000
1919
access.log = /proc/self/fd/2

src/Controllers/DemoController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,21 +121,21 @@ protected function getFilter(): array {
121121
public function listDemos(): void {
122122
$page = (int) $this->query('page', '1');
123123
$order = 'ASC' === strtoupper($this->query('order', 'DESC')) ? 'ASC' : 'DESC';
124-
$this->json($this->demoListProvider->listDemos((int) $page, $this->getFilter(), $order));
124+
$this->json($this->demoListProvider->listDemos($page, $this->getFilter(), $order));
125125
}
126126

127127
public function listProfile(string $steamId): void {
128128
$page = (int) $this->query('page', '1');
129129
$where = $this->getFilter();
130130
$where['players'][] = $steamId;
131131
$order = 'ASC' === $this->query('order', 'DESC') ? 'ASC' : 'DESC';
132-
$this->json($this->demoListProvider->listProfile((int) $page, $where, $order));
132+
$this->json($this->demoListProvider->listProfile($page, $where, $order));
133133
}
134134

135135
public function listUploads(string $steamId): void {
136136
$page = (int) $this->query('page', '1');
137137
$order = 'ASC' === $this->query('order', 'DESC') ? 'ASC' : 'DESC';
138-
$this->json($this->demoListProvider->listUploads($steamId, (int) $page, $this->getFilter(), $order));
138+
$this->json($this->demoListProvider->listUploads($steamId, $page, $this->getFilter(), $order));
139139
}
140140

141141
public function chat(string $demoId): void {

src/app.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
$infoController = new Controllers\InfoController($container->getRequest(), $container->getResponse(),
3333
$container->getInfoProvider());
3434

35+
Flight::set('flight.v2.output_buffering', true);
36+
3537
Flight::route('/*', function () {
3638
header('Access-Control-Allow-Origin: *');
3739

0 commit comments

Comments
 (0)