mirror of
https://codeberg.org/vlw/vlw.se.git
synced 2025-09-13 21:13:40 +02:00
Replaces this section on the `/about` page:  with:  I will replace and fix the colors of the buttons after #15 is merged. Reviewed-on: https://codeberg.org/vlw/vlw.se/pulls/14
22 lines
No EOL
577 B
PHP
22 lines
No EOL
577 B
PHP
<?php
|
|
|
|
use Reflect\Call;
|
|
use Reflect\Path;
|
|
use Reflect\Response;
|
|
|
|
const MSG_OK = "Cache file deleted";
|
|
const MSG_FAIL = "Cache file does not exist or can't be deleted";
|
|
|
|
class DELETE_AboutLanguages {
|
|
public function __construct() {}
|
|
|
|
// Delete languages cache file if it exists
|
|
public function main(): Response {
|
|
// Bail out if cache is not used
|
|
if (empty($_ENV["forgejo_languages"]["cache_file"])) {
|
|
return new Response(MSG_OK);
|
|
}
|
|
|
|
return unlink($_ENV["forgejo_languages"]["cache_file"]) ? new Response(MSG_OK) : new Response(MSG_FAIL, 404);
|
|
}
|
|
} |