diff --git a/Blacklight/Books.php b/Blacklight/Books.php index bebd48fe4..9b99acc0c 100755 --- a/Blacklight/Books.php +++ b/Blacklight/Books.php @@ -94,7 +94,7 @@ class Books $this->asstag = Settings::settingValue('APIs..amazonassociatetag'); $this->bookqty = Settings::settingValue('..maxbooksprocessed') !== '' ? (int) Settings::settingValue('..maxbooksprocessed') : 300; $this->sleeptime = Settings::settingValue('..amazonsleep') !== '' ? (int) Settings::settingValue('..amazonsleep') : 1000; - $this->imgSavePath = NN_COVERS.'book'.DS; + $this->imgSavePath = resource_path().'/covers/'.'book/'; $result = Settings::settingValue('..book_reqids'); $this->bookreqids = $result ?? Category::BOOKS_EBOOK; $this->renamed = (int) Settings::settingValue('..lookupbooks') === 2 ? 'AND isrenamed = 1' : ''; diff --git a/Blacklight/Console.php b/Blacklight/Console.php index 07a619e7e..5d90dcb2f 100755 --- a/Blacklight/Console.php +++ b/Blacklight/Console.php @@ -106,7 +106,7 @@ class Console $this->asstag = Settings::settingValue('APIs..amazonassociatetag'); $this->gameqty = (Settings::settingValue('..maxgamesprocessed') !== '') ? (int) Settings::settingValue('..maxgamesprocessed') : 150; $this->sleeptime = (Settings::settingValue('..amazonsleep') !== '') ? (int) Settings::settingValue('..amazonsleep') : 1000; - $this->imgSavePath = NN_COVERS.'console'.DS; + $this->imgSavePath = resource_path().'/covers/'.'console/'; $this->renamed = (int) Settings::settingValue('..lookupgames') === 2; $this->failCache = []; diff --git a/Blacklight/Games.php b/Blacklight/Games.php index 3deb064f6..e8a88ad61 100755 --- a/Blacklight/Games.php +++ b/Blacklight/Games.php @@ -128,7 +128,7 @@ class Games $this->publicKey = config('nntmux_api.giantbomb_api_key'); $this->gameQty = Settings::settingValue('..maxgamesprocessed') !== '' ? (int) Settings::settingValue('..maxgamesprocessed') : 150; - $this->imgSavePath = NN_COVERS.'games'.DS; + $this->imgSavePath = resource_path().'/covers/'.'games/'; $this->renamed = (int) Settings::settingValue('..lookupgames') === 2 ? 'AND isrenamed = 1' : ''; $this->matchPercentage = 60; $this->maxHitRequest = false; diff --git a/Blacklight/Movie.php b/Blacklight/Movie.php index 937293eb6..172c2d40a 100755 --- a/Blacklight/Movie.php +++ b/Blacklight/Movie.php @@ -196,7 +196,7 @@ class Movie $this->showPasswords = (new Releases())->showPasswords(); $this->echooutput = ($options['Echo'] && config('nntmux.echocli')); - $this->imgSavePath = NN_COVERS.'movies/'; + $this->imgSavePath = resource_path().'/covers/'.'movies/'; $this->service = ''; } diff --git a/Blacklight/Music.php b/Blacklight/Music.php index 795ad5e4c..1069ff062 100755 --- a/Blacklight/Music.php +++ b/Blacklight/Music.php @@ -94,7 +94,7 @@ class Music $this->asstag = Settings::settingValue('APIs..amazonassociatetag'); $this->musicqty = Settings::settingValue('..maxmusicprocessed') !== '' ? (int) Settings::settingValue('..maxmusicprocessed') : 150; $this->sleeptime = Settings::settingValue('..amazonsleep') !== '' ? (int) Settings::settingValue('..amazonsleep') : 1000; - $this->imgSavePath = NN_COVERS.'music'.DS; + $this->imgSavePath = resource_path().'/covers/'.'music/'; $this->renamed = (int) Settings::settingValue('..lookupmusic') === 2 ? 'AND isrenamed = 1' : ''; $this->failCache = []; diff --git a/Blacklight/ReleaseImage.php b/Blacklight/ReleaseImage.php index 7be1f565a..2c6ea64f7 100755 --- a/Blacklight/ReleaseImage.php +++ b/Blacklight/ReleaseImage.php @@ -63,11 +63,11 @@ class ReleaseImage public function __construct() { $this->colorCli = new ColorCLI(); - $this->audSavePath = NN_COVERS.'audiosample'.DS; - $this->imgSavePath = NN_COVERS.'preview'.DS; - $this->jpgSavePath = NN_COVERS.'sample'.DS; - $this->movieImgSavePath = NN_COVERS.'movies'.DS; - $this->vidSavePath = NN_COVERS.'video'.DS; + $this->audSavePath = resource_path().'/covers/'.'audiosample/'; + $this->imgSavePath = resource_path().'/covers/'.'preview/'; + $this->jpgSavePath = resource_path().'/covers/'.'sample/'; + $this->movieImgSavePath = resource_path().'/covers/'.'movies/'; + $this->vidSavePath = resource_path().'/covers/'.'video/'; } /** diff --git a/Blacklight/Tmux.php b/Blacklight/Tmux.php index d96c59cb0..595993797 100755 --- a/Blacklight/Tmux.php +++ b/Blacklight/Tmux.php @@ -264,7 +264,7 @@ class Tmux */ public function writelog($pane): ?string { - $path = NN_LOGS; + $path = storage_path().'/logs/'; $getdate = gmdate('Ymd'); $logs = Settings::settingValue('site.tmux.write_logs') ?? 0; if ($logs === 1) { diff --git a/Blacklight/XXX.php b/Blacklight/XXX.php index 19e854f26..9a9453b65 100755 --- a/Blacklight/XXX.php +++ b/Blacklight/XXX.php @@ -88,8 +88,8 @@ class XXX $this->movieQty = Settings::settingValue('..maxxxxprocessed') !== '' ? (int) Settings::settingValue('..maxxxxprocessed') : 100; $this->showPasswords = (new Releases())->showPasswords(); $this->echoOutput = ($options['Echo'] && config('nntmux.echocli')); - $this->imgSavePath = NN_COVERS.'xxx'.DS; - $this->cookie = NN_TMP.'xxx.cookie'; + $this->imgSavePath = resource_path().'/covers/'.'xxx/'; + $this->cookie = resource_path().'/tmp/xxx.cookie'; } /** diff --git a/Blacklight/db/PreDb.php b/Blacklight/db/PreDb.php index 7698fa843..33096b371 100755 --- a/Blacklight/db/PreDb.php +++ b/Blacklight/db/PreDb.php @@ -212,15 +212,16 @@ SQL_EXPORT; } /** - * @param null $settings + * @param null $settings * @param array $options * * @return mixed|null + * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ public function progress($settings = null, array $options = []) { $defaults = [ - 'path' => NN_ROOT.'cli'.DS.'data'.DS.'predb_progress.txt', + 'path' => base_path().'/'.'cli/data/predb_progress.txt', 'read' => true, ]; $options += $defaults; diff --git a/Blacklight/db/populate/AniDB.php b/Blacklight/db/populate/AniDB.php index 8e32b662f..8496c4b5c 100755 --- a/Blacklight/db/populate/AniDB.php +++ b/Blacklight/db/populate/AniDB.php @@ -74,7 +74,7 @@ class AniDB $anidbupdint = Settings::settingValue('APIs.AniDB.max_update_frequency'); $lastupdated = Settings::settingValue('APIs.AniDB.last_full_update'); - $this->imgSavePath = NN_COVERS.'anime'.DS; + $this->imgSavePath = resource_path().'/covers/'.'anime/'; $this->apiKey = config('nntmux_api.anidb_api_key'); $this->updateInterval = $anidbupdint ?? '7'; diff --git a/Blacklight/processing/post/ProcessAdditional.php b/Blacklight/processing/post/ProcessAdditional.php index 16d4e0db1..0d2ae3ed0 100755 --- a/Blacklight/processing/post/ProcessAdditional.php +++ b/Blacklight/processing/post/ProcessAdditional.php @@ -463,7 +463,7 @@ class ProcessAdditional ); } - $this->_showCLIReleaseID = (PHP_BINARY.' '.__DIR__.DS.'ProcessAdditional.php ReleaseID: '); + $this->_showCLIReleaseID = (PHP_BINARY.' '.__DIR__.'/ProcessAdditional.php ReleaseID: '); // Maximum amount of releases to fetch per run. $this->_queryLimit = @@ -512,7 +512,7 @@ class ProcessAdditional $this->_processAudioInfo = $this->_processMediaInfo; $this->_processPasswords = ! empty(Settings::settingValue('..checkpasswordedrar')) && ! empty(Settings::settingValue('apps..unrarpath')); - $this->_audioSavePath = NN_COVERS.'audiosample'.DS; + $this->_audioSavePath = resource_path().'/covers/'.'audiosample/'; $this->_audioFileRegex = '\.(AAC|AIFF|APE|AC3|ASF|DTS|FLAC|MKA|MKS|MP2|MP3|RA|OGG|OGM|W64|WAV|WMA)'; $this->_ignoreBookRegex = '/\b(epub|lit|mobi|pdf|sipdf|html)\b.*\.rar(?!.{20,})/i'; diff --git a/Blacklight/processing/tv/TV.php b/Blacklight/processing/tv/TV.php index 0a1d72c8e..3ecb5ef88 100755 --- a/Blacklight/processing/tv/TV.php +++ b/Blacklight/processing/tv/TV.php @@ -76,7 +76,7 @@ abstract class TV extends Videos $this->colorCli = new ColorCLI(); $this->catWhere = 'categories_id BETWEEN '.Category::TV_ROOT.' AND '.Category::TV_OTHER.' AND categories_id != '.Category::TV_ANIME; $this->tvqty = Settings::settingValue('..maxrageprocessed') !== '' ? (int) Settings::settingValue('..maxrageprocessed') : 75; - $this->imgSavePath = NN_COVERS.'tvshows'.DS; + $this->imgSavePath = resource_path().'/covers/'.'tvshows/'; $this->siteColumns = ['tvdb', 'trakt', 'tvrage', 'tvmaze', 'imdb', 'tmdb']; } diff --git a/Blacklight/utility/Git.php b/Blacklight/utility/Git.php index 855269cf2..4910a25a9 100755 --- a/Blacklight/utility/Git.php +++ b/Blacklight/utility/Git.php @@ -49,7 +49,7 @@ class Git extends GitRepository $defaults = [ 'create' => false, 'initialise' => false, - 'filepath' => NN_ROOT, + 'filepath' => base_path().'/', ]; $options += $defaults; diff --git a/Blacklight/utility/Utility.php b/Blacklight/utility/Utility.php index 0ed7016f9..e69aa8f87 100755 --- a/Blacklight/utility/Utility.php +++ b/Blacklight/utility/Utility.php @@ -244,26 +244,6 @@ class Utility return $string === '' ? false : $string; } - /** - * @param $path - */ - public static function setCoversConstant($path): void - { - if (! \defined('NN_COVERS')) { - switch (true) { - case $path[0] === '/' || $path[1] === ':' || $path[0] === '\\': - \define('NN_COVERS', Str::finish($path, '/')); - break; - case $path !== '' && $path[0] !== '/' && $path[1] !== ':' && $path[0] !== '\\': - \define('NN_COVERS', realpath(NN_ROOT.Str::finish($path, '/'))); - break; - case empty($path): // Default to resources location. - default: - \define('NN_COVERS', NN_RES.'covers/'); - } - } - } - /** * Creates an array to be used with stream_context_create() to verify openssl certificates * when connecting to a tls or ssl connection when using stream functions (fopen/file_get_contents/etc). @@ -357,7 +337,7 @@ class Utility ) ) { $fileSpec = sprintf($fileSpecTemplate, $options['type'], $options['id'], $options['suffix']); - $fileSpec = file_exists(NN_COVERS.$fileSpec) ? $fileSpec : + $fileSpec = file_exists(resource_path().'/covers/'.$fileSpec) ? $fileSpec : sprintf($fileSpecTemplate, $options['type'], 'no', $options['suffix']); } diff --git a/Changelog b/Changelog index aaad89130..1a5dcaa19 100755 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +2020-03-22 DariusIII + * Chg: Remove option to set covers path in database, it is hardcoded now to resources/covers/ 2020-03-01 DariusIII * Chg: Move all third party api keys from database to .env file 2020-02-27 DariusIII diff --git a/app/Console/Commands/InstallNntmux.php b/app/Console/Commands/InstallNntmux.php index e1edf711c..1e1200184 100644 --- a/app/Console/Commands/InstallNntmux.php +++ b/app/Console/Commands/InstallNntmux.php @@ -48,7 +48,7 @@ class InstallNntmux extends Command $error = false; if ($this->confirm('Are you sure you want to install NNTmux? This will wipe your database!!')) { - if (file_exists(NN_ROOT.'_install/install.lock')) { + if (file_exists(base_path().'/'.'_install/install.lock')) { if ($this->confirm('Do you want to remove install.lock file so you can continue with install?')) { $this->info('Removing install.lock file so we can continue with install process'); $remove = new Process('rm _install/install.lock'); diff --git a/app/Console/Commands/NntmuxResetDb.php b/app/Console/Commands/NntmuxResetDb.php index 90b9e21f4..c12b2c485 100644 --- a/app/Console/Commands/NntmuxResetDb.php +++ b/app/Console/Commands/NntmuxResetDb.php @@ -177,7 +177,7 @@ class NntmuxResetDb extends Command $this->info('Deleting all images, previews and samples that still remain.'); - $files = File::allFiles(NN_COVERS); + $files = File::allFiles(resource_path().'/covers/'); foreach ($files as $file) { if (basename($file) !== '.gitignore' && basename($file) !== 'no-cover.jpg' && basename($file) !== 'no-backdrop.jpg') { File::delete($file); diff --git a/app/Extensions/util/Git.php b/app/Extensions/util/Git.php index 7aed8e05e..b8459416a 100644 --- a/app/Extensions/util/Git.php +++ b/app/Extensions/util/Git.php @@ -62,7 +62,7 @@ class Git 'dev', ], ], - 'filepath' => NN_ROOT, + 'filepath' => base_path().'/', ]; $config += $defaults; diff --git a/app/Http/Controllers/Admin/GameController.php b/app/Http/Controllers/Admin/GameController.php index ebb34a067..e27765f26 100644 --- a/app/Http/Controllers/Admin/GameController.php +++ b/app/Http/Controllers/Admin/GameController.php @@ -57,7 +57,7 @@ class GameController extends BasePageController switch ($action) { case 'submit': - $coverLoc = NN_COVERS.'games/'.$id.'.jpg'; + $coverLoc = resource_path().'/covers/'.'games/'.$id.'.jpg'; if ($_FILES['cover']['size'] > 0) { $tmpName = $_FILES['cover']['tmp_name']; diff --git a/app/Http/Controllers/Admin/SiteController.php b/app/Http/Controllers/Admin/SiteController.php index c34f3850d..078e0b263 100644 --- a/app/Http/Controllers/Admin/SiteController.php +++ b/app/Http/Controllers/Admin/SiteController.php @@ -137,7 +137,7 @@ class SiteController extends BasePageController $this->smarty->assign('lookup_reqids_ids', [0, 1, 2]); $this->smarty->assign('lookup_reqids_names', ['Disabled', 'Lookup Request IDs', 'Lookup Request IDs Threaded']); - $this->smarty->assign('coversPath', NN_COVERS); + $this->smarty->assign('coversPath', resource_path().'/covers/'); // return a list of audiobooks, mags, ebooks, technical and foreign books $result = Category::query()->whereIn('id', [Category::MUSIC_AUDIOBOOK, Category::BOOKS_MAGAZINES, Category::BOOKS_TECHNICAL, Category::BOOKS_FOREIGN])->get(['id', 'title']); diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php index aaf841295..2a7e8d299 100644 --- a/bootstrap/autoload.php +++ b/bootstrap/autoload.php @@ -2,7 +2,6 @@ require_once dirname(__DIR__).DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php'; require __DIR__.DIRECTORY_SEPARATOR.'app.php'; -require_once 'constants.php'; require_once dirname(__DIR__).DIRECTORY_SEPARATOR.'app/Extensions/util/PhpYenc.php'; use Dotenv\Dotenv; diff --git a/bootstrap/constants.php b/bootstrap/constants.php deleted file mode 100755 index d7e30b2b9..000000000 --- a/bootstrap/constants.php +++ /dev/null @@ -1,44 +0,0 @@ - $files) { } // Store the dump. - $dumpFile = NN_RES.$match[2].'_predb_dump.csv'; + $dumpFile = resource_path().'/'.$match[2].'_predb_dump.csv'; $fetched = File::put($dumpFile, $dump); if (! $fetched) { - echo "Error storing dump file {$match[2]} in (".NN_RES.').'. + echo "Error storing dump file {$match[2]} in (".resource_path().'/'.').'. PHP_EOL; continue; } diff --git a/misc/testing/Dev/clean_nzbs.php b/misc/testing/Dev/clean_nzbs.php index 913591f1e..89ef45c86 100644 --- a/misc/testing/Dev/clean_nzbs.php +++ b/misc/testing/Dev/clean_nzbs.php @@ -9,7 +9,7 @@ use Blacklight\ReleaseImage; use Blacklight\Releases; use Blacklight\utility\Utility; -$dir = NN_RES.'movednzbs/'; +$dir = resource_path().'/'.'movednzbs/'; $colorCli = new ColorCLI(); if (! isset($argv[1]) || ! in_array($argv[1], ['true', 'move'])) { diff --git a/misc/testing/PostProc/check_covers.php b/misc/testing/PostProc/check_covers.php index ad3831dac..a7139c0bf 100644 --- a/misc/testing/PostProc/check_covers.php +++ b/misc/testing/PostProc/check_covers.php @@ -14,14 +14,7 @@ use Illuminate\Support\Facades\DB; $movie = new Movie(['Echo' => true]); $colorCli = new ColorCLI(); -$row = Settings::settingValue('site.main.coverspath'); -if ($row !== null) { - Utility::setCoversConstant($row); -} else { - die('Unable to determine covers path!'.PHP_EOL); -} - -$path2cover = NN_COVERS.'movies'.DS; +$path2cover = resource_path().'/covers/movies/'; if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'check')) { $couldbe = $argv[1] === 'true' ? $couldbe = 'had ' : 'could have '; diff --git a/misc/testing/PostProc/check_previews.php b/misc/testing/PostProc/check_previews.php index a3533d47e..4d26aa047 100644 --- a/misc/testing/PostProc/check_previews.php +++ b/misc/testing/PostProc/check_previews.php @@ -17,14 +17,7 @@ use Illuminate\Support\Facades\DB; $pdo = DB::connection()->getPdo(); $colorCli = new ColorCLI(); -$row = Settings::settingValue('site.main.coverspath'); -if ($row !== null) { - Utility::setCoversConstant($row); -} else { - die("Unable to determine covers path!\n"); -} - -$path2preview = NN_COVERS.'preview'.DS; +$path2preview = resource_path().'/covers/preview/'; if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'check')) { $releases = new Releases(); diff --git a/misc/testing/PostProc/getGameCovers.php b/misc/testing/PostProc/getGameCovers.php index 27d2b37ef..a78f2b51d 100644 --- a/misc/testing/PostProc/getGameCovers.php +++ b/misc/testing/PostProc/getGameCovers.php @@ -27,7 +27,7 @@ if ($total > 0) { if ($gameData === false) { $colorCli->primary($gameInfo['release'].' not found'); } else { - if (file_exists(NN_COVERS.'games'.DS.$gameData.'.jpg')) { + if (file_exists(resource_path().'/covers/'.'games/'.$gameData.'.jpg')) { $pdo->exec(sprintf('UPDATE gamesinfo SET cover = 1 WHERE id = %d', $arr['id'])); } } diff --git a/misc/testing/PostProc/getXXXSamples.php b/misc/testing/PostProc/getXXXSamples.php index 2abd5b3a9..5036d2040 100644 --- a/misc/testing/PostProc/getXXXSamples.php +++ b/misc/testing/PostProc/getXXXSamples.php @@ -9,7 +9,7 @@ use Blacklight\ReleaseImage; $pdo = DB::connection()->getPdo(); $colorCli = new ColorCLI(); -$path2cover = NN_COVERS.'samples'.DS; +$path2cover = resource_path().'/covers/'.'samples/'; if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'check')) { $releaseImage = new ReleaseImage(); diff --git a/misc/testing/PostProc/updateBookImages.php b/misc/testing/PostProc/updateBookImages.php index 5672fb874..64715d06f 100644 --- a/misc/testing/PostProc/updateBookImages.php +++ b/misc/testing/PostProc/updateBookImages.php @@ -14,7 +14,7 @@ if ($argc === 1 || $argv[1] !== 'true') { exit(); } -$path2covers = NN_COVERS.'book'.DS; +$path2covers = resource_path().'/covers/'.'book/'; $itr = File::allFiles($path2covers); foreach ($itr as $filePath) { diff --git a/misc/testing/PostProc/updateConsoleImages.php b/misc/testing/PostProc/updateConsoleImages.php index e48d602e5..70b63e489 100644 --- a/misc/testing/PostProc/updateConsoleImages.php +++ b/misc/testing/PostProc/updateConsoleImages.php @@ -14,7 +14,7 @@ if ($argc === 1 || $argv[1] !== 'true') { exit(); } -$path2covers = NN_COVERS.'console'.DS; +$path2covers = resource_path().'/covers/'.'console/'; $itr = File::allFiles($path2covers); foreach ($itr as $filePath) { diff --git a/misc/testing/PostProc/updateGamesImages.php b/misc/testing/PostProc/updateGamesImages.php index 17d6d278b..f7c68d1e1 100644 --- a/misc/testing/PostProc/updateGamesImages.php +++ b/misc/testing/PostProc/updateGamesImages.php @@ -19,13 +19,7 @@ if ($argc === 1 || $argv[1] !== 'true') { $pdo = DB::connection()->getPdo(); -$row = Settings::settingValue('site.main.coverspath'); -if ($row !== null) { - Utility::setCoversConstant($row); -} else { - die("Unable to set Covers' constant!\n"); -} -$path2covers = NN_COVERS.'games'.DS; +$path2covers = resource_path().'/covers/games/'; $itr = File::allFiles($path2covers); foreach ($itr as $filePath) { diff --git a/misc/testing/PostProc/updateMovieImages.php b/misc/testing/PostProc/updateMovieImages.php index 94b6fea0f..e9a77fa0f 100644 --- a/misc/testing/PostProc/updateMovieImages.php +++ b/misc/testing/PostProc/updateMovieImages.php @@ -16,13 +16,7 @@ if ($argc === 1 || $argv[1] !== 'true') { exit(); } -$row = Settings::settingValue('site.main.coverspath'); -if ($row !== null) { - Utility::setCoversConstant($row); -} else { - die("Unable to set Covers' constant!\n"); -} -$path2covers = NN_COVERS.'movies'.DS; +$path2covers = resource_path().'/covers/movies/'; $itr = File::allFiles($path2covers); foreach ($itr as $filePath) { diff --git a/misc/testing/PostProc/updateMusicImages.php b/misc/testing/PostProc/updateMusicImages.php index 15dafd306..260c9cc80 100644 --- a/misc/testing/PostProc/updateMusicImages.php +++ b/misc/testing/PostProc/updateMusicImages.php @@ -14,7 +14,7 @@ if ($argc === 1 || $argv[1] !== 'true') { exit(); } -$path2covers = NN_COVERS.'music'.DS; +$path2covers = resource_path().'/covers/'.'music/'; $itr = File::allFiles($path2covers); foreach ($itr as $filePath) { diff --git a/misc/testing/PostProc/updateXXXImages.php b/misc/testing/PostProc/updateXXXImages.php index da7e883d8..2522d8bbb 100644 --- a/misc/testing/PostProc/updateXXXImages.php +++ b/misc/testing/PostProc/updateXXXImages.php @@ -14,7 +14,7 @@ if ($argc === 1 || $argv[1] !== 'true') { exit(); } -$path2covers = NN_COVERS.'xxx'.DS; +$path2covers = resource_path().'/covers/'.'xxx/'; $itr = File::allFiles($path2covers); foreach ($itr as $filePath) { diff --git a/misc/testing/nzb-export.php b/misc/testing/nzb-export.php index d4bdcb01c..cc35d518a 100644 --- a/misc/testing/nzb-export.php +++ b/misc/testing/nzb-export.php @@ -18,8 +18,8 @@ if (count($argv) !== 6) { 'arg4 : Group ID for the group or false | number/false'.$n. 'arg5 : Gzip the NZB files (recommended, faster/takes less space) | true/false'.$n.$n. 'Examples: '.$n. - $_SERVER['_'].' '.$argv[0].' '.NN_ROOT.'exportFolder'.DS.' 01/01/2012 01/01/2014 false true'.$n. - $_SERVER['_'].' '.$argv[0].' '.NN_ROOT.'exportFolder'.DS.' false 01/01/2014 12 false'.$n + $_SERVER['_'].' '.$argv[0].' '.base_path().'/exportFolder/ 01/01/2012 01/01/2014 false true'.$n. + $_SERVER['_'].' '.$argv[0].' '.base_path().'/'.'exportFolder/ false 01/01/2014 12 false'.$n ); } diff --git a/misc/testing/nzb-import.php b/misc/testing/nzb-import.php index b15f7cdef..ea34208f1 100644 --- a/misc/testing/nzb-import.php +++ b/misc/testing/nzb-import.php @@ -18,7 +18,7 @@ if (count($argv) !== 6) { 'arg3 : Delete NZB when unsuccessfully imported.(not recommended) | true/false'.$n. 'arg4 : Use NZB file name as release name.(not recommended) | true/false'.$n. 'arg5 : Import this many NZB files. (RECOMMENDED 100,000) | a number'.$n.$n. - 'ie: '.$_SERVER['_'].' '.__FILE__.' '.NN_ROOT.'nzbToImport'.DS.' true false false 1000'.$n + 'ie: '.$_SERVER['_'].' '.__FILE__.' '.base_path().'/nzbToImport/ true false false 1000'.$n ); } diff --git a/misc/update/tmux/monitor.php b/misc/update/tmux/monitor.php index 9dded8ab7..96cd54445 100644 --- a/misc/update/tmux/monitor.php +++ b/misc/update/tmux/monitor.php @@ -26,9 +26,9 @@ try { echo $e; } -$runVar['paths']['misc'] = NN_MISC; -$runVar['paths']['cli'] = NN_ROOT.'cli/'; -$runVar['paths']['scraper'] = NN_MISC.'IRCScraper'.DS.'scrape.php'; +$runVar['paths']['misc'] = base_path().'/misc/'; +$runVar['paths']['cli'] = base_path().'/cli/'; +$runVar['paths']['scraper'] = base_path().'/misc/IRCScraper/scrape.php'; $db_name = config('nntmux.db_name'); diff --git a/misc/update/tmux/run.php b/misc/update/tmux/run.php index 759371f27..4c9c35bf2 100644 --- a/misc/update/tmux/run.php +++ b/misc/update/tmux/run.php @@ -7,7 +7,7 @@ use App\Models\Settings; use Blacklight\ColorCLI; use Blacklight\utility\Utility; -$DIR = NN_TMUX; +$DIR = base_path().'/misc/update/tmux'; $import = Settings::settingValue('site.tmux.import') ?? 0; $tmux_session = Settings::settingValue('site.tmux.tmux_session') ?? 0; $seq = Settings::settingValue('site.tmux.sequential') ?? 0; @@ -33,7 +33,7 @@ Collection::query()->where('dateadded', '<', now()->subHours($delaytimet))->upda function writelog($pane) { - $path = NN_RES.'logs'; + $path = resource_path().'/'.'logs'; $getdate = gmdate('Ymd'); $logs = Settings::settingValue('site.tmux.write_logs'); if ((int) $logs === 1) { diff --git a/resources/views/themes/admin/site-edit.tpl b/resources/views/themes/admin/site-edit.tpl index c743001f6..3081608b5 100644 --- a/resources/views/themes/admin/site-edit.tpl +++ b/resources/views/themes/admin/site-edit.tpl @@ -61,14 +61,6 @@ -