Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 1625 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

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