Skip to content

Commit 4e0a209

Browse files
committed
Fixed: FS#2431 - APS list update failed.
1 parent 624055a commit 4e0a209

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

interface/lib/classes/aps_crawler.inc.php

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,12 @@ private function fetchFiles($input)
200200
* A method to build query URLs out of a list of vendors
201201
*
202202
*/
203-
private function formatVendorCallback($array_item, $key)
203+
private function formatVendorCallback($array_item)
204204
{
205205
$array_item = str_replace(' ', '%20', $array_item);
206206
$array_item = str_replace('http://', '', $array_item);
207207
$array_item = '/'.$this->aps_version.'.atom?vendor='.$array_item.'&pageSize=100';
208+
return($array_item);
208209
}
209210

210211
/**
@@ -227,7 +228,12 @@ public function startCrawler()
227228
if(!$vendors) throw new Exception('Unable to fetch vendors. Aborting');
228229

229230
// Format all vendors for further processing (i.e. typo3.org -> /1.atom?vendor=typo3.org&pageSize=100
230-
array_walk($vendors, array($this, 'formatVendorCallback'));
231+
//array_walk($vendors, array($this, 'formatVendorCallback'));
232+
if(is_array($vendors)) {
233+
foreach($vendors as $key => $array_item) {
234+
$vendors[$key] = $this->formatVendorCallback($array_item);
235+
}
236+
}
231237

232238
// Process all vendors in chunks of 50 entries
233239
$vendor_chunks = array_chunk($vendors, 50);
@@ -273,9 +279,16 @@ public function startCrawler()
273279

274280
// Find out a (possibly) existing package version
275281
$ex_ver = '';
282+
/*
276283
array_walk($existing_apps,
277-
create_function('$v, $k, $ex_ver', 'if($v["Name"] == "'.$app_name.'") $ex_ver = $v["CurrentVersion"];'), $ex_ver);
278-
284+
create_function('$v, $k, $ex_ver', 'if($v["Name"] == "'.$app_name.'") $ex_ver = $v["CurrentVersion"];'), &$ex_ver);
285+
*/
286+
if(is_array($existing_apps)) {
287+
foreach($existing_apps as $k => $v) {
288+
if($v["Name"] == $app_name) $ex_ver = $v["CurrentVersion"];
289+
}
290+
}
291+
279292
$new_ver = $app_version.'-'.$app_release;
280293
$local_intf_folder = $this->interface_pkg_dir.'/'.$app_name.'-'.$new_ver.'.app.zip/';
281294

0 commit comments

Comments
 (0)