mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Remove custom logging from nntmux, laravel handles errors now
This commit is contained in:
@@ -28,9 +28,6 @@ use nntmux\db\PreDb;
|
||||
use nntmux\utility\Utility;
|
||||
|
||||
if (! Utility::isWin()) {
|
||||
if (NN_DEBUG) {
|
||||
echo "Checking resource path\n";
|
||||
}
|
||||
$canExeRead = Utility::canExecuteRead(NN_RES);
|
||||
if (is_string($canExeRead)) {
|
||||
exit($canExeRead);
|
||||
@@ -38,9 +35,6 @@ if (! Utility::isWin()) {
|
||||
unset($canExeRead);
|
||||
}
|
||||
|
||||
if (NN_DEBUG) {
|
||||
echo "Checking directory is writable\n";
|
||||
}
|
||||
if (! is_writable(NN_RES)) {
|
||||
exit('The ('.NN_RES.') folder must be writable.'.PHP_EOL);
|
||||
}
|
||||
@@ -60,17 +54,10 @@ if (! isset($argv[1]) || (! is_numeric($argv[1]) && $argv[1] !== 'progress') ||
|
||||
'Argument 3: Show output of queries or not, true | false'.PHP_EOL
|
||||
);
|
||||
}
|
||||
if (NN_DEBUG) {
|
||||
echo "Parameter check completed\n";
|
||||
}
|
||||
|
||||
$url = 'https://api.github.com/repos/nZEDb/nZEDbPre_Dumps/contents/dumps/';
|
||||
$filePattern = '(?P<filename>(?P<stamp>\d+)_predb_dump\.csv\.gz)';
|
||||
|
||||
if (NN_DEBUG) {
|
||||
echo "Fetching predb_dump directory list from GitHub\n";
|
||||
}
|
||||
|
||||
$result = getDirListing($url);
|
||||
|
||||
$dirs = json_decode($result, true);
|
||||
@@ -80,10 +67,6 @@ if (is_null($dirs) ||
|
||||
exit("Error: $result");
|
||||
}
|
||||
|
||||
if (NN_DEBUG) {
|
||||
echo "Fetching predb_dump lists from GitHub\n";
|
||||
}
|
||||
|
||||
foreach ($dirs as $dir) {
|
||||
if ($dir['name'] == '0README.txt') {
|
||||
continue;
|
||||
@@ -91,10 +74,6 @@ foreach ($dirs as $dir) {
|
||||
|
||||
$result = getDirListing($url.$dir['name'].'/');
|
||||
|
||||
if (NN_DEBUG) {
|
||||
echo "Extracting filenames from list.\n";
|
||||
}
|
||||
|
||||
$temp = json_decode($result, true);
|
||||
if (is_null($temp)) {
|
||||
exit("Error: $result");
|
||||
@@ -140,10 +119,6 @@ foreach ($data as $dir => $files) {
|
||||
echo "Error downloading dump {$match[2]} you can try manually importing it.".
|
||||
PHP_EOL;
|
||||
continue;
|
||||
} else {
|
||||
if (NN_DEBUG) {
|
||||
echo "Dump {$match[2]} downloaded\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Make sure we didn't get an HTML page.
|
||||
@@ -222,10 +197,6 @@ foreach ($data as $dir => $files) {
|
||||
} else {
|
||||
echo "Ignoring: {$file['download_url']}\n";
|
||||
}
|
||||
} else {
|
||||
if (NN_DEBUG) {
|
||||
echo "^https://raw.githubusercontent.com/nZEDb/nZEDbPre_Dumps/master/dumps/$dir/$filePattern$\n {$file['download_url']}\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user