Update the data/cli/populate_anidb.php script

This commit is contained in:
DariusIII
2017-04-18 13:27:36 +02:00
parent 3b303292b9
commit 7b92de73d0
2 changed files with 9 additions and 3 deletions
+1
View File
@@ -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
+8 -3
View File
@@ -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
);
}