<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */


class ReplikatSettingsAPI
{
  public static function getSettingValue($pSettingName, $pRefreshCache = false)
  {
    if ($pSettingName == null || $pSettingName == '') {
      throw new InvalidArgumentException('Argument darf nicht leer sein');
    }

    static $values = array();
    if (isset($values[$pSettingName]) && !$pRefreshCache) {
      return $values[$pSettingName];
    }

    $dbw = new DBWorkWebReplikatSettings();
    $setting = $dbw->getSettingValue($pSettingName);
    $values[$pSettingName] = $setting->value;

    return $values[$pSettingName];
  }
}