This repository was archived by the owner on Jul 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.php
More file actions
80 lines (68 loc) · 2.37 KB
/
index.php
File metadata and controls
80 lines (68 loc) · 2.37 KB
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
75
76
77
78
79
80
<?php
error_reporting(E_ALL ^ E_NOTICE); // Oxid-classes throw notices so we block them here
defined('APPLICATION_PATH') || define('APPLICATION_PATH', dirname(__FILE__));
defined('APPLICATION_ENV') || define('APPLICATION_ENV', getenv('APPLICATION_ENV'));
if (APPLICATION_ENV == 'development') {
ini_set('display_errors', 1);
}
/**
* Returns the filesystem path to the OXID eShop installation.
*
* The default path is (relative to this directory) "../../". In case you've installed OXID somewhere in the filesystem,
* you can set the shop path via environment variable.
* For Apache in VHost configuratio or .htacces: SetEnv OXID_SHOP_PATH /path/to/oxid/
*
* @return string
*/
function getShopBasePath()
{
$oxidShopPath = getenv('OXID_SHOP_PATH');
if ($oxidShopPath !== false) {
return rtrim($oxidShopPath, '/') . '/';
}
return dirname(__FILE__) . '/../../';
}
// Now we add the library and OXID path to the include paths.
// Adding the OXID path prevent us to use code like "require getShopBasePath() . 'core/oxfunctions.php';"
set_include_path(
implode(
PATH_SEPARATOR,
array(
realpath(dirname(__FILE__) . '/../library'),
getShopBasePath(),
get_include_path(),
)
)
);
/**
* Load OXID core classes.
*/
if (file_exists(getShopBasePath() . "bootstrap.php")) {
require_once getShopBasePath() . "bootstrap.php";
} else {
require 'modules/functions.php';
require 'core/oxfunctions.php';
}
// Load and initialize our main autoloader.
require 'Admin2/Loader/Autoloader.php';
$loader = Admin2_Loader_Autoloader::getInstance();
$loader->registerNamespace('Admin2');
$hashClass = null;
if (function_exists('hash')) {
$hashClass = new Admin2_Signature_Hash_Sha256();
} else if (function_exists('mhash')) {
$hashClass = new Admin2_Signature_Mhash_Sha256();
}
if ($hashClass === null) {
header('HTTP/1.0 500 Internal Server Error');
exit(255);
}
$signatureClass = new Admin2_Signature_PhpArray();
// Initialize our module loader.
// The module loader loads e.g. the models (currently only the models, but easily extendable).
$moduleLoader = Admin2_Loader_ModuleLoader::getInstance();
// Here we go.
$request = new Admin2_Controller_Request_Http();
$result = new Admin2_Controller_Response();
$dispatcher = new Admin2_Dispatcher($request, $result);
$dispatcher->run($signatureClass, $hashClass);