-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdumpraw.php
executable file
·22 lines (17 loc) · 1.05 KB
/
dumpraw.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
include "./config.php"; // Import the configuration library.
$admin_only = true;
include "./authentication.php"; // Import the authentication library.
if (file_exists($config["database_location"]) == false) { // If the database file doesn't exist, create it.
$item_database_file = fopen($config["database_location"], "w") or die("Unable to create database file!"); // Create the file.
fwrite($item_database_file, "a:0:{}"); // Set the contents of the database file to a blank database.
fclose($item_database_file); // Close the database file.
}
if (file_exists($config["database_location"]) == true) { // Check to see if the item database file exists. The database should have been created in the previous step if it didn't already exists.
$item_database = file_get_contents($config["database_location"]); // Load the contents of the database file from the disk.
} else {
echo "<p>The database file contents failed to load</p>"; // Inform the user that the database failed to load.
exit(); // Terminate the script.
}
echo $item_database;
?>