diff --git a/.env.example b/.env.example index 452d55335..904af6574 100644 --- a/.env.example +++ b/.env.example @@ -67,17 +67,5 @@ RECAPTCHA_SECRETKEY= MYCELIUM_GATEWAY_ID= MYCELIUM_GATEWAY_SECRET= - -ITEMS_PER_PAGE=50 -ITEMS_PER_COVER_PAGE=20 -MAX_PAGER_RESULTS=125000 -FLOOD_CHECK=false -FLOOD_WAIT_TIME=5 -FLOOD_MAX_REQUESTS_PER_SECOND=5 - -ECHOCLI=true -RENAME_PAR2=true -RENAME_MUSIC_MEDIAINFO=true - SCOUT_DRIVER=mysql SCOUT_QUEUE=false diff --git a/Blacklight/Backfill.php b/Blacklight/Backfill.php index b804d1391..653de2694 100755 --- a/Blacklight/Backfill.php +++ b/Blacklight/Backfill.php @@ -77,7 +77,7 @@ class Backfill ]; $options += $defaults; - $this->_echoCLI = ($options['Echo'] && env('echocli', true)); + $this->_echoCLI = ($options['Echo'] && config('nntmux.echocli')); $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); $this->_nntp = ( diff --git a/Blacklight/Binaries.php b/Blacklight/Binaries.php index 595f0297d..99a268f6c 100755 --- a/Blacklight/Binaries.php +++ b/Blacklight/Binaries.php @@ -249,7 +249,7 @@ class Binaries ]; $options += $defaults; - $this->_echoCLI = ($options['Echo'] && env('echocli', true)); + $this->_echoCLI = ($options['Echo'] && config('nntmux.echocli')); $this->_pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); $this->_colorCLI = ($options['ColorCLI'] instanceof ColorCLI ? $options['ColorCLI'] : new ColorCLI()); @@ -1736,7 +1736,7 @@ class Binaries } $poster = MultigroupPoster::query()->get(['poster'])->toArray(); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_SHORT); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_short')); Cache::put('mgrposter', $poster, $expiresAt); return $poster; diff --git a/Blacklight/Books.php b/Blacklight/Books.php index 393416691..9434cf0cc 100755 --- a/Blacklight/Books.php +++ b/Blacklight/Books.php @@ -87,7 +87,7 @@ class Books ]; $options += $defaults; - $this->echooutput = ($options['Echo'] && env('echocli', true)); + $this->echooutput = ($options['Echo'] && config('nntmux.echocli')); $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); $this->pubkey = Settings::settingValue('APIs..amazonpubkey'); @@ -187,7 +187,7 @@ class Books $order[1], ($start === false ? '' : ' LIMIT '.$num.' OFFSET '.$start) ); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_MEDIUM); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); $bookscache = Cache::get(md5($booksql)); if ($bookscache !== null) { $books = $bookscache; diff --git a/Blacklight/Console.php b/Blacklight/Console.php index d314e2cab..6a218996b 100755 --- a/Blacklight/Console.php +++ b/Blacklight/Console.php @@ -96,7 +96,7 @@ class Console ]; $options += $defaults; - $this->echooutput = ($options['Echo'] && env('echocli', true)); + $this->echooutput = ($options['Echo'] && config('nntmux.echocli')); $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); $this->pubkey = Settings::settingValue('APIs..amazonpubkey'); @@ -201,7 +201,7 @@ class Console $consoles = $cached; } else { $consoles = $this->pdo->queryCalc($calcSql); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_MEDIUM); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); Cache::put(md5($calcSql), $consoles, $expiresAt); } @@ -264,7 +264,7 @@ class Console $return[0]['_totalcount'] = $consoles['total'] ?? 0; } - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_LONG); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_long')); Cache::put(md5($sql), $return, $expiresAt); return $return; diff --git a/Blacklight/Games.php b/Blacklight/Games.php index 00289a908..d6c1b951c 100755 --- a/Blacklight/Games.php +++ b/Blacklight/Games.php @@ -120,7 +120,7 @@ class Games 'Settings' => null, ]; $options += $defaults; - $this->echoOutput = ($options['Echo'] && env('echocli', true)); + $this->echoOutput = ($options['Echo'] && config('nntmux.echocli')); $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); @@ -270,7 +270,7 @@ class Games ($start === false ? '' : ' LIMIT '.$num.' OFFSET '.$start) ); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_MEDIUM); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); $gamesCache = Cache::get(md5($gamesSql)); if ($gamesCache !== null) { $games = $gamesCache; diff --git a/Blacklight/Genres.php b/Blacklight/Genres.php index 33f0c4d49..84769df0d 100755 --- a/Blacklight/Genres.php +++ b/Blacklight/Genres.php @@ -49,7 +49,7 @@ class Genres return $genres; } $genres = $this->pdo->query($sql); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_LONG); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_long')); Cache::put(md5($sql), $genres, $expiresAt); return $genres; @@ -186,7 +186,7 @@ class Genres $disabled = $cats; } else { $disabled = Genre::query()->where('disabled', '=', 1)->get(['id']); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_LONG); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_long')); Cache::put('disabledcats', $disabled, $expiresAt); } diff --git a/Blacklight/IRCScraper.php b/Blacklight/IRCScraper.php index b3affb018..bb077627c 100755 --- a/Blacklight/IRCScraper.php +++ b/Blacklight/IRCScraper.php @@ -72,9 +72,9 @@ class IRCScraper extends IRCClient */ public function __construct(&$silent, &$debug) { - if (defined('SCRAPE_IRC_SOURCE_IGNORE')) { + if (config('irc_settings.scrape_irc_source_ignore')) { $this->_ignoredChannels = unserialize( - SCRAPE_IRC_SOURCE_IGNORE, + config('irc_settings.scrape_irc_source_ignore'), ['allowed_classes' => ['#a.b.cd.image', '#a.b.console.ps3', '#a.b.dvd', @@ -124,12 +124,12 @@ class IRCScraper extends IRCClient } $this->_categoryIgnoreRegex = false; - if (defined('SCRAPE_IRC_CATEGORY_IGNORE') && SCRAPE_IRC_CATEGORY_IGNORE !== '') { - $this->_categoryIgnoreRegex = SCRAPE_IRC_CATEGORY_IGNORE; + if (config('irc_settings.scrape_irc_category_ignore') !== '') { + $this->_categoryIgnoreRegex = config('irc_settings.scrape_irc_category_ignore'); } $this->_titleIgnoreRegex = false; - if (defined('SCRAPE_IRC_TITLE_IGNORE') && SCRAPE_IRC_TITLE_IGNORE !== '') { + if (config('irc_settings.scrape_irc_title_ignore') !== '') { $this->_titleIgnoreRegex = SCRAPE_IRC_TITLE_IGNORE; } @@ -153,28 +153,28 @@ class IRCScraper extends IRCClient { // Connect to IRC. - if ($this->connect(SCRAPE_IRC_SERVER, SCRAPE_IRC_PORT, SCRAPE_IRC_TLS) === false) { + if ($this->connect(config('irc_settings.scrape_irc_server'), config('irc_settings.scrape_irc_port'), config('irc_settings.scrape_irc_tls')) === false) { exit( 'Error connecting to ('. - SCRAPE_IRC_SERVER. + config('irc_settings.scrape_irc_server'). ':'. - SCRAPE_IRC_PORT. + config('irc_settings.scrape_irc_port'). '). Please verify your server information and try again.'. PHP_EOL ); } // Login to IRC. - if ($this->login(SCRAPE_IRC_NICKNAME, SCRAPE_IRC_REALNAME, SCRAPE_IRC_USERNAME, SCRAPE_IRC_PASSWORD) === false) { + if ($this->login(config('irc_settings.scrape_irc_nickname'), config('irc_settings.scrape_irc_realname'), config('irc_settings.scrape_irc_username'), config('irc_settings.scrape_irc_password')) === false) { exit('Error logging in to: ('. - SCRAPE_IRC_SERVER.':'.SCRAPE_IRC_PORT.') nickname: ('.SCRAPE_IRC_NICKNAME. + config('irc_settings.scrape_irc_server').':'.config('irc_settings.scrape_irc_port').') nickname: ('.config('irc_settings.scrape_irc_nickname'). '). Verify your connection information, you might also be banned from this server or there might have been a connection issue.'. PHP_EOL ); } // Join channels. - $channels = defined('SCRAPE_IRC_CHANNELS') ? unserialize(SCRAPE_IRC_CHANNELS, ['allowed_classes' => ['#PreNNTmux', '#nZEDbPRE']]) : ['#PreNNTmux' => null]; + $channels = config('irc_settings.scrape_irc_channels') ? unserialize(config('irc_settings.scrape_irc_channels'), ['allowed_classes' => ['#PreNNTmux', '#nZEDbPRE']]) : ['#PreNNTmux' => null]; $this->joinChannels($channels); if (! $this->_silent) { @@ -182,11 +182,11 @@ class IRCScraper extends IRCClient '['. date('r'). '] [Scraping of IRC channels for ('. - SCRAPE_IRC_SERVER. + config('irc_settings.scrape_irc_server'). ':'. - SCRAPE_IRC_PORT. + config('irc_settings.scrape_irc_port'). ') ('. - SCRAPE_IRC_NICKNAME. + config('irc_settings.scrape_irc_nickname'). ') started.]'. PHP_EOL; } diff --git a/Blacklight/MiscSorter.php b/Blacklight/MiscSorter.php index ab0bed207..dbe9300df 100755 --- a/Blacklight/MiscSorter.php +++ b/Blacklight/MiscSorter.php @@ -65,7 +65,7 @@ class MiscSorter */ public function __construct($echooutput = false, &$pdo) { - $this->echooutput = (env('echocli', true) && $echooutput); + $this->echooutput = (config('nntmux.echocli') && $echooutput); $this->pdo = ($pdo instanceof DB ? $pdo : new DB()); $this->movie = new Movie(['Echo' => $this->echooutput, 'Settings' => $this->pdo]); diff --git a/Blacklight/Movie.php b/Blacklight/Movie.php index 0c70e0d22..fdd1b924d 100755 --- a/Blacklight/Movie.php +++ b/Blacklight/Movie.php @@ -244,7 +244,7 @@ class Movie $this->searchEngines = true; $this->showPasswords = Releases::showPasswords(); - $this->echooutput = ($options['Echo'] && env('echocli', true) && $this->pdo->cli); + $this->echooutput = ($options['Echo'] && config('nntmux.echocli') && $this->pdo->cli); $this->imgSavePath = NN_COVERS.'movies'.DS; $this->service = ''; } @@ -279,7 +279,7 @@ class Movie } $order = $this->getMovieOrder($orderBy); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_MEDIUM); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); $moviesSql = sprintf( diff --git a/Blacklight/Music.php b/Blacklight/Music.php index 950d6d1d2..2847bd67f 100755 --- a/Blacklight/Music.php +++ b/Blacklight/Music.php @@ -86,7 +86,7 @@ class Music ]; $options += $defaults; - $this->echooutput = ($options['Echo'] && env('echocli', true)); + $this->echooutput = ($options['Echo'] && config('nntmux.echocli')); $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); $this->pubkey = Settings::settingValue('APIs..amazonpubkey'); @@ -162,7 +162,7 @@ class Music } $order = $this->getMusicOrder($orderby); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_MEDIUM); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); $musicSql = sprintf( diff --git a/Blacklight/NNTP.php b/Blacklight/NNTP.php index 04cf67dc2..93da44fa3 100755 --- a/Blacklight/NNTP.php +++ b/Blacklight/NNTP.php @@ -98,7 +98,7 @@ class NNTP extends \Net_NNTP_Client parent::__construct(); - $this->_echo = ($options['Echo'] && env('echocli', true)); + $this->_echo = ($options['Echo'] && config('nntmux.echocli')); $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); diff --git a/Blacklight/NZBContents.php b/Blacklight/NZBContents.php index 937db022e..1f9587aa0 100755 --- a/Blacklight/NZBContents.php +++ b/Blacklight/NZBContents.php @@ -82,7 +82,7 @@ class NZBContents ]; $options += $defaults; - $this->echooutput = ($options['Echo'] && env('echocli', true)); + $this->echooutput = ($options['Echo'] && config('nntmux.echocli')); $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); $this->nntp = ($options['NNTP'] instanceof NNTP ? $options['NNTP'] : new NNTP(['Echo' => $this->echooutput, 'Settings' => $this->pdo])); $this->nfo = ($options['Nfo'] instanceof Nfo ? $options['Nfo'] : new Nfo()); diff --git a/Blacklight/NZBExport.php b/Blacklight/NZBExport.php index 794687a73..2f76b72af 100755 --- a/Blacklight/NZBExport.php +++ b/Blacklight/NZBExport.php @@ -58,7 +58,7 @@ class NZBExport $options += $defaults; $this->browser = $options['Browser']; - $this->echoCLI = (! $this->browser && env('echocli', true) && $options['Echo']); + $this->echoCLI = (! $this->browser && config('nntmux.echocli') && $options['Echo']); $this->pdo = ($options['Settings'] instanceof DB ? $options['Setting'] : new DB()); $this->releases = ($options['Releases'] instanceof Releases ? $options['Releases'] : new Releases(['Settings' => $this->pdo])); $this->nzb = ($options['NZB'] instanceof NZB ? $options['NZB'] : new NZB()); diff --git a/Blacklight/NZBImport.php b/Blacklight/NZBImport.php index f3add906a..ea2e7cfbc 100755 --- a/Blacklight/NZBImport.php +++ b/Blacklight/NZBImport.php @@ -108,7 +108,7 @@ class NZBImport ]; $options += $defaults; - $this->echoCLI = (! $this->browser && env('echocli', true) && $options['Echo']); + $this->echoCLI = (! $this->browser && config('nntmux.echocli') && $options['Echo']); $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); $this->binaries = ($options['Binaries'] instanceof Binaries ? $options['Binaries'] : new Binaries(['Settings' => $this->pdo, 'Echo' => $this->echoCLI])); $this->category = ($options['Categorize'] instanceof Categorize ? $options['Categorize'] : new Categorize(['Settings' => $this->pdo])); diff --git a/Blacklight/NameFixer.php b/Blacklight/NameFixer.php index 4d8248f50..2b9df8737 100755 --- a/Blacklight/NameFixer.php +++ b/Blacklight/NameFixer.php @@ -159,7 +159,7 @@ class NameFixer ]; $options += $defaults; - $this->echooutput = ($options['Echo'] && env('echocli', true)); + $this->echooutput = ($options['Echo'] && config('nntmux.echocli')); $this->relid = $this->fixed = $this->checked = 0; $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); $this->othercats = implode(',', Category::OTHERS_GROUP); diff --git a/Blacklight/Nfo.php b/Blacklight/Nfo.php index 7f16316d4..7e93c613a 100755 --- a/Blacklight/Nfo.php +++ b/Blacklight/Nfo.php @@ -64,7 +64,7 @@ class Nfo */ public function __construct() { - $this->echo = env('echocli', true); + $this->echo = config('nntmux.echocli'); $this->nzbs = Settings::settingValue('..maxnfoprocessed') !== '' ? (int) Settings::settingValue('..maxnfoprocessed') : 100; $this->maxRetries = (int) Settings::settingValue('..maxnforetries') >= 0 ? -((int) Settings::settingValue('..maxnforetries') + 1) : self::NFO_UNPROC; $this->maxRetries = $this->maxRetries < -8 ? -8 : $this->maxRetries; diff --git a/Blacklight/Regexes.php b/Blacklight/Regexes.php index e01261e8d..010761a02 100755 --- a/Blacklight/Regexes.php +++ b/Blacklight/Regexes.php @@ -326,7 +326,7 @@ class Regexes protected function _fetchRegex($groupName): void { // Check if we need to do an initial cache or refresh our cache. - if (isset($this->_regexCache[$groupName]['ttl']) && (time() - $this->_regexCache[$groupName]['ttl']) < NN_CACHE_EXPIRY_LONG) { + if (isset($this->_regexCache[$groupName]['ttl']) && (time() - $this->_regexCache[$groupName]['ttl']) < config('nntmux.cache_expiry_long')) { return; } @@ -339,7 +339,7 @@ class Regexes $this->pdo->escapeString($groupName) ), true, - NN_CACHE_EXPIRY_LONG + config('nntmux.cache_expiry_long') ); // Set the TTL. $this->_regexCache[$groupName]['ttl'] = time(); diff --git a/Blacklight/ReleaseRemover.php b/Blacklight/ReleaseRemover.php index 4425fc30f..68602d287 100755 --- a/Blacklight/ReleaseRemover.php +++ b/Blacklight/ReleaseRemover.php @@ -143,7 +143,7 @@ class ReleaseRemover $this->error = ''; $this->ignoreUserCheck = false; $this->browser = $options['Browser']; - $this->echoCLI = (! $this->browser && env('echocli', true) && $options['Echo']); + $this->echoCLI = (! $this->browser && config('nntmux.echocli') && $options['Echo']); } /** diff --git a/Blacklight/Releases.php b/Blacklight/Releases.php index 7d386445d..db2324b44 100755 --- a/Blacklight/Releases.php +++ b/Blacklight/Releases.php @@ -97,7 +97,7 @@ class Releases return $count; } $count = $this->pdo->query($sql); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_SHORT); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_short')); Cache::put(md5($sql), $count[0]['count'], $expiresAt); return $count[0]['count'] ?? 0; @@ -170,7 +170,7 @@ class Releases $possibleRows = $this->getBrowseCount($cat, $maxAge, $excludedCats, $groupName); $sql[0]['_totalcount'] = $sql[0]['_totalrows'] = $possibleRows; } - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_MEDIUM); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); Cache::put(md5($qry), $sql, $expiresAt); return $sql; @@ -395,7 +395,7 @@ class Releases $this->concatenatedCategoryIDsCache = $result[0]['category_ids']; } } - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_LONG); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_long')); Cache::put('concatenatedcats', $this->concatenatedCategoryIDsCache, $expiresAt); return $this->concatenatedCategoryIDsCache; @@ -456,7 +456,7 @@ class Releases $releases = $this->pdo->query($sql); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_MEDIUM); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); Cache::put(md5($sql), $releases, $expiresAt); return $releases; @@ -754,7 +754,7 @@ class Releases $releases[0]['_totalrows'] = $this->getPagerCount($baseSql); } - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_MEDIUM); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); Cache::put(md5($sql), $releases, $expiresAt); return $releases; @@ -906,7 +906,7 @@ class Releases preg_replace('#LEFT(\s+OUTER)?\s+JOIN\s+(?!tv_episodes)\s+.*ON.*=.*\n#i', ' ', $baseSql) ); } - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_MEDIUM); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); Cache::put(md5($sql), $releases, $expiresAt); return $releases; @@ -974,7 +974,7 @@ class Releases if (! empty($releases) && \count($releases)) { $releases[0]['_totalrows'] = $this->getPagerCount($baseSql); } - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_MEDIUM); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); Cache::put(md5($sql), $releases, $expiresAt); return $releases; @@ -1044,7 +1044,7 @@ class Releases if (! empty($releases) && \count($releases)) { $releases[0]['_totalrows'] = $this->getPagerCount($baseSql); } - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_MEDIUM); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); Cache::put(md5($sql), $releases, $expiresAt); return $releases; @@ -1062,7 +1062,7 @@ class Releases $sql = sprintf( 'SELECT COUNT(z.id) AS count FROM (%s LIMIT %s) z', preg_replace('/SELECT.+?FROM\s+releases/is', 'SELECT r.id FROM releases', $query), - env('MAX_PAGER_RESULTS', 125000) + config('nntmux.max_pager_results' ); $count = Cache::get(md5($sql)); @@ -1072,7 +1072,7 @@ class Releases $count = $this->pdo->query($sql); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_SHORT); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_short')); Cache::put(md5($sql), $count[0]['count'], $expiresAt); return $count[0]['count'] ?? 0; diff --git a/Blacklight/Sharing.php b/Blacklight/Sharing.php index 57300d490..6ff548897 100755 --- a/Blacklight/Sharing.php +++ b/Blacklight/Sharing.php @@ -310,7 +310,7 @@ class Sharing ) ); } - if (env('echocli', true)) { + if (config('nntmux.echocli')) { echo "(Sharing) Matched $found comments.".PHP_EOL; } } @@ -375,7 +375,7 @@ class Sharing return; } - if (env('echocli', true)) { + if (config('nntmux.echocli')) { echo '(Sharing) Starting to fetch new comments.'.PHP_EOL; } @@ -479,7 +479,7 @@ class Sharing ) ); $found++; - if (env('echocli', true)) { + if (config('nntmux.echocli')) { echo '.'; if ($found % 40 == 0) { echo '['.$found.']'.PHP_EOL; @@ -501,7 +501,7 @@ class Sharing $this->pdo->queryExec(sprintf('UPDATE sharing SET last_article = %d', $currentArticle)); } - if (env('echocli', true)) { + if (config('nntmux.echocli')) { if ($found > 0) { echo PHP_EOL.'(Sharing) Fetched '.$found.' new comments.'.PHP_EOL; } else { diff --git a/Blacklight/XXX.php b/Blacklight/XXX.php index ffeeb02f3..f499c40e3 100755 --- a/Blacklight/XXX.php +++ b/Blacklight/XXX.php @@ -96,7 +96,7 @@ class XXX $this->movieqty = Settings::settingValue('..maxxxxprocessed') !== '' ? (int) Settings::settingValue('..maxxxxprocessed') : 100; $this->showPasswords = Releases::showPasswords(); - $this->echooutput = ($options['Echo'] && env('echocli', true)); + $this->echooutput = ($options['Echo'] && config('nntmux.echocli')); $this->imgSavePath = NN_COVERS.'xxx'.DS; $this->cookie = NN_TMP.'xxx.cookie'; } @@ -134,7 +134,7 @@ class XXX $order = $this->getXXXOrder($orderBy); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_MEDIUM); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); $xxxmoviesSql = sprintf( diff --git a/Blacklight/config/Configure.php b/Blacklight/config/Configure.php deleted file mode 100755 index de3dd9673..000000000 --- a/Blacklight/config/Configure.php +++ /dev/null @@ -1,144 +0,0 @@ -. - * @author niel - * @copyright 2015 NN - */ - -namespace Blacklight\config; - -class Configure -{ - private static $environments = [ - 'indexer' => [ - '.env' => true, - 'settings' => false, - ], - 'install' => [ - '.env' => true, - 'settings' => false, - ], - 'smarty' => [ - '.env' => true, - 'settings' => false, - ], - ]; - - /** - * Configure constructor. - * - * @param string $environment - */ - public function __construct($environment = 'indexer') - { - try { - $this->loadEnvironment($environment); - } catch (\RuntimeException $e) { - echo $e->getMessage(); - } - } - - /** - * @param $environment - * @throws \RuntimeException - */ - private function loadEnvironment($environment) - { - if (array_key_exists($environment, self::$environments)) { - foreach (self::$environments[$environment] as $config => $throwException) { - $this->loadSettings($config, $throwException); - } - } else { - throw new \RuntimeException('Unknown environment passed to Configure class!'); - } - } - - /** - * @param $filename - * @param bool $throwException - * @throws \RuntimeException - */ - public function loadSettings($filename, $throwException = true) - { - if ($filename === '.env') { - $file = NN_ROOT.'.env'; - } else { - $file = NN_CONFIGS.$filename.'.php'; - } - if ($throwException && ! file_exists($file)) { - $errorCode = (int) ($filename === '.env'); - throw new \RuntimeException( - "Unable to load configuration file '$file'. Make sure it has been created and contains correct settings.", - $errorCode - ); - } - if ($file !== NN_ROOT.'.env' && file_exists($file)) { - require_once $file; - } - - switch ($filename) { - case '.env': - $this->defaultSSL(); - break; - case 'settings': - $settings_file = NN_CONFIGS.'settings.php'; - if (is_file($settings_file)) { - require_once $settings_file; - if (PHP_SAPI === 'cli') { - $current_settings_file_version = 8; // Update this when updating settings.example.php - if (! \defined('NN_SETTINGS_FILE_VERSION') || - NN_SETTINGS_FILE_VERSION !== $current_settings_file_version - ) { - echo "\033[0;31mNotice: Your $settings_file file is either out of date or you have not updated". - " NN_SETTINGS_FILE_VERSION to $current_settings_file_version in that file.\033[0m". - PHP_EOL; - } - unset($current_settings_file_version); - } - } elseif (! \defined('ITEMS_PER_PAGE')) { - \define('ITEMS_PER_PAGE', '50'); - \define('ITEMS_PER_COVER_PAGE', '20'); - \define('NN_ECHOCLI', true); - \define('NN_QUERY_STRIP_WHITESPACE', false); - \define('NN_RENAME_PAR2', true); - \define('NN_RENAME_MUSIC_MEDIAINFO', true); - \define('NN_CACHE_EXPIRY_SHORT', 300); - \define('NN_CACHE_EXPIRY_MEDIUM', 600); - \define('NN_CACHE_EXPIRY_LONG', 900); - \define('NN_FLOOD_CHECK', false); - \define('NN_FLOOD_WAIT_TIME', 5); - \define('NN_FLOOD_MAX_REQUESTS_PER_SECOND', 5); - \define('NN_USE_SQL_TRANSACTIONS', true); - \define('NN_MAX_PAGER_RESULTS', '125000'); - } - unset($settings_file); - break; - } - } - - private function defaultSSL() - { - // Check if they updated config.php for the openssl changes. Only check 1 to save speed. - if (! \defined('NN_SSL_VERIFY_PEER')) { - \define('NN_SSL_CAFILE', ''); - \define('NN_SSL_CAPATH', ''); - \define('NN_SSL_VERIFY_PEER', '0'); - \define('NN_SSL_VERIFY_HOST', '0'); - \define('NN_SSL_ALLOW_SELF_SIGNED', '1'); - } - } -} diff --git a/Blacklight/config/settings.example.php b/Blacklight/config/settings.example.php deleted file mode 100755 index d78edf350..000000000 --- a/Blacklight/config/settings.example.php +++ /dev/null @@ -1,207 +0,0 @@ - [ - 'host' => '127.0.0.1', - 'port' => 11211, - 'weight' => 0, - ], - ] -)); - -/* - * Optional path to unix socket file, leave '' if to not use. - * If using a unix socket file, the server list is overridden. - * This should be faster than using the host/port if your cache server is local. - * - * @example '/var/run/redis/redis.sock' - * @note By default, redis and memcached do not have a socket file, you must configure them. - * @note Read and write access is required to the socket file. - * @default '' - */ -define('NN_CACHE_SOCKET_FILE', ''); - -/* - * Timeout for connecting to cache server(s). - * - * @default 10 - */ -define('NN_CACHE_TIMEOUT', 10); - -/* - * Memcached allows to compress the data, saving RAM at the expense of CPU time. - * - * @note Does nothing on redis. - * @default false - */ -define('NN_CACHE_COMPRESSION', false); - -/* - * Serialization is a way of converting data in PHP into strings of text which can be stored on the cache server. - * - * 0 - Use the PHP serializer. Recommended for most people. - * 1 - [Requires igbinary] Use igbinary serializer which is faster and uses less memory, works - * on Memcached / Redis / APC, read the notes below. - * 2 - [Redis Only] Use no serializer. - * - * @note igbinary must be compiled and enabled in php.ini - * @note APC/APCu: This setting is ignored, set this in php.ini with apc.serializer - * @note Memcached/Redis must be compiled with igbinary support as well to use igbinary. - * @note Read the igbinary page how to compile / enable. - * @see https://github.com/phadej/igbinary - * @default 0 - * @version 3 - */ -define('NN_CACHE_SERIALIZER', 0); - -/* - * Amount of time in seconds to expire data from the cache server. - * The developers of NN decide what should be set as short/medium/long, depending on the type of data. - * - * @defaults 300/600/900 - */ -define('NN_CACHE_EXPIRY_SHORT', 300); -define('NN_CACHE_EXPIRY_MEDIUM', 600); -define('NN_CACHE_EXPIRY_LONG', 900); - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////// SQL Settings ////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -/* - * Strip white space (space, carriage return, new line, tab, etc) from queries before sending to MySQL. - * This is useful if you use the MySQL slow query log. - * - * @note This slows down query processing, leave it false unless you turn on the MySQL slow query log. - * @default false - */ -define('NN_QUERY_STRIP_WHITESPACE', false); - -/* - * Use transactions when doing certain SQL jobs. - * This has advantages and disadvantages. - * If there's a problem during a transaction, MySQL can revert the row inserts which is beneficial. - * Transactions can cause deadlocks however if you are trying to insert into the same table from another process. - * - * @note If all your tables are MyISAM you can set this to false, as MyISAM does not support transactions. - * @default true - */ -define('NN_USE_SQL_TRANSACTIONS', true); - -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////// PHP Xdebug Settings ////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -if (extension_loaded('xdebug')) { - - /* - * Display colors on xdebug CLI output? - * 0 - off, 1 - on only if on a TTY with ansi support, 2 - on regardless of TTY or ansi support. - * @default 0 - * @version 4 - */ - ini_set('xdebug.cli_color', '0'); - - /* - * Replace PHP's var_dump with xdebug's own? - * @default '1' - * @version 4 - */ - ini_set('xdebug.overload_var_dump', '1'); - - /* - * How many items in a array or object to display on var_dump. - * @note Set to '-1' for no limit. - * @default '128' - * @version 4 - */ - ini_set('xdebug.var_display_max_children', '128'); - - /* - * Maximum string length on var_dump. (anything over is truncated) - * @note Set to '-1' for no limit. - * @default '512' - * @version 4 - */ - ini_set('xdebug.var_display_max_data', '512'); - - /* - * How many nested arrays / objects deep to display on var_dump. - * @note Set to '-1' for no limit. - * @note Maximum value is '1023' - * @default '3' - * @version 4 - */ - ini_set('xdebug.var_display_max_depth', '3'); -} - -/*********************************************************************************************************************** - * //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - * //////////////////////////////////////////////// Change log //////////////////////////////////////////////////////////// - * //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - * - * 2018-02-19 v9 Move web and cli settings to .env file - * 2018-02-08 v8 Remove search settings, sphinx is the only supported search engine - * 2017-12-21 v7 Remove custom logging settings, Laravel is handling errors now - * 2017-10-11 v6 Remove settings for PHP web/CLI SAPI's as these are now handled by Laravel - * 2015-08-26 v4 Add settings for PHP web/CLI SAPI's. - * Add settings for Xdebug. - * All new settings start from the "PHP CLI Settings" up to the "Change log", lines ~544 to ~768 - * - * 2015-06-11 v3 Add support for APC or APCu extensions for caching data. Search for @version 3 for the changes. - * - * 2015-05-10 v2 Update path to find_password_hash_cost.php in comments. Search for @version 2 for the changes. - * - * 2015-05-03 v1 Track settings.php.example changes. - * Add support for quick and low_priority on MySQL DELETE queries. - * Search for @version 1 in this file to quickly find these additions. - * - * //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/ diff --git a/Blacklight/config/settings.php b/Blacklight/config/settings.php index 4956434e1..c623b3977 100755 --- a/Blacklight/config/settings.php +++ b/Blacklight/config/settings.php @@ -224,9 +224,9 @@ define('NN_CACHE_SERIALIZER', 0); * * @defaults 300/600/900 */ -define('NN_CACHE_EXPIRY_SHORT', 300); -define('NN_CACHE_EXPIRY_MEDIUM', 600); -define('NN_CACHE_EXPIRY_LONG', 900); +define('config('nntmux.cache_expiry_short')', 300); +define('config('nntmux.cache_expiry_medium')', 600); +define('config('nntmux.cache_expiry_long')', 900); //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////// SQL Settings ////////////////////////////////////////////////////////// diff --git a/Blacklight/db/populate/AniDB.php b/Blacklight/db/populate/AniDB.php index fe30fae41..9116bc4d0 100755 --- a/Blacklight/db/populate/AniDB.php +++ b/Blacklight/db/populate/AniDB.php @@ -63,7 +63,7 @@ class AniDB ]; $options += $defaults; - $this->echooutput = ($options['Echo'] && env('echocli', true)); + $this->echooutput = ($options['Echo'] && config('nntmux.echocli')); $anidbupdint = Settings::settingValue('APIs.AniDB.max_update_frequency'); $lastupdated = Settings::settingValue('APIs.AniDB.last_full_update'); diff --git a/Blacklight/http/RSS.php b/Blacklight/http/RSS.php index e522e98d7..ac29b5e5e 100755 --- a/Blacklight/http/RSS.php +++ b/Blacklight/http/RSS.php @@ -103,7 +103,7 @@ class RSS extends Capabilities ' LIMIT 0,'.($offset > 100 ? 100 : $offset) ), true, - NN_CACHE_EXPIRY_MEDIUM + config('nntmux.cache_expiry_medium') ); return $sql; @@ -162,7 +162,7 @@ class RSS extends Capabilities ' LIMIT '.($limit > 100 ? 100 : $limit).' OFFSET 0' ), true, - NN_CACHE_EXPIRY_MEDIUM + config('nntmux.cache_expiry_medium') ); } @@ -216,7 +216,7 @@ class RSS extends Capabilities ' LIMIT '.($limit > 100 ? 100 : $limit).' OFFSET 0' ), true, - NN_CACHE_EXPIRY_MEDIUM + config('nntmux.cache_expiry_medium') ); } diff --git a/Blacklight/libraries/Forking.php b/Blacklight/libraries/Forking.php index 25275b269..3f1a25a76 100755 --- a/Blacklight/libraries/Forking.php +++ b/Blacklight/libraries/Forking.php @@ -210,7 +210,7 @@ class Forking extends \fork_daemon // Process extra work that should not be forked and done after. $this->processEndWork(); - if (env('echocli', true)) { + if (config('nntmux.echocli')) { ColorCLI::doEcho( ColorCLI::header( 'Multi-processing for '.$this->workType.' finished in '.(microtime(true) - $startTime). @@ -304,7 +304,7 @@ class Forking extends \fork_daemon { $this->_workCount = \count($this->work); if ($this->_workCount > 0) { - if (env('echocli', true)) { + if (config('nntmux.echocli')) { ColorCLI::doEcho( ColorCLI::header( 'Multi-processing started at '.date(DATE_RFC2822).' for '.$this->workType.' with '.$this->_workCount. @@ -316,7 +316,7 @@ class Forking extends \fork_daemon $this->addwork($this->work); $this->process_work(true); } else { - if (env('echocli', true)) { + if (config('nntmux.echocli')) { ColorCLI::doEcho( ColorCLI::header('No work to do!'), true ); @@ -1093,7 +1093,7 @@ class Forking extends \fork_daemon */ public function logger($message) { - if (env('echocli', true)) { + if (config('nntmux.echocli')) { echo $message.PHP_EOL; } } @@ -1106,7 +1106,7 @@ class Forking extends \fork_daemon */ public function childExit($pid, $identifier = '') { - if (env('echocli', true)) { + if (config('nntmux.echocli')) { ColorCLI::doEcho( ColorCLI::header( 'Process ID #'.$pid.' has completed.'.PHP_EOL. diff --git a/Blacklight/libraries/ForkingImportNZB.php b/Blacklight/libraries/ForkingImportNZB.php index 1bdb6ff04..5d7cdd816 100755 --- a/Blacklight/libraries/ForkingImportNZB.php +++ b/Blacklight/libraries/ForkingImportNZB.php @@ -49,7 +49,7 @@ class ForkingImportNZB extends Forking exit(); } - if (env('echocli', true)) { + if (config('nntmux.echocli')) { ColorCLI::doEcho(ColorCLI::header( 'Multi-processing started at '.date(DATE_RFC2822).' with '.$this->_workCount. ' job(s) to do using a max of '.$maxProcesses.' child process(es).' @@ -67,7 +67,7 @@ class ForkingImportNZB extends Forking $this->addwork($directories); $this->process_work(true); - if (env('echocli', true)) { + if (config('nntmux.echocli')) { ColorCLI::doEcho( ColorCLI::header( 'Multi-processing for import finished in '.(microtime(true) - $startTime). diff --git a/Blacklight/processing/PostProcess.php b/Blacklight/processing/PostProcess.php index 1864c5bc4..952636c2e 100755 --- a/Blacklight/processing/PostProcess.php +++ b/Blacklight/processing/PostProcess.php @@ -93,7 +93,7 @@ class PostProcess $options += $defaults; // Various. - $this->echooutput = ($options['Echo'] && env('echocli', true)); + $this->echooutput = ($options['Echo'] && config('nntmux.echocli')); // Class instances. $this->pdo = (($options['Settings'] instanceof DB) ? $options['Settings'] : new DB()); diff --git a/Blacklight/processing/ProcessReleases.php b/Blacklight/processing/ProcessReleases.php index 000a1013f..87af1f4e9 100755 --- a/Blacklight/processing/ProcessReleases.php +++ b/Blacklight/processing/ProcessReleases.php @@ -130,7 +130,7 @@ class ProcessReleases ]; $options += $defaults; - $this->echoCLI = ($options['Echo'] && env('echocli', true)); + $this->echoCLI = ($options['Echo'] && config('nntmux.echocli')); $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); $this->consoleTools = ($options['ConsoleTools'] instanceof ConsoleTools ? $options['ConsoleTools'] : new ConsoleTools()); @@ -168,7 +168,7 @@ class ProcessReleases */ public function processReleases($categorize, $postProcess, $groupName, &$nntp, $echooutput): int { - $this->echoCLI = ($echooutput && env('echocli', true)); + $this->echoCLI = ($echooutput && config('nntmux.echocli')); $groupID = ''; if (! empty($groupName) && $groupName !== 'mgr') { diff --git a/Blacklight/processing/Videos.php b/Blacklight/processing/Videos.php index e68aea8c7..95c86324d 100755 --- a/Blacklight/processing/Videos.php +++ b/Blacklight/processing/Videos.php @@ -66,7 +66,7 @@ abstract class Videos $options += $defaults; $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); - $this->echooutput = ($options['Echo'] && env('echocli', true)); + $this->echooutput = ($options['Echo'] && config('nntmux.echocli')); $this->titleCache = []; } @@ -305,7 +305,7 @@ abstract class Videos public function getAliases($videoId = 0, $alias = '') { $return = false; - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_MEDIUM); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); if ($videoId > 0 || $alias !== '') { $aliasCache = Cache::get(md5($videoId.$alias)); diff --git a/Blacklight/processing/post/AniDB.php b/Blacklight/processing/post/AniDB.php index ddafa341d..a0b5f8e5b 100755 --- a/Blacklight/processing/post/AniDB.php +++ b/Blacklight/processing/post/AniDB.php @@ -54,7 +54,7 @@ class AniDB ]; $options += $defaults; - $this->echooutput = ($options['Echo'] && env('echocli', true)); + $this->echooutput = ($options['Echo'] && config('nntmux.echocli')); $this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB()); $qty = (int) Settings::settingValue('..maxanidbprocessed'); diff --git a/Blacklight/processing/post/ProcessAdditional.php b/Blacklight/processing/post/ProcessAdditional.php index e2a586616..736d7fd02 100755 --- a/Blacklight/processing/post/ProcessAdditional.php +++ b/Blacklight/processing/post/ProcessAdditional.php @@ -391,7 +391,7 @@ class ProcessAdditional ]; $options += $defaults; - $this->_echoCLI = ($options['Echo'] && env('echocli', true) && (strtolower(PHP_SAPI) === 'cli')); + $this->_echoCLI = ($options['Echo'] && config('nntmux.echocli') && (strtolower(PHP_SAPI) === 'cli')); $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])); @@ -1731,7 +1731,7 @@ class ProcessAdditional if (isset($arrXml['File']['track'])) { foreach ($arrXml['File']['track'] as $track) { if (isset($track['Album']) && isset($track['Performer'])) { - if (env('RENAME_MUSIC_MEDIAINFO', true) && (int) $this->_release['predb_id'] === 0) { + if (config('nntmux.rename_music_mediainfo') && (int) $this->_release['predb_id'] === 0) { // Make the extension upper case. $ext = strtoupper($fileExtension); @@ -2168,7 +2168,7 @@ class ProcessAdditional // Only get a new name if the category is OTHER. $foundName = true; - if (env('RENAME_PAR2', true) && + if (config('nntmux.rename_par2') && $releaseInfo['proc_pp'] === 0 && \in_array( (int) $this->_release['categories_id'], diff --git a/Changelog b/Changelog index c014d9aa2..a1d33aaa8 100755 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +2018-03-03 DariusIII + * Chg: Upgrade nntmux configuration method 2018-03-02 DariusIII * Chg: Remove unused stripSlashes function from basepage * Fix: Fix editing of user profiles diff --git a/app/Models/Category.php b/app/Models/Category.php index 4ca2c45b0..02c487630 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -184,7 +184,7 @@ class Category extends Model ->orderBy('count', 'desc') ->get(); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_LONG); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_long')); Cache::put('recentlyadded', $recent, $expiresAt); return $recent; @@ -296,7 +296,7 @@ class Category extends Model */ public static function getChildren($categoryId) { - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_LONG); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_long')); $children = Cache::get(md5($categoryId)); if ($children !== null) { return $children; @@ -348,7 +348,7 @@ class Category extends Model return $catIds; } $catIds = self::query()->whereIn('id', $ids)->get(); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_LONG); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_long')); Cache::put('categoryids', $catIds, $expiresAt); return $catIds; @@ -434,7 +434,7 @@ class Category extends Model $arr = $arrsql; } else { $arr = $sql->get()->toArray(); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_LONG); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_long')); Cache::put(md5(implode(',', $excludedCats).implode(',', $roleExcludedCats)), $arr, $expiresAt); } diff --git a/app/Models/Group.php b/app/Models/Group.php index edf09c945..8c7a92b40 100644 --- a/app/Models/Group.php +++ b/app/Models/Group.php @@ -512,7 +512,7 @@ class Group extends Model return self::$cbppTableNames[$groupKey]; } - if (env('echocli', true) && $this->allasmgr === false && self::createNewTPGTables($groupID) === false) { + if (config('nntmux.echocli') && $this->allasmgr === false && self::createNewTPGTables($groupID) === false) { exit('There is a problem creating new TPG tables for this group ID: '.$groupID.PHP_EOL); } diff --git a/app/Models/Predb.php b/app/Models/Predb.php index f097b9d6b..12c04602b 100644 --- a/app/Models/Predb.php +++ b/app/Models/Predb.php @@ -66,7 +66,7 @@ class Predb extends Model $consoleTools = new ConsoleTools(); $updated = 0; - if (env('echocli', true)) { + if (config('nntmux.echocli')) { echo ColorCLI::header('Querying DB for release search names not matched with PreDB titles.'); } @@ -88,18 +88,18 @@ class Predb extends Model foreach ($res as $row) { Release::query()->where('id', $row['releases_id'])->update(['predb_id' => $row['predb_id']]); - if (env('echocli', true)) { + if (config('nntmux.echocli')) { $consoleTools->overWritePrimary( 'Matching up preDB titles with release searchnames: '.$consoleTools->percentString(++$updated, $total) ); } } - if (env('echocli', true)) { + if (config('nntmux.echocli')) { echo PHP_EOL; } } - if (env('echocli', true)) { + if (config('nntmux.echocli')) { echo ColorCLI::header( 'Matched '.number_format(($updated > 0) ? $updated : 0).' PreDB titles to release search names.' ); @@ -157,7 +157,7 @@ class Predb extends Model $search = explode(' ', trim($search)); } - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_MEDIUM); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); if ($search === '') { $check = Cache::get('predbcount'); if ($check !== null) { diff --git a/app/Models/Release.php b/app/Models/Release.php index 88def1f4b..6485bba3f 100644 --- a/app/Models/Release.php +++ b/app/Models/Release.php @@ -267,7 +267,7 @@ class Release extends Model ->limit(10) ->get(); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_LONG); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_long')); Cache::put('topdownloads', $releases, $expiresAt); return $releases; @@ -292,7 +292,7 @@ class Release extends Model ->orderBy('comments', 'desc') ->limit(10) ->get(); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_LONG); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_long')); Cache::put('topcomments', $comments, $expiresAt); return $comments; @@ -315,7 +315,7 @@ class Release extends Model ->leftJoin('groups as g', 'g.id', '=', 'releases.groups_id') ->get(); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_LONG); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_long')); Cache::put('releaseget', $result, $expiresAt); return $result; @@ -360,7 +360,7 @@ class Release extends Model $range = $query->get(); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_MEDIUM); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); Cache::put(md5($start.$num), $range, $expiresAt); return $range; @@ -378,7 +378,7 @@ class Release extends Model return $res; } $res = self::query()->count(['id']); - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_MEDIUM); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_medium')); Cache::put('count', $res, $expiresAt); return $res ?? 0; @@ -390,7 +390,7 @@ class Release extends Model */ public static function getByGuid($guid) { - $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_SHORT); + $expiresAt = Carbon::now()->addSeconds(config('nntmux.cache_expiry_short')); $cached = \is_array($guid) ? md5(implode(',', $guid)) : md5($guid); $result = Cache::get($cached); if ($result !== null) { diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php index c65c17a13..fefb7c142 100644 --- a/bootstrap/autoload.php +++ b/bootstrap/autoload.php @@ -6,7 +6,6 @@ require __DIR__.DIRECTORY_SEPARATOR.'app.php'; use Dotenv\Dotenv; use Blacklight\utility\Utility; -use Blacklight\config\Configure; $dotenv = new Dotenv(dirname(__DIR__, 1)); $dotenv->load(); @@ -23,8 +22,6 @@ if (! defined('HAS_WHICH')) { define('HAS_WHICH', Utility::hasWhich() ? true : false); } -new Configure('indexer'); - $app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); $app->handle(\Illuminate\Http\Request::capture()); require_once __DIR__.DIRECTORY_SEPARATOR.'yenc.php'; diff --git a/config/irc_settings.php b/config/irc_settings.php new file mode 100644 index 000000000..c441b8323 --- /dev/null +++ b/config/irc_settings.php @@ -0,0 +1,115 @@ +REALNAME and USERNAME below. + * You can change them manually below if you have to. + * @note THIS MUST NOT BE EMPTY=>THIS MUST ALSO BE UNIQUE OR YOU WILL NOT BE ABLE TO CONNECT TO IRC. + * @note pick a normal name otherwise you will be banned from the pre channel !!!! + **********************************************************************************************************************/ + 'username' => $username, + +/*********************************************************************************************************************** + * The IRC server to connect to. + * @note If you have issues connecting=>head to https://www.synirc.net/servers and try another server. + **********************************************************************************************************************/ +'scrape_irc_server' => 'irc.synirc.net', + +/*********************************************************************************************************************** + * This is the port to the IRC server. + * @note If you want use SSL/TLS=>use a corresponding port (6697 or 7001 for example)=>and set SCRAPE_IRC_TLS to true. + **********************************************************************************************************************/ +'scrape_irc_port' => '6667', + +/*********************************************************************************************************************** + * If you want to use SSL/TLS encryption on the IRC server=>set this to true. + * @note Make sure you use a valid SSL/TLS port in SCRAPE_IRC_PORT. + **********************************************************************************************************************/ +'scrape_irc_tls' => false, + +/*********************************************************************************************************************** + * This is the nick name visible in IRC channels. + **********************************************************************************************************************/ +'scrape_irc_nickname'=> $username, + +/*********************************************************************************************************************** + * This is a name that is visible to others when they type /whois nickname. + **********************************************************************************************************************/ +'scrape_irc_realname'=> $username, + +/*********************************************************************************************************************** + * This is used as part of your "ident" when connecting to IRC. + * @note This is also the username for ZNC. + **********************************************************************************************************************/ +'scrape_irc_username' => $username, + +/*********************************************************************************************************************** + * This is not required by synirc=>but if you use ZNC=>this is required. + * @note Put your password between quotes: 'mypassword' + * @note If you are using ZNC and having issues=>try 'username:password' or 'username/network:' + **********************************************************************************************************************/ +'scrape_irc_password' => false, + +/*********************************************************************************************************************** + * This is an optional field you can use for ignoring categories. + * @note If you do not wish to exclude any categories=>leave it a empty string: '' + * @examples Case sensitive: '/^(XXX|PDA|EBOOK|MP3)$/' + * Case insensitive: '/^(X264|TV)$/i' + **********************************************************************************************************************/ +'scrape_irc_category_ignore' => '', + +/*********************************************************************************************************************** + * This is an optional field you can use for ignoring PRE titles. + * @note If you do not wish to exclude any PRE titles=>leave it a empty string: '' + * @examples Case insensitive ignore German or XXX in the title: '/\.(German|XXX)\./i' + * This would ignore titles like: + * Yanks.14.06.30.Bianca.Travelman.Is.A.Nudist.XXX.MP4-FUNKY + * Blancanieves.Ein.Maerchen.von.Schwarz.und.Weiss.2012.German.1080p.BluRay.x264-CONTRiBUTiON + **********************************************************************************************************************/ +'scrape_irc_title_ignore' => '', + +/*********************************************************************************************************************** + * This is a list of all the channels we fetch PRE's from. + **********************************************************************************************************************/ + + 'scrape_irc_channels' => + serialize( + [ + //'#Channel' => 'Password', + '#PreNNTmux' => null, + '#nZEDbPRE' => null, + ] + ), + +/*********************************************************************************************************************** + * This is a list of all the sources we fetch PRE's from. + * If you want to ignore a source=>change it from false to true. + **********************************************************************************************************************/ + + 'scrape_irc_source_ignore' => + serialize( + [ + '#a.b.cd.image' => false, + '#a.b.console.ps3' => false, + '#a.b.dvd' => false, + '#a.b.erotica' => false, + '#a.b.flac' => false, + '#a.b.foreign' => false, + '#a.b.games.nintendods' => false, + '#a.b.inner-sanctum' => false, + '#a.b.moovee' => false, + '#a.b.movies.divx' => false, + '#a.b.sony.psp' => false, + '#a.b.sounds.mp3.complete_cd' => false, + '#a.b.teevee' => false, + '#a.b.games.wii' => false, + '#a.b.warez' => false, + '#a.b.games.xbox360' => false, + '#pre@corrupt' => false, + '#scnzb' => false, + '#tvnzb' => false, + 'srrdb' => false, + ] + ), +]; diff --git a/config/nntmux.php b/config/nntmux.php new file mode 100644 index 000000000..943d0a7fe --- /dev/null +++ b/config/nntmux.php @@ -0,0 +1,16 @@ + 50, + 'items_per_cover_page' => 20, + 'max_pager_results' => 125000, + 'flood_check' => false, + 'flood_wait_time' => 5, + 'flood_max_requests_per_second' => 5, + 'echocli' => true, + 'rename_par2' => true, + 'rename_music_mediainfo' => true, + 'cache_expiry_short' => 300, + 'cache_expiry_medium' => 600, + 'cache_expiry_long' => 900, +]; diff --git a/misc/IRCScraper/scrape.php b/misc/IRCScraper/scrape.php index fb03dc1ab..bedc6980e 100644 --- a/misc/IRCScraper/scrape.php +++ b/misc/IRCScraper/scrape.php @@ -4,23 +4,6 @@ require_once dirname(__DIR__, 2).DIRECTORY_SEPARATOR.'bootstrap/autoload.php'; use Blacklight\IRCScraper; -if (! defined('IRC_SCRAPER_CONFIG')) { - define('IRC_SCRAPER_CONFIG', NN_CONFIGS.'ircscraper_settings.php'); -} - -switch (true) { - case is_file(IRC_SCRAPER_CONFIG): - break; - case is_file(NN_ROOT.'misc/testing/IRCScraper/settings.php'): - rename(NN_ROOT.'misc/testing/IRCScraper/settings.php', IRC_SCRAPER_CONFIG); - break; - default: - exit( - 'Copy '.NN_CONFIGS.'ircscraper_settings_example.php to '. - IRC_SCRAPER_CONFIG.' and change the settings.'.PHP_EOL - ); -} - if (! isset($argv[1]) || $argv[1] !== 'true') { exit( 'Argument 1: (required) false|true ; false prints this help screen, true runs the scraper.'.PHP_EOL. @@ -34,14 +17,8 @@ if (! isset($argv[1]) || $argv[1] !== 'true') { ); } -require_once IRC_SCRAPER_CONFIG; - -if (! defined('SCRAPE_IRC_NICKNAME')) { - exit('ERROR! You must update settings.php using settings_example.php.'); -} - -if (SCRAPE_IRC_NICKNAME === '') { - exit('ERROR! You must put a username in settings.php'.PHP_EOL); +if (config('irc_settings.scrape_irc_username') === '') { + exit('ERROR! You must put a username in config/irc_settings.php'.PHP_EOL); } $silent = (isset($argv[2]) && $argv[2] === 'true'); diff --git a/public/admin/anidb-list.php b/public/admin/anidb-list.php index 29659ebd6..0bfa44b93 100644 --- a/public/admin/anidb-list.php +++ b/public/admin/anidb-list.php @@ -22,14 +22,14 @@ $asearch = ($aname !== '') ? 'animetitle='.$aname.'&' : ''; $page->smarty->assign('pagertotalitems', $animecount); $page->smarty->assign('pageroffset', $offset); -$page->smarty->assign('pageritemsperpage', env('ITEMS_PER_PAGE', 50)); +$page->smarty->assign('pageritemsperpage', config('nntmux.items_per_page'); $page->smarty->assign('pagerquerybase', WWW_TOP.'/anidb-list.php?'.$asearch.'&offset='); $pager = $page->smarty->fetch('pager.tpl'); $page->smarty->assign('pager', $pager); $page->smarty->assign('animetitle', $aname); -$anidblist = $AniDB->getAnimeRange($offset, env('ITEMS_PER_PAGE', 50), $aname); +$anidblist = $AniDB->getAnimeRange($offset, config('nntmux.items_per_page', $aname); $page->smarty->assign('anidblist', $anidblist); $page->content = $page->smarty->fetch('anidb-list.tpl'); diff --git a/public/admin/book-list.php b/public/admin/book-list.php index 4b7b0549f..9cdd5ec94 100644 --- a/public/admin/book-list.php +++ b/public/admin/book-list.php @@ -19,14 +19,14 @@ $page->smarty->assign([ 'pagertotalitems' => $bookCount, 'pagerquerysuffix' => '#results', 'pageroffset' => $offset, - 'pageritemsperpage' => env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage' => config('nntmux.items_per_page', 'pagerquerybase' => WWW_TOP.'/book-list.php?offset=', ]); $pager = $page->smarty->fetch('pager.tpl'); $page->smarty->assign('pager', $pager); -$bookList = Utility::getRange('bookinfo', $offset, env('ITEMS_PER_PAGE', 50)); +$bookList = Utility::getRange('bookinfo', $offset, config('nntmux.items_per_page'); $page->smarty->assign('booklist', $bookList); diff --git a/public/admin/category_regexes-list.php b/public/admin/category_regexes-list.php index 896d9ffd8..9296a22dc 100644 --- a/public/admin/category_regexes-list.php +++ b/public/admin/category_regexes-list.php @@ -11,7 +11,7 @@ $page->title = 'Category Regex List'; $group = request()->has('group') && ! empty(request()->input('group')) ? request()->input('group') : ''; $offset = (request()->input('offset') ?? 0); -$regex = $regexes->getRegex($group, env('ITEMS_PER_PAGE', 50), $offset); +$regex = $regexes->getRegex($group, config('nntmux.items_per_page', $offset); $page->smarty->assign( [ @@ -19,7 +19,7 @@ $page->smarty->assign( 'pagertotalitems' => $regexes->getCount($group), 'pagerquerysuffix' => '', 'pageroffset' => $offset, - 'pageritemsperpage' => env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage' => config('nntmux.items_per_page', 'regex' => $regex, 'pagerquerybase' => WWW_TOP.'/category_regexes-list.php?'.$group.'offset=', ] diff --git a/public/admin/collection_regexes-list.php b/public/admin/collection_regexes-list.php index f6efbbbdc..287daed37 100644 --- a/public/admin/collection_regexes-list.php +++ b/public/admin/collection_regexes-list.php @@ -11,14 +11,14 @@ $page->title = 'Collections Regex List'; $group = (request()->has('group') && ! empty(request()->input('group')) ? request()->input('group') : ''); $offset = request()->input('offset') ?? 0; -$regex = $regexes->getRegex($group, env('ITEMS_PER_PAGE', 50), $offset); +$regex = $regexes->getRegex($group, config('nntmux.items_per_page', $offset); $page->smarty->assign( [ 'group' => $group, 'regex' => $regex, 'pagertotalitems' => $regexes->getCount($group), 'pageroffset' => $offset, - 'pageritemsperpage' => env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage' => config('nntmux.items_per_page', 'pagerquerybase' => WWW_TOP.'/collection_regexes-list.php?'.$group.'offset=', 'pagerquerysuffix' => '', ] diff --git a/public/admin/comments-list.php b/public/admin/comments-list.php index 6643e390c..9c0174b18 100644 --- a/public/admin/comments-list.php +++ b/public/admin/comments-list.php @@ -13,13 +13,13 @@ $offset = request()->input('offset') ?? 0; $page->smarty->assign([ 'pagertotalitems' => $commentcount, 'pageroffset' => $offset, - 'pageritemsperpage' => env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage' => config('nntmux.items_per_page', 'pagerquerybase' => WWW_TOP.'/comments-list.php?offset=', 'pagerquerysuffix' => '', ]); $pager = $page->smarty->fetch('pager.tpl'); $page->smarty->assign('pager', $pager); -$commentslist = ReleaseComment::getCommentsRange($offset, env('ITEMS_PER_PAGE', 50)); +$commentslist = ReleaseComment::getCommentsRange($offset, config('nntmux.items_per_page'); $page->smarty->assign('commentslist', $commentslist); $page->content = $page->smarty->fetch('comments-list.tpl'); diff --git a/public/admin/console-list.php b/public/admin/console-list.php index f9b4394ae..ef0fd6f4c 100644 --- a/public/admin/console-list.php +++ b/public/admin/console-list.php @@ -18,14 +18,14 @@ $page->smarty->assign([ 'pagertotalitems' => $conCount, 'pagerquerysuffix' => '#results', 'pageroffset' => $offset, - 'pageritemsperpage' => env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage' => config('nntmux.items_per_page', 'pagerquerybase' => WWW_TOP.'/console-list.php?offset=', ]); $pager = $page->smarty->fetch('pager.tpl'); $page->smarty->assign('pager', $pager); -$consoleList = Utility::getRange('consoleinfo', $offset, env('ITEMS_PER_PAGE', 50)); +$consoleList = Utility::getRange('consoleinfo', $offset, config('nntmux.items_per_page'); $page->smarty->assign('consolelist', $consoleList); diff --git a/public/admin/failrel-list.php b/public/admin/failrel-list.php index c7f3c06d4..3ef0f17e4 100644 --- a/public/admin/failrel-list.php +++ b/public/admin/failrel-list.php @@ -17,14 +17,14 @@ $page->smarty->assign( 'pagertotalitems' => $frelcount, 'pagerquerysuffix' => '#results', 'pageroffset' => $offset, - 'pageritemsperpage' => env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage' => config('nntmux.items_per_page', 'pagerquerybase' => WWW_TOP.'/failrel-list.php?offset=', ] ); $pager = $page->smarty->fetch('pager.tpl'); $page->smarty->assign('pager', $pager); -$frellist = Release::getFailedRange($offset, env('ITEMS_PER_PAGE', 50)); +$frellist = Release::getFailedRange($offset, config('nntmux.items_per_page'); $page->smarty->assign('releaselist', $frellist); $page->content = $page->smarty->fetch('failrel-list.tpl'); diff --git a/public/admin/game-list.php b/public/admin/game-list.php index 09fafda3c..1495e2805 100644 --- a/public/admin/game-list.php +++ b/public/admin/game-list.php @@ -17,14 +17,14 @@ $page->smarty->assign([ 'pagertotalitems' => $gameCount, 'pagerquerysuffix' => '#results', 'pageroffset' => $offset, - 'pageritemsperpage' => env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage' => config('nntmux.items_per_page', 'pagerquerybase' => WWW_TOP.'/game-list.php?offset=', ]); $pager = $page->smarty->fetch('pager.tpl'); $page->smarty->assign('pager', $pager); -$gamelist = $game->getRange($offset, env('ITEMS_PER_PAGE', 50)); +$gamelist = $game->getRange($offset, config('nntmux.items_per_page'); $page->smarty->assign('gamelist', $gamelist); diff --git a/public/admin/group-list-active.php b/public/admin/group-list-active.php index 206f4c30f..a674bbaaa 100644 --- a/public/admin/group-list-active.php +++ b/public/admin/group-list-active.php @@ -19,7 +19,7 @@ $groupname = ! empty(request()->input('groupname')) ? request()->input('groupnam $page->smarty->assign('groupname', $groupname); $page->smarty->assign('pagertotalitems', $groupcount); $page->smarty->assign('pageroffset', $offset); -$page->smarty->assign('pageritemsperpage', env('ITEMS_PER_PAGE', 50)); +$page->smarty->assign('pageritemsperpage', config('nntmux.items_per_page'); $page->smarty->assign('pagerquerysuffix', '#results'); $groupsearch = $gname !== '' ? 'groupname='.$gname.'&' : ''; @@ -27,7 +27,7 @@ $page->smarty->assign('pagerquerybase', WWW_TOP.'/group-list-active.php?'.$group $pager = $page->smarty->fetch('pager.tpl'); $page->smarty->assign('pager', $pager); -$grouplist = Group::getGroupsRange($offset, env('ITEMS_PER_PAGE', 50), $gname, true); +$grouplist = Group::getGroupsRange($offset, config('nntmux.items_per_page', $gname, true); $page->smarty->assign('grouplist', $grouplist); diff --git a/public/admin/group-list-inactive.php b/public/admin/group-list-inactive.php index d014cb17a..ef449d7e1 100644 --- a/public/admin/group-list-inactive.php +++ b/public/admin/group-list-inactive.php @@ -19,7 +19,7 @@ $groupname = ! empty(request()->input('groupname')) ? request()->input('groupnam $page->smarty->assign('groupname', $groupname); $page->smarty->assign('pagertotalitems', $groupcount); $page->smarty->assign('pageroffset', $offset); -$page->smarty->assign('pageritemsperpage', env('ITEMS_PER_PAGE', 50)); +$page->smarty->assign('pageritemsperpage', config('nntmux.items_per_page'); $page->smarty->assign('pagerquerysuffix', '#results'); $groupsearch = $gname !== '' ? 'groupname='.$gname.'&' : ''; @@ -27,7 +27,7 @@ $page->smarty->assign('pagerquerybase', WWW_TOP.'/group-list-inactive.php?'.$gro $pager = $page->smarty->fetch('pager.tpl'); $page->smarty->assign('pager', $pager); -$grouplist = Group::getGroupsRange($offset, env('ITEMS_PER_PAGE', 50), $gname, false); +$grouplist = Group::getGroupsRange($offset, config('nntmux.items_per_page', $gname, false); $page->smarty->assign('grouplist', $grouplist); diff --git a/public/admin/group-list.php b/public/admin/group-list.php index 92f595ab7..f12863bbf 100644 --- a/public/admin/group-list.php +++ b/public/admin/group-list.php @@ -14,10 +14,10 @@ $page->smarty->assign( 'groupname' => $groupName, 'pagertotalitems' => Group::getGroupsCount($groupName, -1), 'pageroffset' => $offset, - 'pageritemsperpage' => env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage' => config('nntmux.items_per_page', 'pagerquerybase' => WWW_TOP.'/group-list.php?'.(($groupName !== '') ? "groupname=$groupName" : '').'&offset=', 'pagerquerysuffix' => '', - 'grouplist' => Group::getGroupsRange($offset, env('ITEMS_PER_PAGE', 50), $groupName), + 'grouplist' => Group::getGroupsRange($offset, config('nntmux.items_per_page', $groupName), ] ); $page->smarty->assign('pager', $page->smarty->fetch('pager.tpl')); diff --git a/public/admin/movie-list.php b/public/admin/movie-list.php index 843d51ad1..897f2ee66 100644 --- a/public/admin/movie-list.php +++ b/public/admin/movie-list.php @@ -18,13 +18,13 @@ $page->smarty->assign([ 'pagertotalitems' => $movCount, 'pagerquerysuffix' => '#results', 'pageroffset' => $offset, - 'pageritemsperpage' => env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage' => config('nntmux.items_per_page', 'pagerquerybase' => WWW_TOP.'/movie-list.php?offset=', ]); $pager = $page->smarty->fetch('pager.tpl'); $page->smarty->assign('pager', $pager); -$movieList = Utility::getRange('movieinfo', $offset, env('ITEMS_PER_PAGE', 50)); +$movieList = Utility::getRange('movieinfo', $offset, config('nntmux.items_per_page'); $page->smarty->assign('movielist', $movieList); $page->content = $page->smarty->fetch('movie-list.tpl'); diff --git a/public/admin/music-list.php b/public/admin/music-list.php index 14c9a28f9..3841ad3b1 100644 --- a/public/admin/music-list.php +++ b/public/admin/music-list.php @@ -19,14 +19,14 @@ $page->smarty->assign([ 'pagertotalitems' => $musCount, 'pagerquerysuffix' => '#results', 'pageroffset' => $offset, - 'pageritemsperpage' => env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage' => config('nntmux.items_per_page', 'pagerquerybase' => WWW_TOP.'/music-list.php?offset=', ]); $pager = $page->smarty->fetch('pager.tpl'); $page->smarty->assign('pager', $pager); -$musicList = Utility::getRange('musicinfo', $offset, env('ITEMS_PER_PAGE', 50)); +$musicList = Utility::getRange('musicinfo', $offset, config('nntmux.items_per_page'); $page->smarty->assign('musiclist', $musicList); diff --git a/public/admin/predb.php b/public/admin/predb.php index efda1caed..6a104bba5 100644 --- a/public/admin/predb.php +++ b/public/admin/predb.php @@ -10,15 +10,15 @@ $offset = (request()->has('offset') && ctype_digit(request()->input('offset'))) if (request()->has('presearch')) { $lastSearch = request()->input('presearch'); - $parr = Predb::getAll($offset, env('ITEMS_PER_PAGE', 50), request()->input('presearch')); + $parr = Predb::getAll($offset, config('nntmux.items_per_page', request()->input('presearch')); } else { $lastSearch = ''; - $parr = Predb::getAll($offset, env('ITEMS_PER_PAGE', 50)); + $parr = Predb::getAll($offset, config('nntmux.items_per_page'); } $page->smarty->assign('pagertotalitems', $parr['count']); $page->smarty->assign('pageroffset', $offset); -$page->smarty->assign('pageritemsperpage', env('ITEMS_PER_PAGE', 50)); +$page->smarty->assign('pageritemsperpage', config('nntmux.items_per_page'); $page->smarty->assign('pagerquerybase', WWW_TOP.'/predb.php?offset='); $page->smarty->assign('pagerquerysuffix', '#results'); $page->smarty->assign('lastSearch', $lastSearch); diff --git a/public/admin/release-list.php b/public/admin/release-list.php index 837967bf2..938180aa9 100644 --- a/public/admin/release-list.php +++ b/public/admin/release-list.php @@ -16,14 +16,14 @@ $page->smarty->assign([ 'pagertotalitems' => $releasecount, 'pagerquerysuffix' => '#results', 'pageroffset' => $offset, - 'pageritemsperpage' => env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage' => config('nntmux.items_per_page', 'pagerquerybase' => WWW_TOP.'/release-list.php?offset=', ]); $pager = $page->smarty->fetch('pager.tpl'); $page->smarty->assign('pager', $pager); -$releaselist = Release::getReleasesRange($offset, env('ITEMS_PER_PAGE', 50)); +$releaselist = Release::getReleasesRange($offset, config('nntmux.items_per_page'); $page->smarty->assign('releaselist', $releaselist); $page->content = $page->smarty->fetch('release-list.tpl'); diff --git a/public/admin/release_naming_regexes-list.php b/public/admin/release_naming_regexes-list.php index 49a8cf319..4c89e167b 100644 --- a/public/admin/release_naming_regexes-list.php +++ b/public/admin/release_naming_regexes-list.php @@ -15,13 +15,13 @@ if (request()->has('group') && ! empty(request()->input('group'))) { } $offset = request()->input('offset') ?? 0; -$regex = $regexes->getRegex($group, env('ITEMS_PER_PAGE', 50), $offset); +$regex = $regexes->getRegex($group, config('nntmux.items_per_page', $offset); $page->smarty->assign('regex', $regex); $count = $regexes->getCount($group); $page->smarty->assign('pagertotalitems', $count); $page->smarty->assign('pageroffset', $offset); -$page->smarty->assign('pageritemsperpage', env('ITEMS_PER_PAGE', 50)); +$page->smarty->assign('pageritemsperpage', config('nntmux.items_per_page'); $page->smarty->assign('pagerquerysuffix', ''); $page->smarty->assign('pagerquerybase', WWW_TOP.'/release_naming_regexes-list.php?'.$group.'offset='); diff --git a/public/admin/show-list.php b/public/admin/show-list.php index 23371efa5..be2fce5d3 100755 --- a/public/admin/show-list.php +++ b/public/admin/show-list.php @@ -14,10 +14,10 @@ $offset = request()->input('offset') ?? 0; $page->smarty->assign( [ 'showname' => $tvshowname, - 'tvshowlist' => Video::getRange($offset, env('ITEMS_PER_PAGE', 50), $tvshowname), + 'tvshowlist' => Video::getRange($offset, config('nntmux.items_per_page', $tvshowname), 'pagertotalitems' => Video::getCount($tvshowname), 'pageroffset' => $offset, - 'pageritemsperpage' => env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage' => config('nntmux.items_per_page', 'pagerquerysuffix' => '', 'pagerquerybase' => WWW_TOP.'/show-list.php?'. ($tvshowname !== '' ? 'showname='.$tvshowname.'&' : '').'&offset=', diff --git a/public/admin/user-list.php b/public/admin/user-list.php index 4794c8c21..129adaddf 100644 --- a/public/admin/user-list.php +++ b/public/admin/user-list.php @@ -35,11 +35,11 @@ $page->smarty->assign( 'pagerquerysuffix' => '#results', 'pagertotalitems' => User::getCount($variables['role'], $variables['username'], $variables['host'], $variables['email']), 'pageroffset' => $offset, - 'pageritemsperpage' => env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage' => config('nntmux.items_per_page', 'pagerquerybase' => WWW_TOP.'/user-list.php?ob='.$orderBy.$uSearch.'&offset=', 'userlist' => User::getRange( $offset, - env('ITEMS_PER_PAGE', 50), + config('nntmux.items_per_page', $orderBy, $variables['username'], $variables['email'], diff --git a/public/pages/BasePage.php b/public/pages/BasePage.php index 2fe6692d6..f4d066b89 100644 --- a/public/pages/BasePage.php +++ b/public/pages/BasePage.php @@ -114,7 +114,7 @@ class BasePage setcookie(config('session.cookie'), $_SESSION['_token'], $lifetime, '/', $domain, $secure, $http_only); } - if (env('FLOOD_CHECK', false)) { + if (config('nntmux.flood_check')) { $this->floodCheck(); } @@ -172,7 +172,7 @@ class BasePage */ public function floodCheck(): void { - $waitTime = (env('FLOOD_WAIT_TIME', 5) < 1 ? 5 : env('FLOOD_WAIT_TIME', 5)); + $waitTime = (config('nntmux.flood_wait_time') < 1 ? 5 : config('nntmux.flood_wait_time')); // Check if this is not from CLI. if (empty($argc)) { // If flood wait set, the user must wait x seconds until they can access a page. @@ -184,7 +184,7 @@ class BasePage $_SESSION['flood_check_hits'] = 1; $_SESSION['flood_check_time'] = microtime(true); } else { - if ($_SESSION['flood_check_hits'] >= (env('FLOOD_MAX_REQUESTS_PER_SECOND', 5) < 1 ? 5 : env('FLOOD_MAX_REQUESTS_PER_SECOND', 5))) { + if ($_SESSION['flood_check_hits'] >= (config('nntmux.flood_max_requests_per_second') < 1 ? 5 : config('nntmux.flood_max_requests_per_second'))) { if ($_SESSION['flood_check_time'] + 1 > microtime(true)) { $_SESSION['flood_wait_until'] = microtime(true) + $waitTime; unset($_SESSION['flood_check_hits']); diff --git a/public/pages/books.php b/public/pages/books.php index 1ded071cb..c9b0452ea 100644 --- a/public/pages/books.php +++ b/public/pages/books.php @@ -31,7 +31,7 @@ $ordering = $book->getBookOrdering(); $orderby = request()->has('ob') && in_array(request()->input('ob'), $ordering, false) ? request()->input('ob') : ''; $books = []; -$results = $book->getBookRange($catarray, $offset, env('ITEMS_PER_COVER_PAGE', 20), $orderby, $page->userdata['categoryexclusions']); +$results = $book->getBookRange($catarray, $offset, config('nntmux.items_per_cover_page', $orderby, $page->userdata['categoryexclusions']); $maxwords = 50; foreach ($results as $result) { @@ -55,7 +55,7 @@ $browseby_link = '&title='.$title.'&author='.$author; $page->smarty->assign('pagertotalitems', $results[0]['_totalcount'] ?? 0); $page->smarty->assign('pageroffset', $offset); -$page->smarty->assign('pageritemsperpage', env('ITEMS_PER_COVER_PAGE', 20)); +$page->smarty->assign('pageritemsperpage', config('nntmux.items_per_cover_page'); $page->smarty->assign('pagerquerybase', WWW_TOP.'/books?t='.$category.$browseby_link.'&ob='.$orderby.'&offset='); $page->smarty->assign('pagerquerysuffix', '#results'); diff --git a/public/pages/browse.php b/public/pages/browse.php index 4179531cd..8aeb490e5 100644 --- a/public/pages/browse.php +++ b/public/pages/browse.php @@ -29,7 +29,7 @@ $offset = (request()->has('offset') && ctype_digit(request()->input('offset'))) $ordering = $releases->getBrowseOrdering(); $orderby = request()->has('ob') && in_array(request()->input('ob'), $ordering, false) ? request()->input('ob') : ''; -$results = $releases->getBrowseRange($catarray, $offset, env('ITEMS_PER_PAGE', 50), $orderby, -1, $page->userdata['categoryexclusions'], $grp); +$results = $releases->getBrowseRange($catarray, $offset, config('nntmux.items_per_page', $orderby, -1, $page->userdata['categoryexclusions'], $grp); $browsecount = $results[0]['_totalcount'] ?? 0; @@ -37,7 +37,7 @@ $page->smarty->assign( [ 'pagertotalitems' => $browsecount, 'pageroffset'=> $offset, - 'pageritemsperpage'=> env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage'=> config('nntmux.items_per_page', 'pagerquerybase' => WWW_TOP.'/browse?t='.$category.'&g='.$grp.'&ob='.$orderby.'&offset=', 'pagerquerysuffix' => '#results', ] diff --git a/public/pages/console.php b/public/pages/console.php index 8f2278c2a..c7b5e3c30 100644 --- a/public/pages/console.php +++ b/public/pages/console.php @@ -33,7 +33,7 @@ $ordering = $console->getConsoleOrdering(); $orderby = request()->has('ob') && in_array(request()->input('ob'), $ordering, false) ? request()->input('ob') : ''; $consoles = []; -$results = $console->getConsoleRange($catarray, $offset, env('ITEMS_PER_COVER_PAGE', 20), $orderby, $page->userdata['categoryexclusions']); +$results = $console->getConsoleRange($catarray, $offset, config('nntmux.items_per_cover_page', $orderby, $page->userdata['categoryexclusions']); $maxwords = 50; foreach ($results as $result) { @@ -66,7 +66,7 @@ $browseby_link = '&title='.$title.'&platform='.$platform; $page->smarty->assign('pagertotalitems', $results[0]['_totalcount'] ?? 0); $page->smarty->assign('pageroffset', $offset); -$page->smarty->assign('pageritemsperpage', env('ITEMS_PER_COVER_PAGE', 20)); +$page->smarty->assign('pageritemsperpage', config('nntmux.items_per_cover_page'); $page->smarty->assign('pagerquerybase', WWW_TOP.'/console?t='.$category.$browseby_link.'&ob='.$orderby.'&offset='); $page->smarty->assign('pagerquerysuffix', '#results'); diff --git a/public/pages/forum.php b/public/pages/forum.php index 080eebb7e..bfae509ed 100644 --- a/public/pages/forum.php +++ b/public/pages/forum.php @@ -40,11 +40,11 @@ $browsecount = Forumpost::getBrowseCount(); $offset = request()->has('offset') && ctype_digit(request()->input('offset')) ? request()->input('offset') : 0; -$results = Forumpost::getBrowseRange($offset, env('ITEMS_PER_PAGE', 50)); +$results = Forumpost::getBrowseRange($offset, config('nntmux.items_per_page'); $page->smarty->assign('pagertotalitems', $browsecount); $page->smarty->assign('pageroffset', $offset); -$page->smarty->assign('pageritemsperpage', env('ITEMS_PER_PAGE', 50)); +$page->smarty->assign('pageritemsperpage', config('nntmux.items_per_page'); $page->smarty->assign('pagerquerybase', WWW_TOP.'/forum?offset='); $page->smarty->assign('pagerquerysuffix', '#results'); $page->smarty->assign('privateprofiles', (int) Settings::settingValue('..privateprofiles') === 1); diff --git a/public/pages/games.php b/public/pages/games.php index fc678e54e..ac8b404d4 100644 --- a/public/pages/games.php +++ b/public/pages/games.php @@ -34,7 +34,7 @@ $ordering = $games->getGamesOrdering(); $orderby = request()->has('ob') && in_array(request()->input('ob'), $ordering, false) ? request()->input('ob') : ''; $results = $games2 = []; -$results = $games->getGamesRange($catarray, $offset, env('ITEMS_PER_COVER_PAGE', 20), $orderby, '', $page->userdata['categoryexclusions']); +$results = $games->getGamesRange($catarray, $offset, config('nntmux.items_per_cover_page', $orderby, '', $page->userdata['categoryexclusions']); $maxwords = 50; foreach ($results as $result) { if (! empty($result['review'])) { @@ -74,7 +74,7 @@ $browseby_link = '&title='.$title.'&year='.$year; $page->smarty->assign('pagertotalitems', $results[0]['_totalcount'] ?? 0); $page->smarty->assign('pageroffset', $offset); -$page->smarty->assign('pageritemsperpage', env('ITEMS_PER_COVER_PAGE', 20)); +$page->smarty->assign('pageritemsperpage', config('nntmux.items_per_cover_page'); $page->smarty->assign('pagerquerybase', WWW_TOP.'/games?t='.$category.$browseby_link.'&ob='.$orderby.'&offset='); $page->smarty->assign('pagerquerysuffix', '#results'); diff --git a/public/pages/movies.php b/public/pages/movies.php index 352561d88..4a2754fe8 100644 --- a/public/pages/movies.php +++ b/public/pages/movies.php @@ -41,7 +41,7 @@ $ordering = $movie->getMovieOrdering(); $orderby = request()->has('ob') && in_array(request()->input('ob'), $ordering, false) ? request()->input('ob') : ''; $movies = []; -$results = $movie->getMovieRange($catarray, $offset, env('ITEMS_PER_COVER_PAGE', 20), $orderby, -1, $page->userdata['categoryexclusions']); +$results = $movie->getMovieRange($catarray, $offset, config('nntmux.items_per_cover_page', $orderby, -1, $page->userdata['categoryexclusions']); foreach ($results as $result) { $result['genre'] = makeFieldLinks($result, 'genre', 'movies'); $result['actors'] = makeFieldLinks($result, 'actors', 'movies'); @@ -80,7 +80,7 @@ $browseby_link = '&title='.$title.'&actors='.$actors.'&director='.$d $page->smarty->assign('pagertotalitems', $results[0]['_totalcount'] ?? 0); $page->smarty->assign('pageroffset', $offset); -$page->smarty->assign('pageritemsperpage', env('ITEMS_PER_COVER_PAGE', 20)); +$page->smarty->assign('pageritemsperpage', config('nntmux.items_per_cover_page'); $page->smarty->assign('pagerquerybase', WWW_TOP.'/movies?t='.$category.$browseby_link.'&ob='.$orderby.'&offset='); $page->smarty->assign('pagerquerysuffix', '#results'); diff --git a/public/pages/music.php b/public/pages/music.php index d20b3f0ed..8fb28eca3 100644 --- a/public/pages/music.php +++ b/public/pages/music.php @@ -33,7 +33,7 @@ $ordering = $music->getMusicOrdering(); $orderby = request()->has('ob') && in_array(request()->input('ob'), $ordering) ? request()->input('ob') : ''; $results = $musics = []; -$results = $music->getMusicRange($catarray, $offset, env('ITEMS_PER_COVER_PAGE', 20), $orderby, $page->userdata['categoryexclusions']); +$results = $music->getMusicRange($catarray, $offset, config('nntmux.items_per_cover_page', $orderby, $page->userdata['categoryexclusions']); $artist = (request()->has('artist') && ! empty(request()->input('artist'))) ? stripslashes(request()->input('artist')) : ''; $page->smarty->assign('artist', $artist); @@ -66,7 +66,7 @@ $browseby_link = '&title='.$title.'&artist='.$artist.'&genre='.$genr $page->smarty->assign('pagertotalitems', isset($results[0]['_totalcount']) ? $results[0]['_totalcount'] : 0); $page->smarty->assign('pageroffset', $offset); -$page->smarty->assign('pageritemsperpage', env('ITEMS_PER_COVER_PAGE', 20)); +$page->smarty->assign('pageritemsperpage', config('nntmux.items_per_cover_page'); $page->smarty->assign('pagerquerybase', WWW_TOP.'/music?t='.$category.$browseby_link.'&ob='.$orderby.'&offset='); $page->smarty->assign('pagerquerysuffix', '#results'); diff --git a/public/pages/mymovies.php b/public/pages/mymovies.php index f7cadcc33..04c8e32af 100755 --- a/public/pages/mymovies.php +++ b/public/pages/mymovies.php @@ -126,11 +126,11 @@ switch ($action) { $ordering = $releases->getBrowseOrdering(); $orderby = request()->has('ob') && \in_array(request()->input('ob'), $ordering, false) ? request()->input('ob') : ''; - $results = $mv->getMovieRange($movies, $offset, env('ITEMS_PER_PAGE', 50), $orderby, -1, $page->userdata['categoryexclusions']); + $results = $mv->getMovieRange($movies, $offset, config('nntmux.items_per_page', $orderby, -1, $page->userdata['categoryexclusions']); $page->smarty->assign('pagertotalitems', $browsecount); $page->smarty->assign('pageroffset', $offset); - $page->smarty->assign('pageritemsperpage', env('ITEMS_PER_PAGE', 50)); + $page->smarty->assign('pageritemsperpage', config('nntmux.items_per_page'); $page->smarty->assign('pagerquerybase', WWW_TOP.'/mymovies/browse?ob='.$orderby.'&offset='); $page->smarty->assign('pagerquerysuffix', '#results'); $page->smarty->assign('covgroup', ''); diff --git a/public/pages/myshows.php b/public/pages/myshows.php index ba89b028b..ec8f645c0 100755 --- a/public/pages/myshows.php +++ b/public/pages/myshows.php @@ -124,11 +124,11 @@ switch ($action) { $ordering = $releases->getBrowseOrdering(); $orderby = request()->has('ob') && in_array(request()->input('ob'), $ordering, false) ? request()->input('ob') : ''; - $results = $releases->getShowsRange($shows, $offset, env('ITEMS_PER_PAGE', 50), $orderby, -1, $page->userdata['categoryexclusions']); + $results = $releases->getShowsRange($shows, $offset, config('nntmux.items_per_page', $orderby, -1, $page->userdata['categoryexclusions']); $page->smarty->assign('pagertotalitems', $browsecount); $page->smarty->assign('pageroffset', $offset); - $page->smarty->assign('pageritemsperpage', env('ITEMS_PER_PAGE', 50)); + $page->smarty->assign('pageritemsperpage', config('nntmux.items_per_page'); $page->smarty->assign('pagerquerybase', WWW_TOP.'/myshows/browse?ob='.$orderby.'&offset='); $page->smarty->assign('pagerquerysuffix', '#results'); $page->smarty->assign('covgroup', ''); diff --git a/public/pages/profile.php b/public/pages/profile.php index 046e702ab..08ec09d57 100644 --- a/public/pages/profile.php +++ b/public/pages/profile.php @@ -63,7 +63,7 @@ $page->smarty->assign( 'privileged' => $privileged, 'pagertotalitems' => ReleaseComment::getCommentCountForUser($userID), 'pageroffset' => $offset, - 'pageritemsperpage' => env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage' => config('nntmux.items_per_page', 'pagerquerybase' => '/profile?id='.$userID.'&offset=', 'pagerquerysuffix' => '#comments', ] @@ -83,7 +83,7 @@ $sabSettings = [1 => 'Site', 2 => 'Cookie']; $page->smarty->assign( [ 'pager' => $page->smarty->fetch('pager.tpl'), - 'commentslist' => ReleaseComment::getCommentsForUserRange($userID, $offset, env('ITEMS_PER_PAGE', 50)), + 'commentslist' => ReleaseComment::getCommentsForUserRange($userID, $offset, config('nntmux.items_per_page'), 'exccats' => implode(',', UserExcludedCategory::getCategoryExclusionNames($userID)), 'saburl' => $sab->url, 'sabapikey' => $sab->apikey, diff --git a/public/pages/search.php b/public/pages/search.php index 3e0d1a1db..801c06a0f 100644 --- a/public/pages/search.php +++ b/public/pages/search.php @@ -70,7 +70,7 @@ if ((request()->has('id') || request()->has('subject')) && ! request()->has('sea -1, -1, $offset, - env('ITEMS_PER_PAGE', 50), + config('nntmux.items_per_page', $orderBy, -1, $page->userdata['categoryexclusions'], @@ -83,7 +83,7 @@ if ((request()->has('id') || request()->has('subject')) && ! request()->has('sea 'lastvisit' => $page->userdata['lastlogin'], 'pagertotalitems' => \count($results) > 0 ? $results[0]['_totalrows'] : 0, 'pageroffset' => $offset, - 'pageritemsperpage' => env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage' => config('nntmux.items_per_page', 'pagerquerysuffix' => '#results', 'pagerquerybase' => WWW_TOP.'/search/'.htmlentities($searchString, ENT_QUOTES | ENT_HTML5).'?t='. implode(',', $categoryID).'&ob='.$orderBy.'&offset=', @@ -138,7 +138,7 @@ if (request()->has('searchadvr') && ! request()->has('id') && ! request()->has(' ($searchVars['searchadvdaysnew'] === '' ? -1 : $searchVars['searchadvdaysnew']), ($searchVars['searchadvdaysold'] === '' ? -1 : $searchVars['searchadvdaysold']), $offset, - env('ITEMS_PER_PAGE', 50), + config('nntmux.items_per_page', $orderBy, -1, $page->userdata['categoryexclusions'], @@ -151,7 +151,7 @@ if (request()->has('searchadvr') && ! request()->has('id') && ! request()->has(' 'lastvisit' => $page->userdata['lastlogin'], 'pagertotalitems' => \count($results) > 0 ? $results[0]['_totalrows'] : 0, 'pageroffset' => $offset, - 'pageritemsperpage' => env('ITEMS_PER_PAGE', 50), + 'pageritemsperpage' => config('nntmux.items_per_page', 'pagerquerysuffix' => '#results', 'pagerquerybase' => WWW_TOP.'/search?'.$orderByString.'&search_type=adv&ob='.$orderBy.'&offset=', ] diff --git a/public/pages/xxx.php b/public/pages/xxx.php index d607340f2..3454badbe 100644 --- a/public/pages/xxx.php +++ b/public/pages/xxx.php @@ -30,7 +30,7 @@ $ordering = $movie->getXXXOrdering(); $orderby = request()->has('ob') && in_array(request()->input('ob'), $ordering, false) ? request()->input('ob') : ''; $movies = []; -$results = $movie->getXXXRange($catarray, $offset, env('ITEMS_PER_COVER_PAGE', 20), $orderby, -1, $page->userdata['categoryexclusions']); +$results = $movie->getXXXRange($catarray, $offset, config('nntmux.items_per_cover_page', $orderby, -1, $page->userdata['categoryexclusions']); foreach ($results as $result) { $result['genre'] = makeFieldLinks($result, 'genre', 'xxx'); $result['actors'] = makeFieldLinks($result, 'actors', 'xxx'); @@ -55,7 +55,7 @@ $browseby_link = '&title='.$title.'&actors='.$actors.'&director='.$d $page->smarty->assign('pagertotalitems', $results[0]['_totalcount'] ?? 0); $page->smarty->assign('pageroffset', $offset); -$page->smarty->assign('pageritemsperpage', env('ITEMS_PER_COVER_PAGE', 20)); +$page->smarty->assign('pageritemsperpage', config('nntmux.items_per_cover_page'); $page->smarty->assign('pagerquerybase', WWW_TOP.'/xxx?t='.$category.$browseby_link.'&ob='.$orderby.'&offset='); $page->smarty->assign('pagerquerysuffix', '#results'); diff --git a/public/smarty.php b/public/smarty.php index 6c81a10bf..ac0dc5888 100644 --- a/public/smarty.php +++ b/public/smarty.php @@ -20,19 +20,6 @@ */ require_once dirname(__DIR__).DIRECTORY_SEPARATOR.'bootstrap'.DIRECTORY_SEPARATOR.'autoload.php'; -use Blacklight\config\Configure; - -try { - $config = new Configure('smarty'); -} catch (\RuntimeException $e) { - if ((int) $e->getCode() === 1) { - if (is_dir('install')) { - header('Location: install'); - exit(); - } - } -} - if (function_exists('ini_set') && function_exists('ini_get')) { ini_set('include_path', NN_WWW.PATH_SEPARATOR.ini_get('include_path')); } diff --git a/tests/Install/InstallTest.php b/tests/Install/InstallTest.php index 2612c57ad..a2043d0b8 100644 --- a/tests/Install/InstallTest.php +++ b/tests/Install/InstallTest.php @@ -17,9 +17,6 @@ require_once \dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'bootstrap/autoload.ph use App\Extensions\util\Versions; use App\Models\Settings; -use App\Models\User; -use Blacklight\config\Configure; -use Blacklight\ColorCLI; /** * Class InstallTest @@ -28,10 +25,6 @@ use Blacklight\ColorCLI; */ class InstallTest extends \PHPUnit\Framework\TestCase { - /** - * @var Configure - */ - public $config; public function testFullInstall()