Add config.ini #5

This commit is contained in:
Jacob 2023-09-28 23:22:40 +02:00
parent 2fa3bc054a
commit dc7b04bb9c
2 changed files with 32 additions and 6 deletions

11
config.ini Normal file
View file

@ -0,0 +1,11 @@
[html]
css = index.css
favicon = favicon.svg
[upload]
upload_dir = uploads2/
max_size = 100
[credentials]
key_file = passwords.txt
temp_key_file = temporary_passwords.txt

View file

@ -1,8 +1,23 @@
<?php
$Stylesheet = "index.css"; // path to stylesheet
$Icon = "favicon.svg"; // path to favicon
$uploadDir = "uploads/"; // directory to store uploads in
$keyFile = "passwords.txt"; // text file containing primary passwords
$tempKeyFile = "temporary_passwords.txt"; // text file containing temporary passwords
$maxFileSize = "100"; // in megabytes
$Stylesheet = "index.css";
$Icon = "favicon.svg";
$uploadDir = "uploads/";
$keyFile = "passwords.txt";
$tempKeyFile = "temporary_passwords.txt";
$maxFileSize = "100";
define('CONFIG_FILE', 'config.ini');
if (!file_exists(CONFIG_FILE)) {
return;
}
/* load config file */
$configEntries = parse_ini_file(CONFIG_FILE);
$Stylesheet = $configEntries['css'];
$Icon = $configEntries['favicon'];
$uploadDir = $configEntries['upload_dir'];
$keyFile = $configEntries['key_file'];
$tempKeyFile = $configEntries['temp_key_file'];
$maxFileSize = $configEntries['max_size'];
?>