-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebinstall.php
More file actions
49 lines (46 loc) · 1.71 KB
/
webinstall.php
File metadata and controls
49 lines (46 loc) · 1.71 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the Revised BSD License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Revised BSD License for more details.
Copyright 2004-2010 iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1
Copyright 2004-2010 Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2
$FileInfo: webinstall.php - Last Update: 09/24/2010 Ver 3.0 - Author: cooldude2k $
*/
@ob_start();
// FTP Download Info
$FTPURL = "ftp.berlios.de";
$FTPUSER = "anonymous";
$FTPPASS = "";
$FTPPATH = "/pub/idb/nighty-ver/";
// HTTP Download Info
$HTTPURL = "http://download.berlios.de/idb/";
// File Name Info for both FTP and HTTP
$TARGZFILE = "iDB.tar.gz";
$TARFILE = "iDB.tar";
require_once("./untar.php");
$mydir = addslashes(str_replace("\\", "/", dirname(__FILE__)."/"));
$conn_id = ftp_connect($FTPURL, 21, 90);
$login_result = ftp_login($conn_id, $FTPUSER, $FTPPASS);
if ((!$conn_id) || (!$login_result)) {
$tarhandle = fopen("./".$TARGZFILE, "a+");
fwrite($tarhandle, file_get_contents($HTTPURL.$TARGZFILE));
fclose($tarhandle);
chmod("./".$TARGZFILE, 0777);
} else {
ftp_pasv($conn_id, true);
ftp_chdir($conn_id, $FTPPATH);
ftp_get($conn_id, "./".$TARGZFILE, "./".$TARGZFILE, FTP_BINARY);
ftp_close($conn_id);
}
gunzip("./".$TARGZFILE, "./".$TARFILE);
unlink("./".$TARGZFILE);
unlink("./LICENSE");
untar("./".$TARFILE, "./");
unlink("./".$TARFILE);
unlink("./untar.php");
unlink("./webinstall.php");
header("Location: ./install.php");