Skip to content

Commit

Permalink
Fix predb_import_daily_batch.php script (Fixes issue #970)
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIII committed Apr 15, 2019
1 parent 860a0d4 commit 3e4d822
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
2019-04-15 DariusIII
* Fix: Fix predb_import_daily_batch.php script (Fixes issue #970)
* Chg: Update package.json
* Chg: ConsoleTools now extends ColorCLI class
* Chg: Remove unused PDO class instantiation
Expand Down
11 changes: 4 additions & 7 deletions cli/data/predb_import_daily_batch.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,22 @@

$result = getDirListing($url);

$dirs = json_decode($result, true);

if ($dirs === null || (isset($dirs['message']) && strpos($dirs['message'], 'API rate limit exceeded for') === 0)) {
if ($result === null || (isset($result['message']) && strpos($result['message'], 'API rate limit exceeded for') === 0)) {
exit("Error: $result");
}

foreach ($dirs as $dir) {
foreach ($result as $dir) {
if ($dir['name'] === '0README.txt') {
continue;
}

$result = getDirListing($url.$dir['name'].'/');

$temp = json_decode($result, true);
if ($temp === null) {
if ($result === false) {
exit("Error: $result");
}

$data[$dir['name']] = $temp;
$data[$dir['name']] = $result;
}

$total = 0;
Expand Down

0 comments on commit 3e4d822

Please sign in to comment.