From 75465fa8de44f289422aef08ab345ff4ca2daa58 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Sat, 25 Jul 2015 09:51:34 +0200 Subject: [PATCH] Fix predb_daily_import_batch script. (Fix ported from nZEDb). --- .../lib/testing/predb_import_daily_batch.php | 58 ++++++++++--------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/misc/update_scripts/nix_scripts/tmux/lib/testing/predb_import_daily_batch.php b/misc/update_scripts/nix_scripts/tmux/lib/testing/predb_import_daily_batch.php index 90abb542f..f07708631 100644 --- a/misc/update_scripts/nix_scripts/tmux/lib/testing/predb_import_daily_batch.php +++ b/misc/update_scripts/nix_scripts/tmux/lib/testing/predb_import_daily_batch.php @@ -8,7 +8,7 @@ use newznab\db\Settings; use newznab\utility\Utility; $config = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . - 'config.php'; + 'config.php'; if (!is_file($config)) { @@ -19,13 +19,13 @@ unset($config); if (!Utility::isWin()) { $fullPath = DS; - $paths = preg_split('#/#', NN_RES); + $paths = preg_split('#/#', NN_RES); foreach ($paths as $path) { if ($path !== '') { $fullPath .= $path . DS; if (!is_readable($fullPath) || !is_executable($fullPath)) { exit('The (' . $fullPath . ') folder must be readable and executable by all.' . - PHP_EOL); + PHP_EOL); } } } @@ -43,19 +43,19 @@ if (!isset($argv[1]) || !is_numeric($argv[1]) && $argv[1] != 'progress' || !isse !in_array($argv[3], ['true', 'false']) ) { exit('This script quickly imports the daily PreDB dumps.' . PHP_EOL . - 'Argument 1: Enter the unix time of the patch to start at.' . PHP_EOL . - 'You can find the unix time in the file name of the patch, it\'s the long number.' . - PHP_EOL . - 'You can put in 0 to import all the daily PreDB dumps.' . PHP_EOL . - 'You can put in progress to track progress of the imports and only import newer ones.' . - PHP_EOL . - 'Argument 2: If your MySQL server is local, type local else type remote.' . PHP_EOL . - 'Argument 3: Show output of dump_predb.php or not, true | false' . PHP_EOL + 'Argument 1: Enter the unix time of the patch to start at.' . PHP_EOL . + 'You can find the unix time in the file name of the patch, it\'s the long number.' . + PHP_EOL . + 'You can put in 0 to import all the daily PreDB dumps.' . PHP_EOL . + 'You can put in progress to track progress of the imports and only import newer ones.' . + PHP_EOL . + 'Argument 2: If your MySQL server is local, type local else type remote.' . PHP_EOL . + 'Argument 3: Show output of dump_predb.php or not, true | false' . PHP_EOL ); } -$fileName = '_predb_dump.csv.gz'; -$innerUrl = 'fb2pffwwriruyco'; -$baseUrl = 'https://www.dropbox.com/sh/' . $innerUrl; +$fileName = '_predb_dump.csv.gz'; +$innerUrl = 'fb2pffwwriruyco'; +$baseUrl = 'https://www.dropbox.com/sh/' . $innerUrl; $folderUrl['url'] = $baseUrl . '/AACy9Egno_v2kcziVHuvWbbxa'; $result = Utility::getUrl($folderUrl); @@ -64,15 +64,16 @@ if (!$result) { exit('Error connecting to dropbox.com, try again later?' . PHP_EOL); } -$result = preg_match_all('/