forked from shopware5/shopware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshopware.php
74 lines (63 loc) · 2.57 KB
/
shopware.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
/**
* Shopware 4.0
* Copyright © 2012 shopware AG
*
* According to our dual licensing model, this program can be used either
* under the terms of the GNU Affero General Public License, version 3,
* or under a proprietary license.
*
* The texts of the GNU Affero General Public License with an additional
* permission and of our proprietary license can be found at and
* in the LICENSE file you have received along with this program.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* "Shopware" is a registered trademark of shopware AG.
* The licensing of the program under the AGPLv3 does not imply a
* trademark license. Therefore any rights, title and interest in
* our trademarks remain entirely with us.
*
* @category Shopware
* @package Shopware
* @subpackage Shopware
* @copyright Copyright (c) 2012, shopware AG (http://www.shopware.de)
* @version $Id$
* @author Heiner Lohaus
* @author $Author$
*/
// Check the minimum required php version
if (version_compare(PHP_VERSION, '5.3.2', '<')) {
header('Content-type: text/html; charset=utf-8', true, 503);
echo '<h2>Fehler</h2>';
echo 'Auf Ihrem Server läuft PHP version ' . PHP_VERSION . ', Shopware 4 benötigt mindestens PHP 5.3.2';
echo '<h2>Error</h2>';
echo 'Your server is running PHP version ' . PHP_VERSION . ' but Shopware 4 requires at least PHP 5.3.2';
return;
}
// Check the database config
if (file_exists('config.php') && strpos(file_get_contents('config.php'), '%db.database%') !== false) {
header('Content-type: text/html; charset=utf-8', true, 503);
echo '<h2>Fehler</h2>';
echo 'Shopware 4 muss zunächst konfiguriert werden. Bitte führen Sie den Installer unter /install/ aus!';
echo '<h2>Error</h2>';
echo 'Shopware 4 must be configured first. Please run the installer under /install/!';
return;
}
set_include_path(
'.' . PATH_SEPARATOR .
dirname(__FILE__) . '/engine/Library/' . PATH_SEPARATOR . // Library
dirname(__FILE__) . '/engine/' . PATH_SEPARATOR . // Shopware
dirname(__FILE__) . '/templates/' // Templates
);
include_once 'Enlight/Application.php';
include_once 'Shopware/Application.php';
$environment = getenv('ENV') ? getenv("ENV") : getenv("REDIRECT_ENV");
if (empty($environment)){
$environment = 'production';
}
$s = new Shopware($environment);
return $s->run();