From 3345f4c8af6cb9a596e57210ee832ee19b913d50 Mon Sep 17 00:00:00 2001 From: jakani24 Date: Sat, 17 Feb 2024 15:59:45 +0100 Subject: [PATCH] Update compile_database.php --- .../cyberhex-code/api/php/database/compile_database.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/cyberhex-code/api/php/database/compile_database.php b/src/server/cyberhex-code/api/php/database/compile_database.php index aa6efa3..7d78a90 100644 --- a/src/server/cyberhex-code/api/php/database/compile_database.php +++ b/src/server/cyberhex-code/api/php/database/compile_database.php @@ -12,10 +12,10 @@ function sort_hashes($inputFile) { // Remove leading/trailing whitespace and split the line into words // Get the first two characters of the word - $prefix = substr($word, 0, 2); + $prefix = substr($line, 0, 2); // Create the filename for the corresponding file - $filename = $prefix . ".jdbf"; + $filename = "/var/www/html/database_srv/".$prefix . ".jdbf"; // Open or create the file for writing $fileHandle = fopen($filename, "a"); @@ -24,7 +24,7 @@ function sort_hashes($inputFile) { } // Write the word to the file - fwrite($fileHandle, $word . PHP_EOL); + fwrite($fileHandle, $line . PHP_EOL); // Close the file handle fclose($fileHandle);