From 7b92de73d0d08ee86a63a72fedb676887dde282a Mon Sep 17 00:00:00 2001 From: DariusIII Date: Tue, 18 Apr 2017 13:27:36 +0200 Subject: [PATCH] Update the data/cli/populate_anidb.php script --- Changelog | 1 + cli/data/populate_anidb.php | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Changelog b/Changelog index 54b1f1cb9..a2a7ad523 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2017-04-18 DariusIII + * Chg: Update the data/cli/populate_anidb.php script * Chg: Update nntmux/db/populate/AniDB.php to properly update anidb_episodes table (still need to find a way to prevent bans) 2017-04-17 DariusIII * Chg: Update AniDB and related pages updateTitle function diff --git a/cli/data/populate_anidb.php b/cli/data/populate_anidb.php index b3015bc3d..3dc2b9bf7 100755 --- a/cli/data/populate_anidb.php +++ b/cli/data/populate_anidb.php @@ -9,11 +9,16 @@ use nntmux\db\populate\AniDB; $pdo = new DB(); -if ($argc > 1 && $argv[1] == true) { - (new AniDB(['Settings' => $pdo, 'Echo' => true]))->populateTable('full'); +if ($argc > 1 && $argv[1] === 'true' && isset($argv[2])) { + if($argv[2] === 'full') { + (new AniDB(['Settings' => $pdo, 'Echo' => true]))->populateTable('full'); + } elseif ($argv[2] === 'info'){ + (new AniDB(['Settings' => $pdo, 'Echo' => true]))->populateTable('info'); + } } else { $pdo->log->doEcho(PHP_EOL . $pdo->log->error( 'To execute this script you must provide a boolean argument.' . PHP_EOL . - 'Argument1: true|false to run this script or not'), true + 'Argument1: true|false to run this script or not' . PHP_EOL . + 'Argument2: full|info for what type of data to populate'), true ); }