Added hash check

This commit is contained in:
Netkas 2021-09-23 20:34:24 -04:00
parent d1b91f1d16
commit 07b5a5260f
1 changed files with 9 additions and 0 deletions

View File

@ -82,6 +82,15 @@
if($this->Configuration == null)
$this->reloadConfiguration();
// Get in-memory hash
$memory_hash = hash('crc32', json_encode($this->Configuration, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
// Get configuration hash
$configuration_hash = hash_file('crc32', $this->MasterConfigurationPath);
if($memory_hash == $configuration_hash)
return;
file_put_contents($this->MasterConfigurationPath, json_encode($this->Configuration, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
}