forked from AydarAkhmetzyanov/workedge
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
35 lines (29 loc) · 927 Bytes
/
Copy pathindex.php
File metadata and controls
35 lines (29 loc) · 927 Bytes
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
<?php
function timeMeasure()
{
list($msec, $sec) = explode(chr(32), microtime());
return ($sec+$msec);
}
define('TIMESTART', timeMeasure());
function getAppDir(){
$nurl = $_SERVER['PHP_SELF'];
$nurl = str_replace('index.php', '', $nurl);
return $nurl;
}
function getAppURLDir(){
if((empty($_SERVER["HTTPS"])) or ($_SERVER["HTTPS"]=='off')) {
$nurl = 'http://' . $_SERVER['HTTP_HOST'] . getAppDir();
return $nurl;
} else {
$nurl = 'https://' . $_SERVER['HTTP_HOST'] . getAppDir();
return $nurl;
}
}
define('APPDIR', getAppURLDir());
define('APPURLDIR', getAppURLDir());
define('DS', DIRECTORY_SEPARATOR);
define('ROOT', realpath(dirname(__FILE__)));
require_once (ROOT . DS . 'config' . DS . 'main.php');
require_once (ROOT . DS . 'config' . DS . 'db.php');
require_once (ROOT . DS . 'core' . DS . 'bootstrap.php');
//echo '<!--'.round(timeMeasure()-TIMESTART, 6).' sec. -->';