-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.php
executable file
·36 lines (29 loc) · 1.53 KB
/
config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
// This script manages the Home Index configuration. It is loaded on all Home Index pages.
// Initialize the configuration database.
if (file_exists("./configdatabase.txt") == false) { // If the database file doesn't exist, create it.
$config_file = fopen("configdatabase.txt", "w") or die("Unable to create database file!"); // Create the file.
fwrite($config_file, "a:0:{}"); // Set the contents of the database file to a blank database.
fclose($config_file); // Close the database file.
// Set the default configuration values.
$config["theme"] = "light";
$config["access"] = "admin";
$config["whitelist"] = array();
$config["database_location"] = "./itemdatabase.txt";
$config["admin_user"] = "";
$config["login_page"] = "../login.php";
$config["instance_name"] = "Home Index";
$config["instance_tagline"] = "Organize your personal possessions";
$config["credit_level"] = "low";
$config["display_advanced_tools"] = false;
$config["displayed_search_results_count"] = 10;
$config["backup_overwriting"] = false;
$config["auto_backup"] = "";
$config["auto_backup_interval"] = 60;
$config["default_max_items"] = 1000;
$config["use_landing_page"] = true;
file_put_contents("./configdatabase.txt", serialize($config)); // Write the configuration database to disk.
} else { // Otherwise, the file exists, so load the configuration database from disk.
$config = unserialize(file_get_contents('./configdatabase.txt')); // Load the configuration database from the disk.
}
?>