-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.php
35 lines (25 loc) · 1.38 KB
/
config.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
<?php
$baseDir = __DIR__; // Absolute path to your installation, ex: /var/www/mywebsite
$docRoot = preg_replace("!{$_SERVER['SCRIPT_NAME']}$!", '', $_SERVER['SCRIPT_FILENAME']); # ex: /var/www
$baseURL = preg_replace("!^{$docRoot}!", '', $baseDir); # ex: '' or '/mywebsite'
$protocol = empty($_SERVER['HTTPS']) ? 'http' : 'https';
$port = $_SERVER['SERVER_PORT'];
$dPort = ($protocol == 'http' && $port == 80 || $protocol == 'https' && $port == 443) ? '' : ":$port";
$domain = $_SERVER['SERVER_NAME'];
$baseURL = "$protocol://{$domain}{$dPort}{$baseURL}"; # Ex: 'http://example.com', 'https://example.com/mywebsite', etc.
$baseURL = "http://localhost/ExpressInvoicer";
date_default_timezone_set('Asia/Kolkata');
define('PROJECT_DIR', $baseDir);
define('DELIMITER','/');
define('BASE_URL',$baseURL);
define('AJAX_DIR', BASE_URL.DELIMITER.'ajax');
define('STYLE_DIR',BASE_URL.DELIMITER.'assets/css');
define('SCRIPT_DIR',BASE_URL.DELIMITER.'assets/js');
define('IMAGE_DIR',BASE_URL.DELIMITER.'assets/image');
define('LIBRARY_DIR',BASE_URL.DELIMITER.'library');
define('UPLOAD_DIR',PROJECT_DIR.DELIMITER.'uploads');
define('APP_VERSION', '1.0');
define('APP_TITLE', 'EXPRESS INVOICER');
function getScript($script){ return SCRIPT_DIR.DELIMITER.$script;}
function getStyle($style) { return STYLE_DIR.DELIMITER.$style; }
function getImage($image) { return BASE_URL.DELIMITER.'uploads/'.$image; }