snappymail/rainloop/v/0.0.0/app/libraries/RainLoop/Settings.php
djmaze 2cada68f41 Privacy/GDPR friendly version (removed: Social, Gravatar, Facebook, Google, Twitter, DropBox, OwnCloud)
Also removed: POP3, OAuth2 and update feature
Added: admin password_hash/password_verify
Requires: PHP 7.3+
Replaced: CRLF with LF
Replaced: pclZip with ZipArchive
2020-03-09 17:04:17 +01:00

65 lines
893 B
PHP

<?php
namespace RainLoop;
class Settings
{
/**
* @var array
*/
protected $aData;
/**
* @var bool
*/
protected $bLocal;
/**
* @return void
*/
public function __construct(bool $bLocal = false)
{
$this->aData = array();
$this->bLocal = !!$bLocal;
}
public function InitData(array $aData) : self
{
if (\is_array($aData))
{
$this->aData = $aData;
}
return $this;
}
public function DataAsArray() : array
{
return $this->aData;
}
public function IsLocal() : bool
{
return $this->bLocal;
}
/**
* @param mixed $mDefValue = null
*
* @return mixed
*/
public function GetConf(string $sName, $mDefValue = null)
{
return isset($this->aData[$sName]) ? $this->aData[$sName] : $mDefValue;
}
/**
* @param mixed $mValue
*
* @return void
*/
public function SetConf(string $sName, $mValue)
{
$this->aData[$sName] = $mValue;
}
}