-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
62 additions
and
52 deletions.
There are no files selected for viewing
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,25 @@ | ||
<?php | ||
require_once(__DIR__."/initialize.php"); | ||
<?php /* MiMFa aseqbase http://aseqbase.ir */ | ||
//ini_set('display_errors', 1); | ||
//ini_set('display_startup_errors', 1); | ||
//ini_set('display_startup_errors', E_ALL); | ||
|
||
/* | ||
* 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 | ||
*/ | ||
$relativePath = str_replace(str_replace(["\\","/"], DIRECTORY_SEPARATOR, $_SERVER['DOCUMENT_ROOT']), "", subject: __DIR__); | ||
$dirs = preg_split("/[\/\\\]/", trim($relativePath, "/\\")); | ||
$GLOBALS["ASEQ"] = join(".", $dirs);/* Change it to null if the file is in the root directory */ | ||
$GLOBALS["BASE"] = ".aseq";/* Change it to the base directory if deferents */ | ||
|
||
/* | ||
Change \_::$SEQUENCES | ||
newdirectory, newaseq;// Add new directory to the \_::$SEQUENCES | ||
directory, newaseq;// Update directory in the \_::$SEQUENCES | ||
directory, null;// Remove thw directory from the \_::$SEQUENCES | ||
*/ | ||
$GLOBALS["SEQUENCES_PATCH"] = array(); | ||
|
||
require_once("initialize.php"); | ||
require_once($GLOBALS["BASE_DIR"]."index.php"); | ||
?> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,50 @@ | ||
<?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; | ||
/* Don't change the codes below: */ | ||
$GLOBALS["NEST"] = empty($GLOBALS["ASEQ"])?0:preg_match_all("/(?<=\S|\s)\.(?=\S|\s)/",$ASEQ)+1; | ||
if(!isset($GLOBALS["HOST"])){ | ||
$GLOBALS["HOST"] = (isset($_SERVER['HTTPS'])?"https://":"http://"); | ||
if($NEST > 0){ | ||
$host_parts = explode(".", strtolower(trim($_SERVER["HTTP_HOST"]))); | ||
if(preg_match("/(\d+\.)+$/",$_SERVER["HTTP_HOST"])) | ||
$host_parts = explode(".", strtolower(trim($_SERVER["HTTP_HOST"]))); | ||
elseif(preg_match("/localhost$/", $_SERVER["HTTP_HOST"])) | ||
$host_parts = [...explode(".", strtolower(trim($_SERVER["HTTP_HOST"]))), ""]; | ||
else $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]; | ||
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"]."/"; | ||
$directory = __DIR__.DIRECTORY_SEPARATOR; | ||
|
||
///$SequencesMode: | ||
/// =1;//White Listed | ||
/// =0;//Not Action | ||
/// =-1;//Black Listed | ||
$GLOBALS["ASEQ_Limitation"] = 0; | ||
$GLOBALS["ASEQ_Patterns"] = array(); | ||
$GLOBALS["BASE_ROOT"] = $GLOBALS["HOST"]."/".$GLOBALS["BASE"]."/"; | ||
$GLOBALS["BASE_DIR"] = $directory; | ||
for ($i = $NEST; $i > 0; $i--) $GLOBALS["BASE_DIR"] .= "..".DIRECTORY_SEPARATOR; | ||
$GLOBALS["BASE_DIR"] .= $GLOBALS["BASE"].DIRECTORY_SEPARATOR; | ||
|
||
/* Convert sub domains to sub directories */ | ||
$aseq = $GLOBALS["NEST"]>0?preg_replace("/(?<=\S|\s)\.(?=\S|\s)/", "/", $GLOBALS["ASEQ"])."/":""; | ||
if(isset($GLOBALS["DIR"])) $GLOBALS["SEQUENCES"][$directory] = $GLOBALS["HOST"]."/".$aseq; | ||
else { | ||
$GLOBALS["ASEQBASE"] = $GLOBALS["ASEQ"]; | ||
$GLOBALS["SEQUENCES"] = array(); | ||
$GLOBALS["ROOT"] = $GLOBALS["HOST"]."/".$aseq; | ||
$GLOBALS["DIR"] = $directory; | ||
} | ||
|
||
//Don't change the codes below: | ||
require_once(__DIR__."/global.php"); | ||
/* Filter the sequences */ | ||
if(count($GLOBALS["SEQUENCES_PATCH"]) > 0){ | ||
$sequences = $GLOBALS["SEQUENCES"]; | ||
foreach($GLOBALS["SEQUENCES_PATCH"] as $newdir=>$newaseq) { | ||
$notFind = true; | ||
foreach($sequences as $dir => $aseq) | ||
if($newdir === $dir) { | ||
$notFind = false; | ||
if(empty($newaseq)) unset($GLOBALS["SEQUENCES"][$newdir]); | ||
else $GLOBALS["SEQUENCES"][$newdir] = $newaseq; | ||
} | ||
if($notFind) $GLOBALS["SEQUENCES"][$newdir] = $newaseq; | ||
} | ||
} | ||
?> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?php | ||
require_once(__DIR__."/initialize.php"); | ||
require_once("initialize.php"); | ||
require_once($GLOBALS["BASE_DIR"]."private.php"); | ||
?> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?php | ||
require_once(__DIR__."/initialize.php"); | ||
require_once("initialize.php"); | ||
require_once($GLOBALS["BASE_DIR"]."public.php"); | ||
?> |