-
-
Save bytefade/361dd78b4e9a3ec3ea6382d555c2f983 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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_'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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_'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment