Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 50e60a7

Browse files
committed
Boot.conf generates a simple server uuid that can be used for various identifier (kvcache should use it)
1 parent cbf4957 commit 50e60a7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

core/src/plugins/boot.conf/class.BootConfLoader.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ public function init($options)
5151
{
5252
parent::init($options);
5353
try {
54-
$this->getPluginWorkDir(true);
54+
$dir = $this->getPluginWorkDir(true);
55+
if(!is_file($dir.DIRECTORY_SEPARATOR."server_uuid")){
56+
file_put_contents($dir.DIRECTORY_SEPARATOR."server_uuid", md5(json_encode($_SERVER)));
57+
}
5558
} catch (Exception $e) {
5659
die("Impossible write into the AJXP_DATA_PATH folder: Make sure to grant write access to this folder for your webserver!");
5760
}
@@ -69,6 +72,10 @@ public function loadManifest()
6972
}
7073
}
7174

75+
public function getServerUuid(){
76+
return file_get_contents($this->getPluginWorkDir().DIRECTORY_SEPARATOR."server_uuid");
77+
}
78+
7279
public function printFormFromServerSettings($fullManifest){
7380

7481
AJXP_XMLWriter::header("admin_data");

0 commit comments

Comments
 (0)