-
Notifications
You must be signed in to change notification settings - Fork 0
/
initialize.php
37 lines (32 loc) · 1.27 KB
/
initialize.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
35
36
37
<?php
/*
* Change the value, to the current subdomains sequence (like [my-subdomain-name])
* or if this file is in the root address, leave null for that
*/
$dirs = explode("/", __DIR__);
$GLOBALS["ASEQ"] = end($dirs);//join(".", array_slice($dirs,3));/*Change it to null if the file is in the root directory*/
$GLOBALS["BASE"] = ".aseq";
$GLOBALS["NEST"] = !empty($GLOBALS["ASEQ"])?preg_match_all("/(?<=\S|\s)\.(?=\S|\s)/",$ASEQ)+1:0;
if(!isset($GLOBALS["HOST"])){
$GLOBALS["HOST"] = (isset($_SERVER['HTTPS'])?"https://":"http://");
if($NEST > 0){
$host_parts = explode(".", strtolower(trim($_SERVER["HTTP_HOST"])));
$hpc = count($host_parts);
$GLOBALS["HOST"] .= $host_parts[$hpc-(1+$NEST)];
for ($i = $NEST; $i > 0; $i--) $GLOBALS["HOST"] .=".".$host_parts[$hpc-$i];
}
else $GLOBALS["HOST"] .= strtolower(trim($_SERVER["HTTP_HOST"]));
}
$GLOBALS["BASE_ROOT"] = $GLOBALS["HOST"]."/".$GLOBALS["BASE"]."/";
$GLOBALS["BASE_DIR"] = __DIR__."/";
for ($i = $NEST; $i > 0; $i--) $GLOBALS["BASE_DIR"] .= "../";
$GLOBALS["BASE_DIR"] .= $GLOBALS["BASE"]."/";
///$SequencesMode:
/// =1;//White Listed
/// =0;//Not Action
/// =-1;//Black Listed
$GLOBALS["ASEQ_Limitation"] = 0;
$GLOBALS["ASEQ_Patterns"] = array();
//Don't change the codes below:
require_once(__DIR__."/global.php");
?>