Subversion-Projekte lars-tiefland.nagios-php

Revision

Revision 9 | Revision 50 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 9 Revision 14
Zeile 10... Zeile 10...
10
    $GLOBALS["ui"] = new Smarty();
10
    $GLOBALS["ui"] = new Smarty();
11
    $cfg = new Config();
11
    $cfg = new Config();
12
    $cfg = $cfg->parseConfig( "config.xml", "xml" );
12
    $cfg = $cfg->parseConfig( "config.xml", "xml" );
13
    $cfg = $cfg->toArray();
13
    $cfg = $cfg->toArray();
14
    $GLOBALS["cfg"] = $cfg["root"]["config"];
14
    $GLOBALS["cfg"] = $cfg["root"]["config"];
-
 
15
    $opts = array(
-
 
16
        "persistent" => true,
15
    $opts = array( "persistent" => true, "portability" => MDB2_PORTABILITY_ALL ^
17
        "portability" => MDB2_PORTABILITY_ALL ^ MDB2_PORTABILITY_EMPTY_TO_NULL ^
16
            MDB2_PORTABILITY_EMPTY_TO_NULL ^ MDB2_PORTABILITY_FIX_CASE );
18
            MDB2_PORTABILITY_FIX_CASE,
-
 
19
        );
17
    $dsn = array(
20
    $dsn = array(
18
        "phptype" => "mysqli",
21
        "phptype" => "mysqli",
19
        "username" => $GLOBALS["cfg"]["db"]["user"],
22
        "username" => $GLOBALS["cfg"]["db"]["user"],
20
        "password" => $GLOBALS["cfg"]["db"]["pass"],
23
        "password" => $GLOBALS["cfg"]["db"]["pass"],
21
        "hostspec" => $GLOBBALS["cfg"]["db"]["server"],
24
        "hostspec" => $GLOBALS["cfg"]["db"]["server"],
22
        "database" => $GLOBALS["cfg"]["db"]["db"],
25
        "database" => $GLOBALS["cfg"]["db"]["db"],
23
        "new_link" => true,
26
        "new_link" => true,
24
        );
27
        );
25
    $GLOBALS["db"] = MDB2::connect( $dsn, $opts );
28
    $GLOBALS["db"] = MDB2::connect( $dsn, $opts );
26
    if ( PEAR::isError( $GLOBALS["db"] ) )
29
    if ( PEAR::isError( $GLOBALS["db"] ) )
27
    {
30
    {
28
        trigger_error( "Keine Verbindung zur Datenbank möglich!\n", E_USER_ERROR );
31
        trigger_error( "Keine Verbindung zur Datenbank möglich!\n", E_USER_ERROR );
29
    }
32
    }
30
    $GLOBALS["db"]->setfetchMode( MDB2_FETCHMODE_ASSOC );
33
    $GLOBALS["db"]->setfetchMode( MDB2_FETCHMODE_ASSOC );
Zeile -... Zeile 34...
-
 
34
 
-
 
35
    $GLOBALS["ui"]->assign( "cfg", $GLOBALS["cfg"] );
31
 
36