diff --git a/bin/groupfixrelnames.php b/bin/groupfixrelnames.php index e59828afa..8a9b614d8 100644 --- a/bin/groupfixrelnames.php +++ b/bin/groupfixrelnames.php @@ -9,12 +9,12 @@ require_once(dirname(__FILE__) . '/../lib/Info.php'); require_once(dirname(__FILE__) . '/../lib/nzbcontents.php'); require_once(dirname(__FILE__) . '/../lib/MiscSorter.php'); -$pdo = new Settings(); +$pdo = new DB(); if (!isset($argv[1])) { exit($pdo->log->error("This script is not intended to be run manually, it is called from groupfixrelnames_threaded.py.")); } else if (isset($argv[1])) { - $namefixer = new \NameFixer(['Settings' => $pdo]); + $namefixer = new NameFixer(['Settings' => $pdo]); $pieces = explode(' ', $argv[1]); $guidChar = $pieces[1]; $maxperrun = $pieces[2]; @@ -137,7 +137,7 @@ if (!isset($argv[1])) { exit($pdo->log->error("Unable to connect to usenet.")); } - $Nfo = new Info(['Settings' => $pdo, 'Echo' => true]); + $Nfo = new Info(); $nzbcontents = new NZBContents( array( 'Echo' => true, 'NNTP' => $nntp, 'Nfo' => $Nfo, 'Settings' => $pdo, diff --git a/bin/monitor.php b/bin/monitor.php index c12312770..668084b75 100644 --- a/bin/monitor.php +++ b/bin/monitor.php @@ -529,7 +529,7 @@ while ($i > 0) { //check the db connection if ($db->ping(true) == false) { unset($pdo); - $db = new Settings(); + $db = new DB(); } //kill mediainfo and ffmpeg if exceeds 60 sec shell_exec("killall -o 60s -9 mediainfo 2>&1 1> /dev/null"); diff --git a/bin/postprocess_new.php b/bin/postprocess_new.php index 9bf98a5d6..a09cbf507 100644 --- a/bin/postprocess_new.php +++ b/bin/postprocess_new.php @@ -12,7 +12,7 @@ require_once(dirname(__FILE__) . '/../lib/TvAnger.php'); require_once(dirname(__FILE__) . '/../lib/Pprocess.php'); require_once(dirname(__FILE__) . '/../lib/Info.php'); -$pdo = new Settings(); +$pdo = new DB(); /** Array with possible arguments for run and whether or not those methods of operation require NNTP diff --git a/lib/IRCScraper.php b/lib/IRCScraper.php index b69ad53b5..7f81436ba 100644 --- a/lib/IRCScraper.php +++ b/lib/IRCScraper.php @@ -120,7 +120,7 @@ class IRCScraper extends IRCClient $this->_titleIgnoreRegex = SCRAPE_IRC_TITLE_IGNORE; } - $this->_pdo = new Settings(); + $this->_pdo = new DB(); $this->_groupList = array(); $this->_silent = $silent; $this->_debug = $debug; diff --git a/lib/Pprocess.php b/lib/Pprocess.php index d03db4fde..76d6d7c40 100644 --- a/lib/Pprocess.php +++ b/lib/Pprocess.php @@ -108,16 +108,15 @@ class PProcess $options += $defaults; //\\ Various. - $this->echooutput = ($options['Echo'] && nZEDb_ECHOCLI); + $this->echooutput = ($options['Echo'] && NN_ECHOCLI); //\\ //\\ Class instances. - $this->pdo = (($options['Settings'] instanceof Settings) ? $options['Settings'] : new Settings()); - $this->groups = (($options['Groups'] instanceof Groups) ? $options['Groups'] : new Groups(['Settings' => $this->pdo])); + $this->pdo = (($options['Settings'] instanceof DB) ? $options['Settings'] : new DB(['Settings' => $this->pdo])); $this->_par2Info = new Par2Info(); $this->debugging = ($options['Logger'] instanceof Logger ? $options['Logger'] : new Logger(['ColorCLI' => $this->pdo->log])); $this->nameFixer = (($options['NameFixer'] instanceof NameFixer) ? $options['NameFixer'] : new NameFixer(['Echo' => $this->echooutput, 'Settings' => $this->pdo, 'Groups' => $this->groups])); - $this->Nfo = (($options['Nfo'] instanceof Info ) ? $options['Nfo'] : new Info(['Echo' => $this->echooutput, 'Settings' => $this->pdo])); + $this->Nfo = (($options['Nfo'] instanceof Info ) ? $options['Nfo'] : new Info()); $this->releaseFiles = (($options['ReleaseFiles'] instanceof ReleaseFiles) ? $options['ReleaseFiles'] : new ReleaseFiles($this->pdo)); //\\ diff --git a/lib/ProcessAdditional.php b/lib/ProcessAdditional.php index f9e238a9c..dea9e5c3f 100644 --- a/lib/ProcessAdditional.php +++ b/lib/ProcessAdditional.php @@ -302,7 +302,7 @@ Class ProcessAdditional $this->_echoCLI = ($options['Echo'] && NN_ECHOCLI && (strtolower(PHP_SAPI) === 'cli')); $this->_echoDebug = NN_DEBUG; - $this->pdo = ($options['Settings'] instanceof Settings ? $options['Settings'] : new Settings()); + $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); $this->_nntp = ($options['NNTP'] instanceof NNTP ? $options['NNTP'] : new NNTP(['Echo' => $this->_echoCLI, 'Settings' => $this->pdo])); $this->_nzb = ($options['NZB'] instanceof NZB ? $options['NZB'] : new NZB($this->pdo)); @@ -315,7 +315,7 @@ Class ProcessAdditional $this->_releaseImage = ($options['ReleaseImage'] instanceof ReleaseImage ? $options['ReleaseImage'] : new ReleaseImage($this->pdo)); $this->_par2Info = new Par2Info(); $this->utility = new Utility(); - $this->_nfo = ($options['Nfo'] instanceof Info ? $options['Nfo'] : new Info(['Echo' => $this->_echoCLI, 'Settings' => $this->pdo])); + $this->_nfo = ($options['Nfo'] instanceof Info ? $options['Nfo'] : new Info()); $this->_innerFileBlacklist = ($this->pdo->getSetting('innerfileblacklist') == '' ? false : $this->pdo->getSetting('innerfileblacklist')); $this->_maxNestedLevels = ($this->pdo->getSetting('maxnestedlevels') == 0 ? 3 : $this->pdo->getSetting('maxnestedlevels')); diff --git a/lib/copy_this/www/lib/XXX.php b/lib/copy_this/www/lib/XXX.php index 6ce3b02c9..739cf2726 100644 --- a/lib/copy_this/www/lib/XXX.php +++ b/lib/copy_this/www/lib/XXX.php @@ -68,8 +68,8 @@ class XXX ]; $options += $defaults; - $this->pdo = ($options['Settings'] instanceof Settings ? $options['Settings'] : new Settings()); - $this->releaseImage = ($options['ReleaseImage'] instanceof \ReleaseImage ? $options['ReleaseImage'] : new \ReleaseImage($this->pdo)); + $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); + $this->releaseImage = ($options['ReleaseImage'] instanceof \ReleaseImage ? $options['ReleaseImage'] : new ReleaseImage($this->pdo)); $this->movieqty = ($this->pdo->getSetting('maxxxxprocessed') != '') ? $this->pdo->getSetting('maxxxxprocessed') : 100; $this->showPasswords = ($this->pdo->getSetting('showpasswordedrelease') != '') ? $this->pdo->getSetting('showpasswordedrelease') : 0; diff --git a/lib/copy_this/www/lib/nntp.php b/lib/copy_this/www/lib/nntp.php index d26c4a66b..cd77c15f6 100644 --- a/lib/copy_this/www/lib/nntp.php +++ b/lib/copy_this/www/lib/nntp.php @@ -113,7 +113,7 @@ class NNTP extends Net_NNTP_Client $this->_echo = ($options['Echo'] && NN_ECHOCLI); - $this->pdo = ($options['Settings'] instanceof Settings ? $options['Settings'] : new Settings()); + $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); $this->utility = new Utility(); $this->_debugBool = (NN_LOGGING || NN_DEBUG); diff --git a/lib/namefixer.php b/lib/namefixer.php index 493c4c037..eabc3f1a6 100644 --- a/lib/namefixer.php +++ b/lib/namefixer.php @@ -152,7 +152,7 @@ class NameFixer $this->echooutput = ($options['Echo'] && NN_ECHOCLI); $this->relid = $this->fixed = $this->checked = 0; - $this->pdo = ($options['Settings'] instanceof Settings ? $options['Settings'] : new Settings()); + $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); $this->timeother = ' AND rel.adddate > (NOW() - INTERVAL 0 HOUR) AND rel.categoryID IN (1090, 2020, 3050, 6050, 5050, 7050, 8010) GROUP BY rel.ID ORDER BY postdate DESC'; $this->timeall = ' AND rel.adddate > (NOW() - INTERVAL 6 HOUR) GROUP BY rel.ID ORDER BY postdate DESC'; $this->fullother = ' AND rel.categoryID IN (1090, 2020, 3050, 6050, 5050, 7050, 8010) GROUP BY rel.ID'; diff --git a/lib/prehash.php b/lib/prehash.php index 30920388d..7e370ec40 100644 --- a/lib/prehash.php +++ b/lib/prehash.php @@ -57,7 +57,7 @@ Class PreHash $options += $defaults; $this->echooutput = ($options['Echo'] && NN_ECHOCLI); - $this->pdo = ($options['Settings'] instanceof Settings ? $options['Settings'] : new Settings()); + $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); } /**