viewing paste Unknown #24121 | PHP

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
<?php
 
ini_set('display_errors', 1);
ini_set('error_reporting', E_ALL);
 
require_once('rodb.config.php');
 
require_once('app/Db.php');
require_once('app-local/ItemsImporter.php');
require_once('app-local/MobsImporter.php');
 
if ($argc < 3) {
    die('usage: ' . $argv[0] . ' items|mobs file [renewal]'. PHP_EOL);
}
 
$importType = $argv[1];
$file = $argv[2];
$isRenewal = (isset($argv[3]) && $argv[3]) ? true : false;
 
if (!in_array($importType, array('items', 'mobs'))) {
    throw new Exception('incorrect type');
}
 
if ($importType == 'items') {
    $importer = new ItemsImporter();
} elseif ($importType == 'mobs') {
    $importer = new MobsImporter();
}
 
$importer->importFile($file, $isRenewal);
Viewed 630 times, submitted by Guest.