| version 1.9, 2015/08/27 06:16:21 |
version 1.10, 2017/09/16 09:36:23 |
|
|
| * |
* |
| * Changelog: |
* Changelog: |
| * 2007-03-09 - created |
* 2007-03-09 - created |
| * |
* 2017-09-12 - implemented new SK-NIC-EPP/CentralNic export |
| */ |
*/ |
| |
|
| /* $Platon: scripts/php/sk-nic/sk-nic.php,v 1.8 2015/08/27 03:28:37 nepto Exp $ */ |
/* $Platon: scripts/php/sk-nic/sk-nic.php,v 1.9 2015/08/27 06:16:21 nepto Exp $ */ |
| |
|
| |
|
| error_reporting(E_ALL); |
error_reporting(E_ALL); |
| |
|
| Line 24 if (strlen($filename) <= 0) { |
|
| Line 23 if (strlen($filename) <= 0) { |
|
| printf('Usage: %s filename'."\n", $_SERVER['argv'][0]); |
printf('Usage: %s filename'."\n", $_SERVER['argv'][0]); |
| exit; |
exit; |
| } |
} |
| |
if (! file_exists($filename)) { |
| if (! file_exists($filename) || ! is_readable($filename)) { |
die("ERROR: file does not exist: $filename\n"); |
| die('File "'.$filename.'" does not exist or is not readable.'."\n"); |
} |
| |
if (! is_readable($filename)) { |
| |
die("ERROR: file is not readable: $filename\n"); |
| } |
} |
| |
|
| $dsn = 'mysql://test:test@localhost/test'; |
$dsn = 'mysql://test:test@localhost/test'; |
| Line 43 $dsn .= '?client_flags=128'; |
|
| Line 44 $dsn .= '?client_flags=128'; |
|
| $sk_nic = new SK_NIC($dsn); |
$sk_nic = new SK_NIC($dsn); |
| if (! $sk_nic->doImport($filename)) { |
if (! $sk_nic->doImport($filename)) { |
| fprintf(STDERR, "ERROR: imported file is too old; already imported?\n"); |
fprintf(STDERR, "ERROR: imported file is too old; already imported?\n"); |
| exit(1); |
exit(2); |
| } |
} |
| |
|
| $sk_nic->checkImport(); |
$sk_nic->checkImport(); |
| $sk_nic->writeStats(); |
$sk_nic->writeStats(); |
| |
|
| $changed_records = $sk_nic->doComparison(); |
$changed_records = $sk_nic->doComparison(); |
| if ($changed_records <= 100) { |
if ($changed_records <= 100) { |
| fprintf(STDERR, 'WARNING: too less changed records: %d'."\n", $changed_records); |
fprintf(STDERR, 'WARNING: too less changed records: %d'."\n", $changed_records); |