Our objective is to create a decentralized and distributed PHP framework for sharing files and JSON data.
All servers store the files in the 'files' directory (can use their SHA-256 hash as the filename). This makes it easy to check which servers store the same files and helps avoid file repetition.
Each server displays all the files it has in 'files.php' (a list of links), 'files_json.php' (returns a JSON text), 'files_match.php' (a list of links that filters the result), or 'files.txt' (a static text file) by default. Then, 'search.php' and related will take the list of files from each server and display only those that match the user's input as the result.
Inside the 'users' directory there will be subdirectories named with usernames. Inside each subdirectory will be stored the hashes of the files that the user owns.
The 'servers' folder stores text files containing the address of a server or URL per file. The filename can be the server's hash.
Inside the 'html' directory there will be several subdirectories corresponding to categories. Within each category or subdirectory, HTML files will be saved in an ordered manner (such as 1.html, 2.html) making it easier for users to navigate and find contents.
'files.php' displays all the files in 'files' directory as links. While 'download_links.php' will download all the links from a page and save them inside the 'files' directory using SHA-256 hashes.
'sender.php' and 'sender_multiple.php' provides a practical way to send files. 'sender_multiple_list.php' will attempt to read the content of each file inside the 'servers' directory as if it were a URL and send the files from the 'files' directory. The checking script files_compare.php verifies which files exist in a list of servers.
Although the default is for all servers to store the files within the 'files' directory, it is also possible to create a list of servers that store files in directories with custom names (and indicate the category of the files stored in that directory).