Skip to content

Commit 6cf76ec

Browse files
committed
Revert "Initial"
This reverts commit 2b3fdc2.
1 parent 6d77eb4 commit 6cf76ec

File tree

3 files changed

+20
-16
lines changed

3 files changed

+20
-16
lines changed

public_html/core/init.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,13 @@
6060
}
6161

6262
//Set up common paths
63-
define('DIR_SYSTEM', DATA_DIR.'/system/');
64-
define('DIR_DOWNLOAD', DATA_DIR.'/download/');
65-
define('DIR_CACHE', DATA_DIR.'/system/cache/');
66-
define('DIR_LOGS', DATA_DIR.'/system/logs/');
67-
63+
define('DIR_SYSTEM', DIR_ROOT.'/system/');
6864
define('DIR_IMAGE', DIR_ROOT.'/image/');
65+
define('DIR_DOWNLOAD', DIR_ROOT.'/download/');
6966
define('DIR_DATABASE', DIR_ROOT.'/core/database/');
7067
define('DIR_CONFIG', DIR_ROOT.'/core/config/');
68+
define('DIR_CACHE', DIR_ROOT.'/system/cache/');
69+
define('DIR_LOGS', DIR_ROOT.'/system/logs/');
7170
define('DIR_VENDORS', DIR_CORE.'/vendors/');
7271

7372
require DIR_VENDORS.'/Mustache/Autoloader.php';
@@ -120,8 +119,8 @@
120119
define('DIR_LANGUAGE', DIR_ROOT.'/admin/language/');
121120
define('DIR_TEMPLATE', DIR_ROOT.'/admin/view/');
122121
define('DIR_STOREFRONT', DIR_ROOT.'/storefront/');
123-
define('DIR_BACKUP', DATA_DIR.'/admin/system/backup/');
124-
define('DIR_DATA', DATA_DIR.'/admin/system/data/');
122+
define('DIR_BACKUP', DIR_ROOT.'/admin/system/backup/');
123+
define('DIR_DATA', DIR_ROOT.'/admin/system/data/');
125124
//generate unique session name.
126125
//NOTE: This is a session name not to confuse with actual session id. Candidate to renaming
127126
define('SESSION_ID', defined('UNIQUE_ID') ? 'AC_CP_'.strtoupper(substr(UNIQUE_ID, 0, 10)) : 'AC_CP_PHPSESSID');

public_html/index.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,24 @@
3232
// Real path (operating system web root) to the directory where abantecart is installed
3333
$root_path = dirname(__FILE__);
3434

35-
if (!$_SERVER['HOSTNAME']) {
36-
echo "Unauthorized access <br>";
35+
// Windows IIS Compatibility
36+
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
37+
define('IS_WINDOWS', true);
38+
$root_path = str_replace('\\', '/', $root_path);
39+
} else {
40+
define('IS_WINDOWS', false);
3741
}
38-
echo $_SERVER['HOSTNAME']; exit;
3942

4043
define('DIR_ROOT', $root_path);
4144
define('DIR_CORE', DIR_ROOT.'/core/');
4245

43-
define('DATA_DIR', DIR_ROOT . "/../data/" . $_SERVER['HOSTNAME']. '/');
44-
45-
if(is_file(DATA_DIR.'/system/config.php')) {
46-
require_once(DATA_DIR.'/system/config.php');
46+
if(is_file(DIR_ROOT.'/system/config.php')) {
47+
require_once(DIR_ROOT.'/system/config.php');
48+
}
49+
// New Installation
50+
if (!defined('DB_DATABASE')) {
51+
header('Location: install/index.php');
52+
exit;
4753
}
4854

4955
// Load all initial set up

public_html/task.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@
4141
define('DIR_CORE', DIR_ROOT.'/core/');
4242
define('RDIR_TEMPLATE', 'admin/view/default/');
4343

44-
define('DATA_DIR', DIR_ROOT . "/../data/" . $_SERVER['HOSTNAME']. '/');
45-
require_once(DATA_DIR.'/system/config.php');
44+
require_once(DIR_ROOT.'/system/config.php');
4645

4746
//set server name for correct email sending
4847
if (defined('SERVER_NAME') && SERVER_NAME != '') {

0 commit comments

Comments
 (0)