@@ -87,10 +87,10 @@ public function getFileList() {
87
87
if (!file_exists ($ DOWNLOAD_DIR ."/filecache " )) {
88
88
mkdir ($ DOWNLOAD_DIR ."/filecache " ,0777 ,true );
89
89
}
90
- $ client = new Client (OPENBMCLAPI ,443 ,true );
90
+ $ client = new Client (OPENBMCLAPIURL ,443 ,true );
91
91
$ client ->set (['timeout ' => -1 ]);
92
92
$ client ->setHeaders ([
93
- 'Host ' => OPENBMCLAPI ,
93
+ 'Host ' => OPENBMCLAPIURL ,
94
94
'User-Agent ' => 'openbmclapi-cluster/ ' .$ this ->version ,
95
95
'Accept ' => '* ' ,
96
96
'Authorization ' => "Bearer {$ this ->token }"
@@ -144,7 +144,7 @@ private function downloader(Swoole\Coroutine\Http\Client $client, $file,$bar) {
144
144
'User-Agent ' => USERAGENT ,
145
145
'Accept ' => '*/* ' ,
146
146
]);
147
- $ downloadr = $ client ->download ($ location_url ['path ' ].'? ' .($ location_url ['query ' ]??'' ),$ DOWNLOAD_DIR .'/ ' .substr ($ file ->hash , 0 , 2 ).'/ ' .$ file ->hash );
147
+ $ downloader = $ client ->download ($ location_url ['path ' ].'? ' .($ location_url ['query ' ]??'' ),$ DOWNLOAD_DIR .'/ ' .substr ($ file ->hash , 0 , 2 ).'/ ' .$ file ->hash );
148
148
if (in_array ($ client ->statusCode , [301 , 302 ])) {
149
149
while (in_array ($ client ->statusCode , [301 , 302 ])){
150
150
$ location_url = parse_url ($ client ->getHeaders ()['location ' ]);
@@ -161,9 +161,9 @@ private function downloader(Swoole\Coroutine\Http\Client $client, $file,$bar) {
161
161
'User-Agent ' => USERAGENT ,
162
162
'Accept ' => '*/* ' ,
163
163
]);
164
- $ downloadr = $ client ->download ($ location_url ['path ' ].'? ' .($ location_url ['query ' ]??'' ),$ DOWNLOAD_DIR .'/ ' .substr ($ file ->hash , 0 , 2 ).'/ ' .$ file ->hash );
164
+ $ downloader = $ client ->download ($ location_url ['path ' ].'? ' .($ location_url ['query ' ]??'' ),$ DOWNLOAD_DIR .'/ ' .substr ($ file ->hash , 0 , 2 ).'/ ' .$ file ->hash );
165
165
}
166
- if (!$ downloadr ) {
166
+ if (!$ downloader ) {
167
167
echo PHP_EOL ;
168
168
mlog ("{$ file ->path } Download Failed: {$ client ->errMsg } From Node: {$ location_url ['host ' ]}: {$ location_url ['port ' ]}" ,2 );
169
169
$ bar ->progress ();
@@ -176,7 +176,7 @@ private function downloader(Swoole\Coroutine\Http\Client $client, $file,$bar) {
176
176
}
177
177
}
178
178
else {
179
- if (!$ downloadr ) {
179
+ if (!$ downloader ) {
180
180
echo PHP_EOL ;
181
181
mlog ("{$ file ->path } Download Failed: {$ client ->errMsg } From Node: {$ location_url ['host ' ]}: {$ location_url ['port ' ]}" ,2 );
182
182
$ bar ->progress ();
0 commit comments