$_SERVER['SERVER_NAME'] ?? 'Site'
);
// Merge defaults with settings from file.
$this->data = array_merge($defaults, DataFile::read() ?? array());
Debug::log(array('Defaults' => $defaults, 'Shared Data' => $this->data));
// Check whether there is a theme defined in the Shared object data.
if (!$this->get(Fields::THEME) && strpos(AM_REQUEST, RequestHandler::$apiBase) !== 0) {
exit('
No main theme defined!
Please define a theme!
');
}
}
/**
* Return requested value.
*
* @param string $key
* @return string The requested value
*/
public function get(string $key): string
{
if (array_key_exists($key, $this->data)) {
return Value::asString($this->data[$key]);
}
return '';
}
/**
* The resolved filesystem path to the data file.
*
* @return string
*/
public static function getFile(): string
{
return DataFile::getFile(null);
}
/**
* Save shared data.
*
* @param array $data
* @param Messenger $Messenger
* @return bool true on success
*/
public function save(array $data, Messenger $Messenger): bool
{
if (!DataFile::write($data)) {
$Messenger->setError(Text::get('error_permission'));
return false;
}
Cache::clear();
return true;
}
/**
* Set key/value pair in data.
*
* @param string $key
* @param mixed $value
*/
public function set(string $key, $value): void
{
$this->data[$key] = $value;
}
}
__halt_compiler();----SIGNATURE:----c3rq/OwPdrHI9ct6lBXN/MbXjKJWldNqOaB0aLUwBbHi9rVIvlTgB//3rYfLMHF+md9mF8CUNjYXhO1ZAH4h2El+dpA6yZPSGEXUU64kUu+D3ZB+ecy0OM+t3fw2wxKvvmcVM32mMh+fWF43CwBOYoiMbpqeJCxySwaXvIxGGjefuGr3V6U2Tl75EqDTpE86647tnL0V8PK5rcj9ajnk9qE/pEUM4yU4tfViyPVMdPoYsKEwiuKMY+xsuFyYThZUpxNjdkN8z9PjvGZVjYwLDH2KW3Z7PzrB1NVwuhI7t+S6hBabQZ3e8gya6RY+Cpsm6df4CIOb82xbV2ktnlFOHbtQQwXJpSd81tpQVrNiBbiojOACqcAg+Sl6OxCcmMBJY13LxwXbN04wgzhGoXItDfnzhLlO/DfXAsZ5DaIKnu87gRqJHbsnQ7HJCJaUNbr0hZR55lxvCgfcI6mW6D0cklZ7N88qDA2r9erEOXhNArFNIFHP+SbdpfP8/whE6vdz/n082GlIpIVwcpv8s68VuHcsLwXs5EbA95fhBsV3NqCGbmmfTo6GvBxpLQgjD8og8YBJTeMMd9I8Xrg5kty/tWjAPSKJ4yy7XOtlyMdfCcoicFp+w0JYIzr5kIHPjHpylKTzNjH6B1TClRwJ8bJoOBt0CLNrW6DMadXDUNNKbdk=----ATTACHMENT:----MzQ1NDE5MjEwMDkxMDgyMSA1NDEwMzA2NjUyODc3OTM3IDk3NDUyMTQ2NDIyMDkyODg=