forked from kamba4/sunders
Merge branch 'main' of ssh://git.hamburg.ccc.de/CCCHH/sunders
This commit is contained in:
commit
0dc7dcb77f
5 changed files with 120 additions and 17 deletions
|
|
@ -1,4 +1,4 @@
|
|||
FROM docker.io/library/php:apache
|
||||
FROM docker.io/library/php:8.5.12-apache
|
||||
|
||||
RUN docker-php-ext-install mysqli bcmath
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
error_reporting(0);
|
||||
// Convert the content of the symbology JSON file to HTML.
|
||||
function addListSymbology($jsonPath, $i18n, $i18nDefault) {
|
||||
global $pathToWebFolder;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
<?php
|
||||
error_reporting(0);
|
||||
include $pathToWebFolder.'config.php';
|
||||
|
||||
define('MAX_POINTS_FOR_QUICKHULL', 3000);
|
||||
|
|
|
|||
|
|
@ -13,4 +13,15 @@
|
|||
define('MYSQL_PASSWORD', getenv('CAMERA_SELECT_USER_PASSWORD') ?: '');
|
||||
|
||||
define('USE_STATISTICS', false);
|
||||
|
||||
|
||||
$environment = getenv('APP_ENV') ?: 'production';
|
||||
if ($environment === 'development') {
|
||||
ini_set('display_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
return;
|
||||
}
|
||||
|
||||
ini_set('display_errors', 0);
|
||||
error_reporting(0);
|
||||
?>
|
||||
30
web/www/sunders/sync-state.php
Normal file
30
web/www/sunders/sync-state.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
error_reporting(0);
|
||||
include $pathToWebFolder.'config.php';
|
||||
|
||||
try {
|
||||
$mysqli = new mysqli(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DB);
|
||||
if($mysqli->connect_errno) {
|
||||
throw new Exception("Could not connect to database");
|
||||
}
|
||||
|
||||
$syncstate_querry = $mysqli->query("SELECT * FROM sync_state WHERE k = 'sequenceNumber'");
|
||||
|
||||
while($row = $syncstate_querry->fetch_assoc()) {
|
||||
$syncstate = array('sequenceNumber' => $row["v"]);
|
||||
}
|
||||
|
||||
$result = json_encode($syncstate);
|
||||
|
||||
$mysqli->close();
|
||||
|
||||
header('Content-type: application/json; Charset : utf-8');
|
||||
echo $result;
|
||||
mysqli_report(MYSQLI_REPORT_OFF);
|
||||
} catch (Exception $e) {
|
||||
http_response_code(503);
|
||||
header('Content-type: application/json');
|
||||
$result = '{"error":"Database unavailable"}';
|
||||
echo $result;
|
||||
}
|
||||
?>
|
||||
Loading…
Reference in a new issue