-
-
Notifications
You must be signed in to change notification settings - Fork 29
/
index.php
executable file
·67 lines (52 loc) · 2.08 KB
/
index.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
<?php
/**
*
* @copyright 2008 - https://www.clicshopping.org
* @Brand : ClicShoppingAI(TM) at Inpi all right Reserved
* @Licence GPL 2 & MIT
* @Info : https://www.clicshopping.org/forum/trademark/
*
*/
use ClicShopping\OM\CLICSHOPPING;
use ClicShopping\OM\Registry;
use ClicShopping\OM\HTTP;
// start the timer for the page parse time log
define('PAGE_PARSE_START_TIME', microtime());
define('CLICSHOPPING_BASE_DIR', __DIR__ . '/includes/ClicShopping/');
require_once(CLICSHOPPING_BASE_DIR . 'OM/CLICSHOPPING.php');
spl_autoload_register('ClicShopping\OM\CLICSHOPPING::autoload');
CLICSHOPPING::initialize();
//check configuration
if (!CLICSHOPPING::configExists('db_server') || (\strlen(CLICSHOPPING::getConfig('db_server')) < 1)) {
if (realpath(__DIR__ . '/install/')) {
$realDocRoot = realpath($_SERVER['DOCUMENT_ROOT']);
$realDirPath = realpath(__DIR__);
$suffix = str_replace($realDocRoot, '', $realDirPath);
$prefix = isset($_SERVER['HTTPS']) ? 'https://' : 'http://';
$folderUrl = $prefix . $_SERVER['HTTP_HOST'] . $suffix . '/install/index.php';
header('Location:' . $folderUrl);
exit;
} else {
echo 'Please look your install directory to begin your new installation like https://wwww.mydomain.com/MyDirectory/install';
exit;
}
}
CLICSHOPPING::loadSite('Shop');
if (CLICSHOPPING::hasSitePage()) {
if (CLICSHOPPING::isRPC() === false) {
$page_file = CLICSHOPPING::getSitePageFile();
if (empty($page_file) || !is_file($page_file)) {
HTTP::redirect(CLICSHOPPING::getConfig('http_server', 'Shop') . CLICSHOPPING::getConfig('http_path', 'Shop') . 'error_documents/404.php');
}
if (CLICSHOPPING::useSiteTemplateWithPageFile()) {
include_once(Registry::get('Template')->getFile('header.php', 'Default'));
}
include_once($page_file);
if (CLICSHOPPING::useSiteTemplateWithPageFile()) {
require_once(Registry::get('Template')->getFile('footer.php', 'Default'));
}
}
goto main_sub3;
}
main_sub3: // Sites and Apps skip to here
require_once(CLICSHOPPING::BASE_DIR . '/Sites/Shop/Templates/Default/footer.php');