Small update
[iDB-Extras.git] / webinstaller / webinstall.php
blob89e35a4ec95a9c96ada3ad8882b4853eeab6dc69
1 <?php
2 /*
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the Revised BSD License.
6 This program is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 Revised BSD License for more details.
11 Copyright 2004-2010 iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1
12 Copyright 2004-2010 Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2
14 $FileInfo: webinstall.php - Last Update: 09/24/2010 Ver 3.0 - Author: cooldude2k $
16 @ob_start();
17 // FTP Download Info
18 $FTPURL = "ftp.berlios.de";
19 $FTPUSER = "anonymous";
20 $FTPPASS = "";
21 $FTPPATH = "/pub/idb/nighty-ver/";
22 // HTTP Download Info
23 $HTTPURL = "http://download.berlios.de/idb/";
24 // File Name Info for both FTP and HTTP
25 $TARGZFILE = "iDB.tar.gz";
26 $TARFILE = "iDB.tar";
27 require_once("./untar.php");
28 $mydir = addslashes(str_replace("\\", "/", dirname(__FILE__)."/"));
29 $conn_id = ftp_connect($FTPURL, 21, 90);
30 $login_result = ftp_login($conn_id, $FTPUSER, $FTPPASS);
31 if ((!$conn_id) || (!$login_result)) {
32 $tarhandle = fopen("./".$TARGZFILE, "a+");
33 fwrite($tarhandle, file_get_contents($HTTPURL.$TARGZFILE));
34 fclose($tarhandle);
35 chmod("./".$TARGZFILE, 0777);
36 } else {
37 ftp_pasv($conn_id, true);
38 ftp_chdir($conn_id, $FTPPATH);
39 ftp_get($conn_id, "./".$TARGZFILE, "./".$TARGZFILE, FTP_BINARY);
40 ftp_close($conn_id);
42 gunzip("./".$TARGZFILE, "./".$TARFILE);
43 unlink("./".$TARGZFILE);
44 unlink("./LICENSE");
45 untar("./".$TARFILE, "./");
46 unlink("./".$TARFILE);
47 unlink("./untar.php");
48 unlink("./webinstall.php");
49 header("Location: ./install.php");