mirror of
https://github.com/ShaYmez/FreeSTAR-Status-Engine.git
synced 2024-11-27 06:38:40 -05:00
fix error if server configs are renamed already
This commit is contained in:
parent
5374602896
commit
9ef3938e10
@ -7,17 +7,26 @@
|
|||||||
// This is needed because some hosts do not either unzip hidden files
|
// This is needed because some hosts do not either unzip hidden files
|
||||||
// or neither GitHub puts that file inside the zips.
|
// or neither GitHub puts that file inside the zips.
|
||||||
/********************************************************************/
|
/********************************************************************/
|
||||||
|
$apacheExampleName = "ApacheHtaccess";
|
||||||
|
$apacheProductionName = ".htaccess";
|
||||||
|
$iisExampleName = "IISWebConfig";
|
||||||
|
$iisProductionName = "web.config";
|
||||||
if(stripos($_SERVER['SERVER_SOFTWARE'],'apache')!== false){
|
if(stripos($_SERVER['SERVER_SOFTWARE'],'apache')!== false){
|
||||||
$f = fopen(".htaccess", "a+");
|
if(!file_exists($apacheProductionName)) {
|
||||||
$f2 = fopen("ApacheHtaccess","r");
|
$f = fopen($apacheProductionName, "a+");
|
||||||
fwrite($f, fread($f2, filesize("ApacheHtaccess")));
|
$f2 = fopen($apacheExampleName,"r");
|
||||||
fclose($f);
|
fwrite($f, fread($f2, filesize($apacheExampleName)));
|
||||||
fclose($f2);
|
fclose($f);
|
||||||
|
fclose($f2);
|
||||||
|
}
|
||||||
|
// skipping renaming file if it already exists
|
||||||
} else {
|
} else {
|
||||||
$f = fopen("web.config", "a+");
|
if(!file_exists($iisProductionName)) {
|
||||||
$f2 = fopen("IISWebConfig","r");
|
$f = fopen($iisProductionName, "a+");
|
||||||
fwrite($f, fread($f2, filesize("IISWebConfig")));
|
$f2 = fopen($iisExampleName,"r");
|
||||||
fclose($f);
|
fwrite($f, fread($f2, filesize($iisExampleName)));
|
||||||
fclose($f2);
|
fclose($f);
|
||||||
|
fclose($f2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user