Example #1
0
 /**
  * Getter function to initialize the user maincfg instance
  * Only needed in some rare cases when only the values from
  * the user (web) controllable nagvis.ini.php file are needed
  */
 public static function getUserMainCfg()
 {
     global $_UMAINCFG;
     if (!isset($_UMAINCFG)) {
         $_UMAINCFG = new GlobalMainCfg();
         $_UMAINCFG->setConfigFiles(array(CONST_MAINCFG));
         $_UMAINCFG->init(True, '-user-only');
     }
     return $_UMAINCFG;
 }
Example #2
0
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *****************************************************************************/
$CORE = GlobalCore::getInstance();
/*
 * l() needs to be available in MainCfg initialization and config parsing,
 * but GlobalLanguage initialization relies on the main configuration in
 * some parts.
 * The cleanest way to solve this problem is to skip the i18n in the main
 * configuration init code until all needed values are initialized and then
 * initialize the i18n code.
 */
// ----------------------------------------------------------------------------
$_MAINCFG = new GlobalMainCfg();
$_MAINCFG->init();
/**
 * This is mainly a short access to config options. In the past the whole
 * language object method call was used all arround NagVis. This has been
 * introduced to keep the code shorter
 */
function cfg($sec, $key, $ignoreDefaults = false)
{
    global $_MAINCFG;
    return $_MAINCFG->getValue($sec, $key, $ignoreDefaults);
}
function path($type, $loc, $var, $relfile = '')
{
    global $_MAINCFG;
    return $_MAINCFG->getPath($type, $loc, $var, $relfile);