Subversion-Projekte lars-tiefland.laravel_shop

Revision

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

Revision 176 Revision 177
Zeile 13... Zeile 13...
13
|
13
|
14
 */
14
 */
Zeile 15... Zeile 15...
15
 
15
 
16
function getConfig()
16
function getConfig()
17
{
17
{
18
	define('__SITE__', env('site'));
18
    define('__SITE__', env('site'));
19
	define('__SHOP__', env('shop'));
19
    define('__SHOP__', env('shop'));
Zeile 20... Zeile 20...
20
        define( "__CFG_PATH__", "/etc/shop_configs/" . __SITE__ . "/" . __SHOP__ );
20
    define("__CFG_PATH__", "/etc/shop_configs/" . __SITE__ . "/" . __SHOP__);
21
 
21
 
22
        $cfg_file = __CFG_PATH__ . "/config.de.xml";
-
 
23
        if ( !file_exists( $cfg_file ) )
22
    $cfg_file = __CFG_PATH__ . "/config.de.xml";
24
        {
23
    if (!file_exists($cfg_file)) {
25
            trigger_error( "Konnte keine Konfigurationsdatei für das Shopsystem " . __SITE__ . " -> " . __SHOP__ . " finden (" . ( $cfg_file ) . ")!", E_USER_ERROR );
24
        trigger_error("Konnte keine Konfigurationsdatei für das Shopsystem " . __SITE__ . " -> " . __SHOP__ . " finden (" . ($cfg_file) . ")!", E_USER_ERROR);
26
        }
25
    }
27
        $xml = simplexml_load_file( $cfg_file, "SimpleXMLElement", LIBXML_NOCDATA );
26
    $xml = simplexml_load_file($cfg_file, "SimpleXMLElement", LIBXML_NOCDATA);
28
        $ini = json_decode( json_encode( $xml ), true );
-
 
29
        foreach ( $ini as $key => $wert )
27
    $ini = json_decode(json_encode($xml), true);
30
        {
-
 
31
            if ( $wert == array() )
28
    foreach ($ini as $key => $wert) {
32
            {
-
 
33
                $ini[ $key ] = "";
29
        if ($wert == array()) {
34
            }
-
 
35
            elseif ( is_array( $wert ) )
30
            $ini[$key] = "";
36
            {
-
 
37
                foreach ( $wert as $key2 => $wert2 )
31
        } elseif (is_array($wert)) {
38
                {
-
 
39
                    if ( $wert2 == array() )
32
            foreach ($wert as $key2 => $wert2) {
40
                    {
-
 
41
                        $ini[ $key ][ $key2 ] = "";
33
                if ($wert2 == array()) {
42
                    }
34
                    $ini[$key][$key2] = "";
43
                }
35
                }
-
 
36
            }
Zeile 44... Zeile 37...
44
            }
37
        }
45
        }
38
    }
46
 
-
 
47
        $v_file = __CFG_PATH__ . "/versand.xml";
39
 
48
        if ( file_exists( $v_file ) )
40
    $v_file = __CFG_PATH__ . "/versand.xml";
49
        {
41
    if (file_exists($v_file)) {
50
            $xml = simplexml_load_file( $v_file, "SimpleXMLElement", LIBXML_NOCDATA );
-
 
51
            $ini["shipping"] = json_decode( json_encode( $xml ), true );
42
        $xml = simplexml_load_file($v_file, "SimpleXMLElement", LIBXML_NOCDATA);
52
            foreach ( $ini["shipping"] as $key => $wert )
-
 
53
            {
43
        $ini["shipping"] = json_decode(json_encode($xml), true);
54
                if ( $wert == array() )
-
 
55
                {
44
        foreach ($ini["shipping"] as $key => $wert) {
56
                    $ini["shipping"][ $key ] = "";
-
 
57
                }
45
            if ($wert == array()) {
58
                elseif ( is_array( $wert ) )
-
 
59
                {
46
                $ini["shipping"][$key] = "";
60
                    foreach ( $wert as $key2 => $wert2 )
-
 
61
                    {
47
            } elseif (is_array($wert)) {
62
                        if ( $wert2 == array() )
-
 
63
                        {
48
                foreach ($wert as $key2 => $wert2) {
64
                            $ini["shipping"][ $key ][ $key2 ] = "";
49
                    if ($wert2 == array()) {
65
                        }
50
                        $ini["shipping"][$key][$key2] = "";
66
                    }
51
                    }
-
 
52
                }
67
                }
53
            }
68
            }
54
        }
-
 
55
    }
69
        }
56
    return $ini;
70
        return $ini;
57
}
71
}
58
 
72
session_start();
59
session_start();
73
$GLOBALS["INI"] = getConfig();
60
$GLOBALS["INI"] = getConfig();