From 49b36c2ebe4074a7375feb4af1bc6e9f2ebfb8e3 Mon Sep 17 00:00:00 2001 From: DariusIII Date: Thu, 14 Jul 2016 08:47:39 +0200 Subject: [PATCH] Replace usage of indexer.php with bootstrap.php --- Changelog | 1 + build/NewPatches.php | 4 ++-- build/git-hooks/runHooks.php | 2 +- cli/data/populate_anidb.php | 4 ++-- cli/data/predb_import_daily_batch.php | 2 +- cli/verify_permissions.php | 2 +- cli/versions.php | 4 ++-- misc/IRCScraper/scrape.php | 2 +- misc/sphinxsearch/create_se_tables.php | 2 +- misc/sphinxsearch/optimize.php | 2 +- misc/sphinxsearch/populate_rt_indexes.php | 2 +- misc/sphinxsearch/toggle_search_type.php | 2 +- misc/testing/DB/change_USP_provider.php | 2 +- misc/testing/DB/check_unique_indexes.php | 2 +- misc/testing/DB/convert_mysql_tables.php | 2 +- misc/testing/DB/convert_to_tpg.php | 2 +- misc/testing/DB/convert_to_tpg_alt.php | 2 +- misc/testing/DB/mysqldump_tables.php | 2 +- misc/testing/DB/populateTraktID.php | 2 +- misc/testing/DB/populate_nzb_guid.php | 2 +- misc/testing/DB/rename_to_lower.php | 4 ++-- misc/testing/DB/reset_postprocessing.php | 2 +- misc/testing/DB/reset_truncate.php | 2 +- misc/testing/DB/resetdb.php | 2 +- misc/testing/DB/setUserPasswordHash.php | 2 +- misc/testing/DB/setUserPasswordHashesToEmail.php | 2 +- misc/testing/DB/show_table_sizes.php | 2 +- misc/testing/Dev/clean_nzbs.php | 2 +- misc/testing/NZB/nzb-reorg.php | 2 +- misc/testing/PostProc/check_covers.php | 2 +- misc/testing/PostProc/check_previews.php | 2 +- misc/testing/PostProc/getConsole.php | 2 +- misc/testing/PostProc/getGameCovers.php | 2 +- misc/testing/PostProc/getImdb.php | 2 +- misc/testing/PostProc/getMovieCovers.php | 2 +- misc/testing/PostProc/getXXXCovers.php | 2 +- misc/testing/PostProc/updateBookImages.php | 4 ++-- misc/testing/PostProc/updateConsoleImages.php | 4 ++-- misc/testing/PostProc/updateGamesImages.php | 4 ++-- misc/testing/PostProc/updateMovieImages.php | 4 ++-- misc/testing/PostProc/updateMusicImages.php | 4 ++-- misc/testing/PostProc/updateXXXImages.php | 2 +- misc/testing/PreDB/dump_predb.php | 2 +- misc/testing/Releases/delete_releases.php | 2 +- misc/testing/Releases/fixReleaseNames.php | 2 +- misc/testing/Releases/recategorize.php | 2 +- misc/testing/Releases/removeCrapReleases.php | 2 +- misc/testing/Tests/regexverify.php | 2 +- misc/testing/Tests/test_amazon_API.php | 2 +- misc/testing/Tests/test_cache_server.php | 2 +- misc/testing/Tests/test_giantbomb_API.php | 2 +- misc/testing/Tests/test_nntp_server.php | 2 +- misc/testing/Tests/test_regex.php | 4 ++-- misc/testing/Tests/test_rottentomato_API.php | 2 +- misc/testing/Tests/test_tmdb_API.php | 2 +- misc/testing/Tests/test_trakt_API.php | 2 +- misc/testing/Tests/test_tvdb_API.php | 2 +- misc/testing/Tests/test_tvmaze_API.php | 2 +- misc/testing/Tests/timetest.php | 2 +- misc/testing/Various/renametopre.php | 2 +- misc/testing/_run_once/tpg_delete_triggers_2015-08-14.php | 2 +- misc/testing/_run_once/tpg_fixes.php | 2 +- misc/testing/_run_once/tpg_update_triggers_2014-09-25.php | 2 +- misc/testing/dumpnfo.php | 2 +- misc/testing/fix_filesize.php | 2 +- misc/testing/nzb-export.php | 2 +- misc/testing/nzb-import.php | 2 +- misc/testing/refreshMovie.php | 2 +- misc/testing/rottentom.php | 2 +- misc/testing/spotnab.php | 2 +- misc/testing/tidynzbfolder.php | 2 +- misc/testing/updateCategories.php | 2 +- misc/update/backfill.php | 2 +- misc/update/backfill_date.php | 2 +- misc/update/config.php | 2 +- misc/update/decrypt_hashes.php | 2 +- misc/update/import.php | 2 +- misc/update/match_prefiles.php | 2 +- misc/update/nix/multiprocessing/.do_not_run/require.php | 2 +- misc/update/nix/multiprocessing/.do_not_run/switch.php | 2 +- misc/update/nix/tmux/bin/fixreleasenames.php | 2 +- misc/update/nix/tmux/bin/groupfixrelnames.php | 2 +- misc/update/nix/tmux/bin/postprocess_pre.php | 2 +- misc/update/nix/tmux/bin/postprocess_threaded.php | 2 +- misc/update/nix/tmux/bin/showsleep.php | 2 +- misc/update/nix/tmux/bin/update_groups.php | 2 +- misc/update/nix/tmux/monitor.php | 2 +- misc/update/nix/tmux/run.php | 2 +- misc/update/nix/tmux/start.php | 2 +- misc/update/nix/tmux/stop.php | 2 +- misc/update/nntpproxy.php | 2 +- misc/update/postprocess.php | 2 +- misc/update/requestid.php | 2 +- misc/update/update_binaries.php | 4 ++-- misc/update/update_releases.php | 2 +- misc/update/update_theaters.php | 2 +- 96 files changed, 107 insertions(+), 106 deletions(-) diff --git a/Changelog b/Changelog index 817a6e8b6..b9660ee29 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2016-07-14 DariusIII + * Chg: Replace usage of indexer.php with bootstrap.php * Chg: Add workaround for duplicate constants warning * Chg: Create gitignore for new configuration folder 2016-07-13 DariusIII diff --git a/build/NewPatches.php b/build/NewPatches.php index 54adcc671..8c6eaf7e5 100644 --- a/build/NewPatches.php +++ b/build/NewPatches.php @@ -19,7 +19,7 @@ * @copyright 2015 nZEDb */ -require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'indexer.php'; +require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'bootstrap.php'; use nntmux\db\DbUpdate; use nntmux\utility\Git; @@ -46,4 +46,4 @@ if (in_array($branch, $git->mainBranches())) { } } -exit($error); \ No newline at end of file +exit($error); diff --git a/build/git-hooks/runHooks.php b/build/git-hooks/runHooks.php index 0f2a0ac1a..0ec81b1d5 100755 --- a/build/git-hooks/runHooks.php +++ b/build/git-hooks/runHooks.php @@ -20,7 +20,7 @@ */ define('GIT_PRE_COMMIT', true); -require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php'); +require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'bootstrap.php'); use nntmux\utility\Git; use app\extensions\util\Versions; diff --git a/cli/data/populate_anidb.php b/cli/data/populate_anidb.php index 681c8d832..c4d50a278 100755 --- a/cli/data/populate_anidb.php +++ b/cli/data/populate_anidb.php @@ -2,7 +2,7 @@ /* This script is designed to gather all show data from anidb and add it to the anidb table for nntmux, as part of this process we need the number of PI queries that can be executed max and whether or not we want debuging the first argument if unset will try to do the entire list (a good way to get banned), the second option can be blank or true for debugging. * IF you are using this script then then you also want to edit anidb.php in www/lib and locate "604800" and replace it with 1204400, this will make sure it never tries to connect to anidb as this will fail */ -require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php'); +require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'bootstrap.php'); use nntmux\db\Settings; use nntmux\db\populate\AniDB; @@ -16,4 +16,4 @@ if ($argc > 1 && $argv[1] == true) { "To execute this script you must provide a boolean argument." . PHP_EOL . "Argument1: true|false to run this script or not"), true ); -} \ No newline at end of file +} diff --git a/cli/data/predb_import_daily_batch.php b/cli/data/predb_import_daily_batch.php index cc61293fa..7a62f69e9 100755 --- a/cli/data/predb_import_daily_batch.php +++ b/cli/data/predb_import_daily_batch.php @@ -22,7 +22,7 @@ /* TODO better tune the queries for performance, including pre-fetching groups_id and other data for faster inclusion in the main query. */ -require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php'); +require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'bootstrap.php'); use nntmux\db\PreDb; use nntmux\utility\Utility; diff --git a/cli/verify_permissions.php b/cli/verify_permissions.php index da1174772..55e6e3ed8 100644 --- a/cli/verify_permissions.php +++ b/cli/verify_permissions.php @@ -13,7 +13,7 @@ if (!isset($argv[1]) || $argv[1] !== 'yes') { ); } -require_once realpath(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'indexer.php'); +require_once realpath(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'bootstrap.php'); define('R', 1); define('W', 2); diff --git a/cli/versions.php b/cli/versions.php index faa2c2ca6..0d1504b4b 100644 --- a/cli/versions.php +++ b/cli/versions.php @@ -18,7 +18,7 @@ * @author niel * @copyright 2014 nZEDb */ -require_once realpath(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'indexer.php'); +require_once realpath(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'bootstrap.php'); use nntmux\utility\Utility; use nntmux\utility\Versions; @@ -49,4 +49,4 @@ function output($vers) echo "SQL DB: " . $vers->out->primary($vers->getSQLPatchFromDb()); echo "SQL File: " . $vers->out->primary($vers->getSQLPatchFromFiles()); echo " Tag: " . $vers->out->primary($vers->getTagVersion()); -} \ No newline at end of file +} diff --git a/misc/IRCScraper/scrape.php b/misc/IRCScraper/scrape.php index 7f8304c52..b758ade68 100644 --- a/misc/IRCScraper/scrape.php +++ b/misc/IRCScraper/scrape.php @@ -1,5 +1,5 @@ log->info("All table column names are already lowercase"); } else { echo $pdo->log->header($count . " colums renamed"); -} \ No newline at end of file +} diff --git a/misc/testing/DB/reset_postprocessing.php b/misc/testing/DB/reset_postprocessing.php index d9da6719e..c871f816f 100755 --- a/misc/testing/DB/reset_postprocessing.php +++ b/misc/testing/DB/reset_postprocessing.php @@ -1,5 +1,5 @@ . */ -require_once realpath(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'indexer.php'); +require_once realpath(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'bootstrap.php'); use nntmux\db\Settings; use nntmux\ColorCLI; diff --git a/misc/testing/DB/show_table_sizes.php b/misc/testing/DB/show_table_sizes.php index a69f32623..05dd4da83 100644 --- a/misc/testing/DB/show_table_sizes.php +++ b/misc/testing/DB/show_table_sizes.php @@ -1,5 +1,5 @@ log->header($covers . " covers set."); -echo $pdo->log->header($deleted . " books unset."); \ No newline at end of file +echo $pdo->log->header($deleted . " books unset."); diff --git a/misc/testing/PostProc/updateConsoleImages.php b/misc/testing/PostProc/updateConsoleImages.php index 02bbb532d..8c62bf4e5 100644 --- a/misc/testing/PostProc/updateConsoleImages.php +++ b/misc/testing/PostProc/updateConsoleImages.php @@ -1,5 +1,5 @@ log->header($covers . " covers set."); -echo $pdo->log->header($deleted . " consoles unset."); \ No newline at end of file +echo $pdo->log->header($deleted . " consoles unset."); diff --git a/misc/testing/PostProc/updateGamesImages.php b/misc/testing/PostProc/updateGamesImages.php index 3dae8c68c..0df85f883 100644 --- a/misc/testing/PostProc/updateGamesImages.php +++ b/misc/testing/PostProc/updateGamesImages.php @@ -1,5 +1,5 @@ log->header($covers . " covers set."); -echo $pdo->log->header($deleted . " games unset."); \ No newline at end of file +echo $pdo->log->header($deleted . " games unset."); diff --git a/misc/testing/PostProc/updateMovieImages.php b/misc/testing/PostProc/updateMovieImages.php index 8d35c3a00..97f7a744c 100644 --- a/misc/testing/PostProc/updateMovieImages.php +++ b/misc/testing/PostProc/updateMovieImages.php @@ -1,5 +1,5 @@ log->header($covers . " covers set."); echo $pdo->log->header($updated . " backdrops set."); -echo $pdo->log->header($deleted . " movies unset."); \ No newline at end of file +echo $pdo->log->header($deleted . " movies unset."); diff --git a/misc/testing/PostProc/updateMusicImages.php b/misc/testing/PostProc/updateMusicImages.php index 6bd1df134..e545cfec7 100644 --- a/misc/testing/PostProc/updateMusicImages.php +++ b/misc/testing/PostProc/updateMusicImages.php @@ -1,5 +1,5 @@ log->header($covers . " covers set."); -echo $pdo->log->header($deleted . " music unset."); \ No newline at end of file +echo $pdo->log->header($deleted . " music unset."); diff --git a/misc/testing/PostProc/updateXXXImages.php b/misc/testing/PostProc/updateXXXImages.php index 0badb916d..a5461d695 100644 --- a/misc/testing/PostProc/updateXXXImages.php +++ b/misc/testing/PostProc/updateXXXImages.php @@ -1,5 +1,5 @@ 0)?1:0); \ No newline at end of file +exit(($errcnt>0)?1:0); diff --git a/misc/testing/Tests/test_rottentomato_API.php b/misc/testing/Tests/test_rottentomato_API.php index 5ad04d88d..553afa5df 100755 --- a/misc/testing/Tests/test_rottentomato_API.php +++ b/misc/testing/Tests/test_rottentomato_API.php @@ -1,5 +1,5 @@ queryDirect("select releases.searchname, releases.postdate, uncompress(release_nfos.nfo) as nfo from releases inner join release_nfos on releases.ID = release_nfos.releaseID and release_nfos.nfo is not null order by postdate"); while ($row = $db->getAssocArray($res)) { $dir = date("Ymd", strtotime($row["postdate"])); if (!file_exists($dir)) mkdir($dir); $filename = $dir."/".safeFilename($row["searchname"]).".nfo"; if (!file_exists($filename)) { $fh = fopen($filename, 'w'); fwrite($fh, Utility::cp437toUTF($row["nfo"])); fclose($fh); } } \ No newline at end of file +queryDirect("select releases.searchname, releases.postdate, uncompress(release_nfos.nfo) as nfo from releases inner join release_nfos on releases.ID = release_nfos.releaseID and release_nfos.nfo is not null order by postdate"); while ($row = $db->getAssocArray($res)) { $dir = date("Ymd", strtotime($row["postdate"])); if (!file_exists($dir)) mkdir($dir); $filename = $dir."/".safeFilename($row["searchname"]).".nfo"; if (!file_exists($filename)) { $fh = fopen($filename, 'w'); fwrite($fh, Utility::cp437toUTF($row["nfo"])); fclose($fh); } } \ No newline at end of file diff --git a/misc/testing/fix_filesize.php b/misc/testing/fix_filesize.php index ee0ae54d9..77a463be3 100644 --- a/misc/testing/fix_filesize.php +++ b/misc/testing/fix_filesize.php @@ -6,7 +6,7 @@ If after import you have a bunch of zero sized releases run this Author: lordgnu */ -require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php'); +require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'bootstrap.php'); use nntmux\db\Settings; use nntmux\NZB; diff --git a/misc/testing/nzb-export.php b/misc/testing/nzb-export.php index 5d3f511f0..cda7cb514 100644 --- a/misc/testing/nzb-export.php +++ b/misc/testing/nzb-export.php @@ -1,5 +1,5 @@ Script will backfill ONLY a.b.games.xbox from May 15, 2011 */ -require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'indexer.php'); +require_once realpath(dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'bootstrap.php'); use nntmux\Backfill; diff --git a/misc/update/config.php b/misc/update/config.php index 5593d791a..a7616c4e1 100755 --- a/misc/update/config.php +++ b/misc/update/config.php @@ -1,5 +1,5 @@ diff --git a/misc/update/decrypt_hashes.php b/misc/update/decrypt_hashes.php index a81fc2ec2..fcdcc9a57 100755 --- a/misc/update/decrypt_hashes.php +++ b/misc/update/decrypt_hashes.php @@ -1,5 +1,5 @@ updateAllGroups((isset($argv[1]) && is_numeric($argv[1]) && $argv[1] > 0 ? $argv[1] : $maxHeaders)); -} \ No newline at end of file +} diff --git a/misc/update/update_releases.php b/misc/update/update_releases.php index 800aa04d7..b24897391 100755 --- a/misc/update/update_releases.php +++ b/misc/update/update_releases.php @@ -1,5 +1,5 @@