-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
c5downloader.php
221 lines (217 loc) · 12.2 KB
/
c5downloader.php
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
<?php
/*
* concrete5 CMS simple downloader
* Copyright 2021 XROSS CUBE, Inc.
*
* This script is free to re-distribute as long as you keep
* this copyright notice.
*
* Personal use is permitted.
*
* However the copyrighter holds no responsibility against
* any damages caused by using this script
* コピーライト以外の改変、再配布OK。個人利用の範囲で勝手に使ってOKです。
* その代わり当方では一切責任を負いません。
*/
define("SRC_URL","https://www.concretecms.com/download_file/29fd2f63-3f52-47d8-80a7-08be47d4ed07");
define("VERSION","9.0.0");
define("FILENAME","./concrete-cms-".VERSION.".zip");
define("DIRNAME","./concrete-cms-".VERSION);
$messages = array(
"ja" => array(
"このディレクトリにconcreteCMS Ver. ".VERSION." をダウンロードし展開します。",
"ダウンロード開始",
"このディレクトリにConcreteCMSの圧縮ファイルをダウンロード中です。",
"このディレクトリに圧縮ファイルを展開中です。",
"ダウンロード、展開しました。",
"ダウンロード、展開に失敗しました。",
'インストール画面にジャンプします。\nこのファイルは必ず削除してください。'
),
"en" => array(
"This program will download & deploy concreteCMS Ver. ".VERSION." in this directory.",
"START",
"Downloading...",
"Deploying...",
"Done!",
"Oops! Sorry, I couldn't complete the process.",
'Jump to the install page. \n- Please remove this file -'
)
//Add translated messages if you want to print your language messages.
);
$lang = "en";//default language
//check browser accept language
$accept_lang = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
foreach($accept_lang as $l){
$l = substr($l,0,2);
if(array_key_exists($l, $messages)){
$lang = $l;
break;
}
}
if(isset($_GET["step"])){
switch($_GET["step"]){
case 1:
$rfp = fopen(SRC_URL, "r");
$lfp = fopen(FILENAME,"cb");
if(!$rfp || !$lfp){
echo json_encode(0);
exit;
}else{
while($line = fgets($rfp)){
fwrite($lfp, $line);
}
fclose($rfp);
fclose($lfp);
echo json_encode(1);
}
break;
case 2:
if (function_exists('zip_open')) {
try {
$zip = new ZipArchive;
if ($zip->open(FILENAME) === TRUE) {
$zip->extractTo("./");
$zip->close();
if($dp = opendir("./".DIRNAME)){
while (($file = readdir($dp)) !== false) {
if ($file != "." && $file != "..") {
rename("./".DIRNAME."/".$file, "./".$file);
}
}
closedir($dp);
}
exec("rm -rf ./".DIRNAME);
exec("rm ./".FILENAME);
unlink(__FILE__);
echo json_encode(1);
}
} catch(Exception $e) {
echo json_encode(0);
}
exit;
}
exec("unzip ".FILENAME);
exec("mv ./".DIRNAME."/* ./");
exec("rm -rf ./".DIRNAME);
exec("rm ./".FILENAME);
unlink(__FILE__);
echo json_encode(1);
break;
default:
echo json_encode(0);
break;
}
}else{
?><!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>ConcreteCMS Ver. <?php echo VERSION; ?> Downloader</title>
<style>
body{
background: #EEE;
margin:0;
padding: 0;
}
footer{
text-align: center;
padding:21px 0;
width: 100%;
position: absolute;
bottom: 0;
}
img{
max-width: 90%;
}
a{
text-decoration: none;
color:#333;
}
.center{
text-align: center;
}
.main{
width:1000px;
max-width: 100%;
background: #FFF;
margin: 0 auto;
height: 100%;
}
.btn{
background: #0ba4d7;
color:#FFF;
text-align: center;
padding: 12px 24px;
border-radius: 24px;
margin:2em auto;
font-weight: bold;
font-size: 140%;
text-decoration: none;
transition: all 0.4s ease-in-out;
}
.btn:hover{
background: #0482ac;
}
.step{
opacity: 0;
color: #2a5b7f;
transition: all 0.4s ease-in-out;
}
</style>
</head>
<body>
<div class="main">
<div class="center" style="padding-top:10%;"><a href="http://concretecms.org/" target="_blank"><img src="https://www.concretecms.com/download_file/1751c8a1-144a-47bd-956a-4236361d02ff/2626" alt="concreteCMS" /></a></div>
<h1 class="center">Concrete CMS® Ver. <?php echo VERSION; ?> Downloader</h1>
<p class="center"><?php echo $messages[$lang][0]; ?></p>
<p style="line-height:3em;" class="center"><a href="#" class="btn start"><?php echo $messages[$lang][1]; ?></a></p>
<p class="step step1 center"><?php echo $messages[$lang][2]; ?></p>
<p class="step step2 center"><?php echo $messages[$lang][3]; ?></p>
<p class="step step3 center"><?php echo $messages[$lang][4]; ?></p>
<p class="step center loading"><img src="data:image/gif;base64,R0lGODlhIAAgAPUAAP///wAAAPr6+sTExOjo6PDw8NDQ0H5+fpqamvb29ubm5vz8/JKSkoaGhuLi4ri4uKCgoOzs7K6urtzc3D4+PlZWVmBgYHx8fKioqO7u7kpKSmxsbAwMDAAAAM7OzsjIyNjY2CwsLF5eXh4eHkxMTLCwsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAIAAgAAAG/0CAcEgkFjgcR3HJJE4SxEGnMygKmkwJxRKdVocFBRRLfFAoj6GUOhQoFAVysULRjNdfQFghLxrODEJ4Qm5ifUUXZwQAgwBvEXIGBkUEZxuMXgAJb1dECWMABAcHDEpDEGcTBQMDBQtvcW0RbwuECKMHELEJF5NF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HaX5XZUUJeQAGHR0jA0SKfVKGCmlubEhCBSGRHSQOQwVmQwsZTgtdh0UQHKIHm2quChGophuiJHO3jkwOFB2UaoYFTnMGegDKRQQG0tMGBM1nAtnaABoU3t8UD81kR+UK3eDe4nrk5grR1NLWegva9s9czfhVAgMNpWqgBGNigMGBAwzmxBGjhACEgwcgzAPTqlwGXQ8gMgAhZIGHWm5WjelUZ8jBBgPMTBgwIMGCRgsygVSkgMiHByD7DWDmx5WuMkZqDLCU4gfAq2sACrAEWFSRLjUfWDopCqDTNQIsJ1LF0yzDAA90UHV5eo0qUjB8mgUBACH5BAkKAAAALAAAAAAgACAAAAb/QIBwSCwqFIuickk0FIiCo6A4ZSoZnRBUSiwoEtYipNOBDKOKKgD9DBNHHU4brc4c3cUBeSOk949geEQUZA5rXABHEW4PD0UOZBSHaQAJiEMJgQATFBQVBkQHZKACUwtHbX0RR0mVFp0UFwRCBSQDSgsZrQteqEUPGrAQmmG9ChFqRAkMsBd4xsRLBBsUoG6nBa14E4IA2kUFDuLjDql4peilAA0H7e4H1udH8/Ps7+3xbmj0qOTj5mEWpEP3DUq3glYWOBgAcEmUaNI+DBjwAY+dS0USGJg4wABEXMYyJNvE8UOGISKVCNClah4xjg60WUKyINOCUwrMzVRARMGENWQ4n/jpNTKTm15J/CTK2e0MoD+UKmHEs4onVDVVmyqdpAbNR4cKTjqNSots07EjzzJh1S0IADsAAAAAAAAAAAA=" alt="loading..." /></p>
<p class="step step4 center"><?php echo $messages[$lang][5]; ?></p>
</div>
<footer>copyright © <?php echo date("Y");?> <a href="http://www.xross-cube.com/">XROSS CUBE, Inc.</a> All Rights Reserved.<br></footer>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
jQuery(function(){
$(".start").click(function(){
$(this).css("opacity",0);
sendRequest(1);
return false;
});
});
function sendRequest(stepNum){
$(".step"+stepNum).css("opacity",1);
$(".loading").css("opacity",1);
$.ajax({
"cache":false,
"data":{"step":stepNum},
"dataType":"json",
"url":"./c5downloader.php",
"success":function(d,t){
if(d == 1 ){
$(".step"+(stepNum+1)).css("opacity",1);
if(stepNum <= 1){
sendRequest((stepNum+1));
}else{
$(".loading").css("opacity",0);
setTimeout('gotoInstallPage()', 1000);
}
}else{
$(".loading").css("opacity",0);
$(".step4").css("opacity",1);
}
},
"error":function(){
$(".loading").css("opacity",0);
$(".step4").css("opacity",1);
}
});
}
function gotoInstallPage(){
location.href="./index.php";
}
</script>
</body>
</html><?php } ?>