mirror of
https://codeberg.org/vlw/vlw.se.git
synced 2025-09-13 21:13:40 +02:00
Replacing all GET update params with a single update endpoint that calls POST on all endpoints that trigger runtime stats Reviewed-on: https://codeberg.org/vlw/vlw.se/pulls/35
26 lines
No EOL
615 B
PHP
26 lines
No EOL
615 B
PHP
<?php
|
|
|
|
use Reflect\{Response, Path, Call};
|
|
use ReflectRules\{Ruleset, Rules, Type};
|
|
|
|
use VLW\API\Endpoints;
|
|
|
|
require_once Path::root("src/API/Endpoints.php");
|
|
|
|
class GET_Update {
|
|
protected Ruleset $ruleset;
|
|
|
|
public function __construct() {
|
|
$this->ruleset = new Ruleset(strict: true);
|
|
$this->ruleset->validate_or_exit();
|
|
}
|
|
|
|
// Update all runtime database endpoints
|
|
public function main(): Response {
|
|
(new Call(Endpoints::SEARCH->value))->post();
|
|
(new Call(Endpoints::COFFEE_STATS->value))->post();
|
|
(new Call(Endpoints::ABOUT_LANGUAGES->value))->post();
|
|
|
|
return new Response();
|
|
}
|
|
} |