Skip to content

Instantly share code, notes, and snippets.

@asika32764
Last active January 22, 2019 00:53
Show Gist options
  • Save asika32764/12851b6bd3936301de7b to your computer and use it in GitHub Desktop.
Save asika32764/12851b6bd3936301de7b to your computer and use it in GitHub Desktop.
<?php
// Get Base URI
$baseUri = str_replace($_SERVER['DOCUMENT_ROOT'], '', dirname($_SERVER['SCRIPT_FILENAME']));
$http = str_replace(array('/', '\\'), '/', $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . $baseUri . '/');
$catalog = explode('/', $http);
array_pop($catalog);
array_pop($catalog);
$catalog = implode('/', $catalog) . '/';
// HTTP
define('HTTP_SERVER', $http);
define('HTTP_CATALOG', $catalog);
// HTTPS
define('HTTPS_SERVER', $http);
define('HTTPS_CATALOG', $catalog);
// DIR
define('OP_ADMIN', __DIR__);
define('OP_ROOT', dirname(OP_ADMIN));
define('DIR_APPLICATION', OP_ROOT . '/admin/');
define('DIR_SYSTEM', OP_ROOT . '/system/');
define('DIR_LANGUAGE', OP_ROOT . '/admin/language/');
define('DIR_TEMPLATE', OP_ROOT . '/admin/view/template/');
define('DIR_CONFIG', OP_ROOT . '/system/config/');
define('DIR_IMAGE', OP_ROOT . '/image/');
define('DIR_CACHE', OP_ROOT . '/system/cache/');
define('DIR_DOWNLOAD', OP_ROOT . '/system/download/');
define('DIR_UPLOAD', OP_ROOT . '/system/upload/');
define('DIR_LOGS', OP_ROOT . '/system/logs/');
define('DIR_MODIFICATION', OP_ROOT . '/system/modification/');
define('DIR_CATALOG', OP_ROOT . '/catalog/');
// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '');
define('DB_DATABASE', '');
define('DB_PREFIX', 'oc_');
<?php
// Get Base URI
$baseUri = str_replace($_SERVER['DOCUMENT_ROOT'], '', dirname($_SERVER['SCRIPT_FILENAME']));
$http = str_replace(array('/', '\\'), '/', $_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'] . $baseUri . '/');
// HTTP
define('HTTP_SERVER', $http);
// HTTPS
define('HTTPS_SERVER', $http);
// DIR
define('OP_ROOT', __DIR__);
define('DIR_APPLICATION', OP_ROOT . '/catalog/');
define('DIR_SYSTEM', OP_ROOT . '/system/');
define('DIR_LANGUAGE', OP_ROOT . '/catalog/language/');
define('DIR_TEMPLATE', OP_ROOT . '/catalog/view/theme/');
define('DIR_CONFIG', OP_ROOT . '/system/config/');
define('DIR_IMAGE', OP_ROOT . '/image/');
define('DIR_CACHE', OP_ROOT . '/system/cache/');
define('DIR_DOWNLOAD', OP_ROOT . '/system/download/');
define('DIR_UPLOAD', OP_ROOT . '/system/upload/');
define('DIR_MODIFICATION', OP_ROOT . '/system/modification/');
define('DIR_LOGS', OP_ROOT . '/system/logs/');
// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', '');
define('DB_DATABASE', '');
define('DB_PREFIX', 'oc_');
@leadenpraise
Copy link

hi! i am a newbee. still learning bit by bit. but i need some assistant. i made a guy setup my opencart platform for me. i think he is messing up with it now. i change my password, he reset it. i believe he used his email to setup the platform. is there anything i can do about that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment