Created
July 16, 2009 19:16
-
-
Save anonymous/148634 to your computer and use it in GitHub Desktop.
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
<? | |
// install.sgz package should be in this directory | |
include("backup.php"); | |
set_time_limit(0); | |
if(!is_writable("backup.php")){ | |
echo "Plik backup.php nie ma uprawnień do zapisu!"; | |
exit; | |
} | |
if(!is_writable("install.php")){ | |
echo "Plik install.php nie ma uprawnień do zapisu!"; | |
exit; | |
} | |
if(!is_writable("server_check.php")){ | |
echo "Plik server_check.php nie ma uprawnień do zapisu!"; | |
exit; | |
} | |
if(is_writable(".")){ | |
if($_GET['checked']==1){ | |
ini_set("allow_url_fopen", 1); | |
if($_GET['nozend']==1){ | |
$package = "install.sgz"; | |
}else{ | |
$package = "install-zend.sgz"; | |
} | |
$fp = fopen("http://update.estore.pl/install/".$package, "rb"); | |
$fh = fopen("install.sgz", "wb"); | |
while(!feof($fp)){ | |
$bytes = fread($fp, 262144); | |
fwrite($fh, $bytes, strlen($bytes)); | |
} | |
fclose($fp); | |
fclose($fh); | |
$d= new Decompressor(); | |
$d->setBasedir("./"); | |
$d->setArchive("install.sgz"); | |
$d->decompress(); | |
$path = explode("install.php", $_SERVER["REQUEST_URI"]); | |
unlink("install.sgz"); | |
unlink("install.php"); | |
unlink("server_check.php"); | |
unlink("backup.php"); | |
header("location: http://".$_SERVER["SERVER_NAME"].$path[0]."_install/index.php"); | |
}else{ | |
include("server_check.php"); | |
} | |
}else{ | |
echo "Brak uprawnień do zapisu w głównym katalogu. Proces instalacji przerwany"; | |
exit; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment