fix: import of translations for cronjobs was missing (#321)

refactor: retrieval of webroot path
chore: add sqlite to docker image
This commit is contained in:
Miguel Ribeiro
2024-05-13 17:45:59 +02:00
committed by GitHub
parent 46f933ade7
commit a524419e0a
10 changed files with 17 additions and 24 deletions
-6
View File
@@ -1,6 +0,0 @@
<?php
#Webroot path
$webPath = "/var/www/html/";
?>
+1 -4
View File
@@ -1,8 +1,6 @@
<?php
require_once 'conf.php';
$databaseFile = $webPath . 'db/wallos.db';
$databaseFile = __DIR__ . '/../../db/wallos.db';
if (!file_exists($databaseFile)) {
echo "Database does not exist. Creating it...\n";
@@ -234,7 +232,6 @@ if (!file_exists($databaseFile)) {
} else {
echo "Database already exist. Checking for upgrades...\n";
$databaseFile = $webPath . 'db/wallos.db';
$db = new SQLite3($databaseFile);
$db->busyTimeout(5000);
+4 -5
View File
@@ -3,8 +3,7 @@
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
require_once 'conf.php';
require_once $webPath . 'includes/connect_endpoint_crontabs.php';
require_once __DIR__ . '/../../includes/connect_endpoint_crontabs.php';
$days = 1;
$emailNotificationsEnabled = false;
@@ -152,9 +151,9 @@
// Email notifications if enabled
if ($emailNotificationsEnabled) {
require $webPath . 'libs/PHPMailer/PHPMailer.php';
require $webPath . 'libs/PHPMailer/SMTP.php';
require $webPath . 'libs/PHPMailer/Exception.php';
require __DIR__ . '/../../libs/PHPMailer/PHPMailer.php';
require __DIR__ . '/../../libs/PHPMailer/SMTP.php';
require __DIR__ . '/../../libs/PHPMailer/Exception.php';
$stmt = $db->prepare('SELECT * FROM user WHERE id = :id');
$stmt->bindValue(':id', 1, SQLITE3_INTEGER);
+1 -2
View File
@@ -1,6 +1,5 @@
<?php
require_once 'conf.php';
require_once $webPath . 'includes/connect_endpoint_crontabs.php';
require_once __DIR__ . '/../../includes/connect_endpoint_crontabs.php';
$query = "SELECT api_key FROM fixer";
$result = $db->query($query);
+2 -2
View File
@@ -1,6 +1,6 @@
<?php
require_once 'conf.php';
require_once $webPath . 'includes/connect_endpoint_crontabs.php';
require_once __DIR__ . '/../../includes/connect_endpoint_crontabs.php';
$currentDate = new DateTime();
$currentDateString = $currentDate->format('Y-m-d');
@@ -42,7 +42,7 @@ require_once '../../includes/connect_endpoint.php';
$query = "INSERT INTO discord_notifications (enabled, webhook_url, bot_username, bot_avatar_url)
VALUES (:enabled, :webhook_url, :bot_username, :bot_avatar_url)";
} else {
$query = "UPDATE pushover_notifications
$query = "UPDATE discord_notifications
SET enabled = :enabled, webhook_url = :webhook_url, bot_username = :bot_username, bot_avatar_url = :bot_avatar_url";
}