From 0ccb312ff5c2f2f345adc744ea3fa77311b243bc Mon Sep 17 00:00:00 2001 From: Darko Date: Tue, 28 Jul 2015 09:55:13 +0200 Subject: [PATCH] Replace array() with shorthand. --- .../magpierss/extlib/Snoopy.class.inc | 14 ++-- misc/reqscraper/magpierss/rss_fetch.inc | 2 +- misc/reqscraper/magpierss/rss_parse.inc | 14 ++-- misc/reqscraper/query.php | 2 +- misc/testing/nzb-import.php | 2 +- misc/testing/parsebooknames.php | 2 +- misc/testing/queryamazon.php | 2 +- misc/testing/refreshMovie.php | 2 +- misc/testing/spotnab.php | 2 +- misc/testing/test_blacklist.php | 12 ++-- .../nix_scripts/tmux/bin/update_binaries.php | 4 +- .../nix_scripts/tmux/lib/DB/patchDB.php | 8 +-- .../tmux/lib/testing/DB/populate_nzb_guid.php | 2 +- .../lib/testing/Dev/test_hash_algorithms.php | 6 +- .../tmux/lib/testing/_run_once/tpg_fixes.php | 2 +- .../lib/testing/predb_import_daily_batch.php | 2 +- .../nix_scripts/tmux/scripts/mysqlreport | 30 ++++---- newznab/controllers/AniDB.php | 2 +- newznab/controllers/Categorize.php | 2 +- newznab/controllers/Category.php | 8 +-- newznab/controllers/Console.php | 10 +-- newznab/controllers/ConsoleTools.php | 2 +- newznab/controllers/Desura.php | 6 +- newznab/controllers/Enzebe.php | 6 +- newznab/controllers/Games.php | 18 ++--- newznab/controllers/Genres.php | 2 +- newznab/controllers/Greenlight.php | 8 +-- newznab/controllers/Groups.php | 4 +- newznab/controllers/Hotmovies.php | 8 +-- newznab/controllers/IRCClient.php | 4 +- newznab/controllers/IRCScraper.php | 4 +- newznab/controllers/Movie.php | 18 ++--- newznab/controllers/Music.php | 12 ++-- newznab/controllers/NNTP.php | 2 +- newznab/controllers/NZBContents.php | 2 +- newznab/controllers/NZBVortex.php | 2 +- newznab/controllers/NameFixer.php | 26 +++---- newznab/controllers/Nfo.php | 26 +++---- newznab/controllers/Parsing.php | 4 +- newznab/controllers/Popporn.php | 6 +- newznab/controllers/PostProcess.php | 6 +- newznab/controllers/PowerProcess.php | 2 +- newznab/controllers/PreHash.php | 2 +- newznab/controllers/ReleaseCleaning.php | 2 +- newznab/controllers/RequestID.php | 4 +- newznab/controllers/RequestIDLocal.php | 6 +- newznab/controllers/RequestIDWeb.php | 4 +- newznab/controllers/Sharing.php | 2 +- newznab/controllers/Sites.php | 4 +- newznab/controllers/Sphinx.php | 72 +++++++++---------- newznab/controllers/Steam.php | 8 +-- newznab/controllers/TheTVDB.php | 24 +++---- newznab/controllers/Tmux.php | 6 +- newznab/controllers/TvRage.php | 16 ++--- newznab/controllers/zipfile.php | 4 +- newznab/processing/post/AniDB.php | 4 +- newznab/processing/post/ProcessAdditional.php | 14 ++-- www/admin/binaryblacklist-edit.php | 2 +- www/admin/index.php | 2 +- www/admin/menu-edit.php | 2 +- www/admin/preview-list.php | 2 +- www/admin/regex-edit.php | 2 +- www/admin/regex-test.php | 2 +- www/admin/role-edit.php | 6 +- www/admin/site-edit.php | 4 +- www/admin/spotnab-edit.php | 2 +- www/admin/user-list.php | 2 +- www/pages/ajax_mymovies.php | 10 +-- www/pages/anime.php | 8 +-- www/pages/api.php | 8 +-- www/pages/console.php | 8 +-- www/pages/details.php | 2 +- www/pages/dlbrowse.php | 6 +- www/pages/games.php | 8 +-- www/pages/mymoviesedit.php | 6 +- www/pages/newposterwall.php | 2 +- www/pages/series.php | 10 +-- www/pages/xxx.php | 6 +- 78 files changed, 285 insertions(+), 285 deletions(-) diff --git a/misc/reqscraper/magpierss/extlib/Snoopy.class.inc b/misc/reqscraper/magpierss/extlib/Snoopy.class.inc index f860bc68b..20f8232cb 100644 --- a/misc/reqscraper/magpierss/extlib/Snoopy.class.inc +++ b/misc/reqscraper/magpierss/extlib/Snoopy.class.inc @@ -47,9 +47,9 @@ class Snoopy var $proxy_port = ""; // proxy port to use var $agent = "Snoopy v1.0"; // agent we masquerade as var $referer = ""; // referer info to pass - var $cookies = array(); // array of cookies to pass + var $cookies = []; // array of cookies to pass // $cookies["username"]="joe"; - var $rawheaders = array(); // array of raw headers to send + var $rawheaders = []; // array of raw headers to send // $rawheaders["Content-type"]="text/html"; var $maxredirs = 5; // http redirection depth maximum. 0 = disallow @@ -73,7 +73,7 @@ class Snoopy var $error = ""; // error messages sent here var $response_code = ""; // response code returned from server - var $headers = array(); // headers returned from server sent here + var $headers = []; // headers returned from server sent here var $maxlength = 500000; // max return data length (body) var $read_timeout = 0; // timeout on read operations, in seconds // supported only since PHP 4 Beta 4 @@ -107,7 +107,7 @@ class Snoopy var $_mime_boundary = ""; // MIME boundary for multipart/form-data submit type var $_redirectaddr = false; // will be set if page fetched is a redirect var $_redirectdepth = 0; // increments on an http redirect - var $_frameurls = array(); // frame src urls + var $_frameurls = []; // frame src urls var $_framedepth = 0; // increments on frame depth var $_isproxy = false; // set if using a proxy server @@ -173,7 +173,7 @@ class Snoopy if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) { $frameurls = $this->_frameurls; - $this->_frameurls = array(); + $this->_frameurls = []; while(list(,$frameurl) = each($frameurls)) { @@ -232,7 +232,7 @@ class Snoopy if($this->_framedepth < $this->maxframes && count($this->_frameurls) > 0) { $frameurls = $this->_frameurls; - $this->_frameurls = array(); + $this->_frameurls = []; while(list(,$frameurl) = each($frameurls)) { @@ -592,7 +592,7 @@ class Snoopy if($this->passcookies && $this->_redirectaddr) $this->setcookies(); - $headers = array(); + $headers = []; $URI_PARTS = parse_url($URI); if(empty($url)) diff --git a/misc/reqscraper/magpierss/rss_fetch.inc b/misc/reqscraper/magpierss/rss_fetch.inc index 75d18126c..3e0cd30c6 100644 --- a/misc/reqscraper/magpierss/rss_fetch.inc +++ b/misc/reqscraper/magpierss/rss_fetch.inc @@ -122,7 +122,7 @@ function fetch_rss ($url) { $cache_status = 0; // response of check_cache - $request_headers = array(); // HTTP headers to send with fetch + $request_headers = []; // HTTP headers to send with fetch $rss = 0; // parsed RSS object $errormsg = 0; // errors, if any diff --git a/misc/reqscraper/magpierss/rss_parse.inc b/misc/reqscraper/magpierss/rss_parse.inc index 63b30a21f..68b9c5589 100644 --- a/misc/reqscraper/magpierss/rss_parse.inc +++ b/misc/reqscraper/magpierss/rss_parse.inc @@ -34,11 +34,11 @@ require_once (MAGPIE_DIR . 'rss_utils.inc'); class MagpieRSS { var $parser; - var $current_item = array(); // item currently being parsed - var $items = array(); // collection of parsed items - var $channel = array(); // hash of channel fields - var $textinput = array(); - var $image = array(); + var $current_item = []; // item currently being parsed + var $items = []; // collection of parsed items + var $channel = []; // hash of channel fields + var $textinput = []; + var $image = []; var $feed_type; var $feed_version; var $encoding = ''; // output encoding of parsed rss @@ -54,7 +54,7 @@ class MagpieRSS { var $_KNOWN_ENCODINGS = array('UTF-8', 'US-ASCII', 'ISO-8859-1'); // parser variables, useless if you're not a parser, treat as private - var $stack = array(); // parser stack + var $stack = []; // parser stack var $inchannel = false; var $initem = false; var $incontent = false; // if in Atom field @@ -279,7 +279,7 @@ class MagpieRSS { if ( $el == 'item' or $el == 'entry' ) { $this->items[] = $this->current_item; - $this->current_item = array(); + $this->current_item = []; $this->initem = false; } elseif ($this->feed_type == RSS and $this->current_namespace == '' and $el == 'textinput' ) diff --git a/misc/reqscraper/query.php b/misc/reqscraper/query.php index 1c19e2a6d..0cba23a77 100644 --- a/misc/reqscraper/query.php +++ b/misc/reqscraper/query.php @@ -2,7 +2,7 @@ require_once('config.php'); $type = isset($_GET["t"]) ? $_GET["t"] : "tv"; -$reqid = isset($_GET["reqid"]) ? explode(",",$_GET["reqid"]) : array(); +$reqid = isset($_GET["reqid"]) ? explode(",",$_GET["reqid"]) : []; $uid = isset($_GET["newznabID"]) ? $_GET["newznabID"] : ""; // diff --git a/misc/testing/nzb-import.php b/misc/testing/nzb-import.php index 475c3e153..b874bdfa0 100644 --- a/misc/testing/nzb-import.php +++ b/misc/testing/nzb-import.php @@ -54,7 +54,7 @@ $files = new \RegexIterator( ); $i = 1; -$nzbFiles = array(); +$nzbFiles = []; foreach ($files as $file) { $nzbFiles[] = $file[0]; if ($i++ >= $argv[5]) { diff --git a/misc/testing/parsebooknames.php b/misc/testing/parsebooknames.php index c1b469da5..474bb6910 100644 --- a/misc/testing/parsebooknames.php +++ b/misc/testing/parsebooknames.php @@ -1 +1 @@ -parseAuthor($t); if ($book !== false) { echo 'Looking up: '.$book["author"].' - '.$book["title"].' ['.$t.']'."\n"; //check for existing book entry $bookCheck = $b->getBookInfoByName($book["author"], $book["title"]); if ($bookCheck === false) { // // get from amazon // $ret = $b->updateBookInfo($book["author"], $book["title"]); if ($ret !== false) { $bookId = $ret; } } else { $bookId = $bookCheck["id"]; } } echo $bookId; } \ No newline at end of file +parseAuthor($t); if ($book !== false) { echo 'Looking up: '.$book["author"].' - '.$book["title"].' ['.$t.']'."\n"; //check for existing book entry $bookCheck = $b->getBookInfoByName($book["author"], $book["title"]); if ($bookCheck === false) { // // get from amazon // $ret = $b->updateBookInfo($book["author"], $book["title"]); if ($ret !== false) { $bookId = $ret; } } else { $bookId = $bookCheck["id"]; } } echo $bookId; } \ No newline at end of file diff --git a/misc/testing/queryamazon.php b/misc/testing/queryamazon.php index c7dad1b27..e4a6ffcd1 100644 --- a/misc/testing/queryamazon.php +++ b/misc/testing/queryamazon.php @@ -1 +1 @@ -get(); $title = "Long Arm, The - Franz Habl "; $obj = new AmazonProductAPI($site->amazonpubkey, $site->amazonprivkey, $site->amazonassociatetag); try { $amaz = $obj->searchProducts($title, AmazonProductAPI::BOOKS, "TITLE"); $item = array(); $item["asin"] = (string) $amaz->Items->Item->ASIN; $item["url"] = (string) $amaz->Items->Item->DetailPageURL; $item["cover"] = (string) $amaz->Items->Item->LargeImage->URL; $item["author"] = (string) $amaz->Items->Item->ItemAttributes->Author; $item["dewey"] = (string) $amaz->Items->Item->ItemAttributes->DeweyDecimalNumber; $item["ean"] = (string) $amaz->Items->Item->ItemAttributes->EAN; $item["isbn"] = (string) $amaz->Items->Item->ItemAttributes->ISBN; $item["publisher"] = (string) $amaz->Items->Item->ItemAttributes->Publisher; $item["publishdate"] = (string) $amaz->Items->Item->ItemAttributes->PublicationDate; $item["pages"] = (string) $amaz->Items->Item->ItemAttributes->NumberOfPages; $item["title"] = (string) $amaz->Items->Item->ItemAttributes->Title; $item["review"] = ""; if (isset($amaz->Items->Item->EditorialReviews)) $item["review"] = trim(strip_tags((string) $amaz->Items->Item->EditorialReviews->EditorialReview->Content)); print_r($item); } catch(Exception $e) { echo "failed"; } \ No newline at end of file +get(); $title = "Long Arm, The - Franz Habl "; $obj = new AmazonProductAPI($site->amazonpubkey, $site->amazonprivkey, $site->amazonassociatetag); try { $amaz = $obj->searchProducts($title, AmazonProductAPI::BOOKS, "TITLE"); $item = []; $item["asin"] = (string) $amaz->Items->Item->ASIN; $item["url"] = (string) $amaz->Items->Item->DetailPageURL; $item["cover"] = (string) $amaz->Items->Item->LargeImage->URL; $item["author"] = (string) $amaz->Items->Item->ItemAttributes->Author; $item["dewey"] = (string) $amaz->Items->Item->ItemAttributes->DeweyDecimalNumber; $item["ean"] = (string) $amaz->Items->Item->ItemAttributes->EAN; $item["isbn"] = (string) $amaz->Items->Item->ItemAttributes->ISBN; $item["publisher"] = (string) $amaz->Items->Item->ItemAttributes->Publisher; $item["publishdate"] = (string) $amaz->Items->Item->ItemAttributes->PublicationDate; $item["pages"] = (string) $amaz->Items->Item->ItemAttributes->NumberOfPages; $item["title"] = (string) $amaz->Items->Item->ItemAttributes->Title; $item["review"] = ""; if (isset($amaz->Items->Item->EditorialReviews)) $item["review"] = trim(strip_tags((string) $amaz->Items->Item->EditorialReviews->EditorialReview->Content)); print_r($item); } catch(Exception $e) { echo "failed"; } \ No newline at end of file diff --git a/misc/testing/refreshMovie.php b/misc/testing/refreshMovie.php index 836f2f6c1..11cdbb351 100644 --- a/misc/testing/refreshMovie.php +++ b/misc/testing/refreshMovie.php @@ -6,7 +6,7 @@ use newznab\db\Settings; $movie = new Movie(true); $db = new Settings(); -$movies = array(); +$movies = []; $counter = 1; $sleepsecsbetweenscrape = 1; diff --git a/misc/testing/spotnab.php b/misc/testing/spotnab.php index 36bef03c8..ea043f604 100644 --- a/misc/testing/spotnab.php +++ b/misc/testing/spotnab.php @@ -435,7 +435,7 @@ if(array_key_exists("t", $options) || 'title' => 'l2g newznab' ), 'postdate_utc' => $spotnab->local2utc(), - 'comments' => array() + 'comments' => [] ); for($i=0;$i<3000;$i++){ // Build large post diff --git a/misc/testing/test_blacklist.php b/misc/testing/test_blacklist.php index a4f95ffce..ba9cef634 100644 --- a/misc/testing/test_blacklist.php +++ b/misc/testing/test_blacklist.php @@ -211,7 +211,7 @@ $total=0; $offset=0; # Dictionary -$pspelldict=array(); +$pspelldict=[]; # Completion Refernece Time in past $completionRef = strtotime("-$completionSec seconds"); @@ -246,7 +246,7 @@ while($res=get_block($offset, $batch)){ // if a white list is detected we now are required to // only accept the entry if it matches at least 1 whitelist // while a blacklist will over-ride all - $whitelist = array(); + $whitelist = []; $matches_whitelist = false; foreach ($blacklist as $bl) @@ -343,7 +343,7 @@ while($res=get_block($offset, $batch)){ } # ensure whitelist flags are off to avoid extra processing # at the end of this loop (Below) - $whitelist = array(); + $whitelist = []; break; } @@ -369,7 +369,7 @@ while($res=get_block($offset, $batch)){ } # ensure whitelist flags are off to avoid extra processing # at the end of this loop (Below) - $whitelist = array(); + $whitelist = []; break; } } @@ -390,7 +390,7 @@ while($res=get_block($offset, $batch)){ } # ensure whitelist flags are off to avoid extra processing # at the end of this loop (Below) - $whitelist = array(); + $whitelist = []; break; } } @@ -435,7 +435,7 @@ while($res=get_block($offset, $batch)){ } # ensure whitelist flags are off to avoid extra processing # at the end of this loop (Below) - $whitelist = array(); + $whitelist = []; break; } } diff --git a/misc/update_scripts/nix_scripts/tmux/bin/update_binaries.php b/misc/update_scripts/nix_scripts/tmux/bin/update_binaries.php index b934f6006..04cb97d7c 100644 --- a/misc/update_scripts/nix_scripts/tmux/bin/update_binaries.php +++ b/misc/update_scripts/nix_scripts/tmux/bin/update_binaries.php @@ -22,14 +22,14 @@ if (isset($argv[1])) { function relativeTime($_time) { - $d = array(); + $d = []; $d[0] = array(1, "sec"); $d[1] = array(60, "min"); $d[2] = array(3600, "hr"); $d[3] = array(86400, "day"); $d[4] = array(31104000, "yr"); - $w = array(); + $w = []; $return = ""; $now = TIME(); diff --git a/misc/update_scripts/nix_scripts/tmux/lib/DB/patchDB.php b/misc/update_scripts/nix_scripts/tmux/lib/DB/patchDB.php index 58959f8fc..6d8ca899d 100644 --- a/misc/update_scripts/nix_scripts/tmux/lib/DB/patchDB.php +++ b/misc/update_scripts/nix_scripts/tmux/lib/DB/patchDB.php @@ -13,7 +13,7 @@ function SplitSQL($file, $delimiter = ';') $file = fopen($file, 'r'); if (is_resource($file) === true) { - $query = array(); + $query = []; $db = new DB(); $dbsys = DB_TYPE; $c = new ColorCLI(); @@ -60,7 +60,7 @@ function SplitSQL($file, $delimiter = ';') } if (is_string($query) === true) { - $query = array(); + $query = []; } } return fclose($file); @@ -105,7 +105,7 @@ if (isset($os) && $os == "unix") { $tmux = $t->get(); $currentversion = $tmux->sqlpatch; $patched = 0; - $patches = array(); + $patches = []; $db = new DB(); $backedup = false; $c = new ColorCLI(); @@ -152,7 +152,7 @@ if (isset($os) && $os == "unix") { $tmux = $t->get(); $currentversion = $tmux->sqlpatch; $patched = 0; - $patches = array(); + $patches = []; // Open the patch folder. if (!isset($argv[1])) { diff --git a/misc/update_scripts/nix_scripts/tmux/lib/testing/DB/populate_nzb_guid.php b/misc/update_scripts/nix_scripts/tmux/lib/testing/DB/populate_nzb_guid.php index 2f25a9abd..3c9c8f875 100644 --- a/misc/update_scripts/nix_scripts/tmux/lib/testing/DB/populate_nzb_guid.php +++ b/misc/update_scripts/nix_scripts/tmux/lib/testing/DB/populate_nzb_guid.php @@ -56,7 +56,7 @@ function create_guids($live, $delete = false) } continue; } - $binary_names = array(); + $binary_names = []; foreach ($nzbfile->file as $file) { $binary_names[] = $file["subject"]; } diff --git a/misc/update_scripts/nix_scripts/tmux/lib/testing/Dev/test_hash_algorithms.php b/misc/update_scripts/nix_scripts/tmux/lib/testing/Dev/test_hash_algorithms.php index cce85073c..e5ef0d4f5 100644 --- a/misc/update_scripts/nix_scripts/tmux/lib/testing/Dev/test_hash_algorithms.php +++ b/misc/update_scripts/nix_scripts/tmux/lib/testing/Dev/test_hash_algorithms.php @@ -68,7 +68,7 @@ class HashAlgorithms $firstArray = $this->_hashesToArray($this->_inputString); - $secondArray = array(); + $secondArray = []; foreach ($firstArray as $key => $value) { if (!$this->_writeToFile) { if (in_array($value, $this->_expectedString)) { @@ -89,7 +89,7 @@ class HashAlgorithms $secondArray[$key] = $this->_hashesToArray($value); } - $thirdArray = array(); + $thirdArray = []; foreach ($secondArray as $key => $value) { foreach ($value as $key2 => $value2) { if (!$this->_writeToFile) { @@ -171,7 +171,7 @@ class HashAlgorithms ); $hashTypes = array('md5', 'md4', 'sha1', 'sha256', 'sha512'); - $tmpArray = array(); + $tmpArray = []; foreach ($hashTypes as $hash) { foreach ($strings as $key => $value) { $tmpArray[$hash . '_' . $key] = hash($hash, $value, false); diff --git a/misc/update_scripts/nix_scripts/tmux/lib/testing/_run_once/tpg_fixes.php b/misc/update_scripts/nix_scripts/tmux/lib/testing/_run_once/tpg_fixes.php index 57fd322bb..62f91f5ca 100644 --- a/misc/update_scripts/nix_scripts/tmux/lib/testing/_run_once/tpg_fixes.php +++ b/misc/update_scripts/nix_scripts/tmux/lib/testing/_run_once/tpg_fixes.php @@ -44,7 +44,7 @@ if ($groups === false) { echo "No active groups. Fix not needed.\n"; } else { - $queries = array(); + $queries = []; switch ($argv[1]) { case 1: diff --git a/misc/update_scripts/nix_scripts/tmux/lib/testing/predb_import_daily_batch.php b/misc/update_scripts/nix_scripts/tmux/lib/testing/predb_import_daily_batch.php index f07708631..d06921863 100644 --- a/misc/update_scripts/nix_scripts/tmux/lib/testing/predb_import_daily_batch.php +++ b/misc/update_scripts/nix_scripts/tmux/lib/testing/predb_import_daily_batch.php @@ -36,7 +36,7 @@ if (!is_writable(NN_RES)) { exit('The (' . NN_RES . ') folder must be writable.' . PHP_EOL); } -$progress = rw_progress(settings_array()); +$progress = rw_progress(settings_[]); if (!isset($argv[1]) || !is_numeric($argv[1]) && $argv[1] != 'progress' || !isset($argv[2]) || !in_array($argv[2], ['local', 'remote']) || !isset($argv[3]) || diff --git a/misc/update_scripts/nix_scripts/tmux/scripts/mysqlreport b/misc/update_scripts/nix_scripts/tmux/scripts/mysqlreport index 40bb7d3d1..1fe437cdc 100644 --- a/misc/update_scripts/nix_scripts/tmux/scripts/mysqlreport +++ b/misc/update_scripts/nix_scripts/tmux/scripts/mysqlreport @@ -45,7 +45,7 @@ my ($ib_bp_used, $ib_bp_total, $ib_bp_read_ratio); my ($relative_live, $relative_infiles); my $real_uptime; my (%stats_present, %stats_past); # For relative reports - + GetOptions ( \%op, "user=s", @@ -72,7 +72,7 @@ get_user_mycnf() unless $op{'no-mycnf'}; # Command line options override ~/.my.cnf $mycnf{'host'} = $op{'host'} if have_op 'host'; $mycnf{'port'} = $op{'port'} if have_op 'port'; -$mycnf{'socket'} = $op{'socket'} if have_op 'socket'; +$mycnf{'socket'} = $op{'socket'} if have_op 'socket'; $mycnf{'user'} = $op{'user'} if have_op 'user'; $mycnf{'user'} ||= $ENV{'USER'}; @@ -138,8 +138,8 @@ $have_innodb_vals = 1; # This might be set to 0 later in get_MySQL_version() if(defined $op{'r'}) { if($relative_live) - { - print STDERR "mysqlreport is writing relative reports to '$tmpfile'.\n" unless $op{'detach'}; + { + print STDERR "mysqlreport is writing relative reports to '$tmpfile'.\n" unless $op{'detach'}; get_MySQL_version(); collect_reports(); } @@ -434,7 +434,7 @@ sub get_vals $query = $dbh->prepare("SHOW STATUS;"); } $query->execute(); - while(@row = $query->fetchrow_array()) { $stats{$row[0]} = $row[1]; } + while(@row = $query->fetchrow_[]) { $stats{$row[0]} = $row[1]; } $real_uptime = $stats{'Uptime'}; } @@ -448,7 +448,7 @@ sub get_vars # Get server system variables $query = $dbh->prepare("SHOW VARIABLES;"); $query->execute(); - while(@row = $query->fetchrow_array()) { $vars{$row[0]} = $row[1]; } + while(@row = $query->fetchrow_[]) { $vars{$row[0]} = $row[1]; } # table_cache was renamed to table_open_cache in MySQL 5.1.3 if($MySQL_version >= 50103) @@ -471,7 +471,7 @@ sub read_infile $vars{'table_cache'} = 64 if !exists $vars{'table_cache'}; $vars{'max_connections'} = 100 if !exists $vars{'max_connections'}; $vars{'key_buffer_size'} = 8388600 if !exists $vars{'key_buffer_size'}; # 8M - $vars{'thread_cache_size'} = 0 if !exists $vars{'thread_cache_size'}; + $vars{'thread_cache_size'} = 0 if !exists $vars{'thread_cache_size'}; $vars{'tmp_table_size'} = 0 if !exists $vars{'tmp_table_size'}; $vars{'long_query_time'} = '?' if !exists $vars{'long_query_time'}; $vars{'log_slow_queries'} = '?' if !exists $vars{'log_slow_queries'}; @@ -487,7 +487,7 @@ sub read_infile { last if !defined $_; - next if /^\+/; # skip divider lines + next if /^\+/; # skip divider lines next if /^$/; # skip blank lines next until /(Aborted_clients|back_log|=)/; @@ -580,7 +580,7 @@ sub get_MySQL_version $query = $dbh->prepare("SHOW VARIABLES LIKE 'version';"); $query->execute(); - @row = $query->fetchrow_array(); + @row = $query->fetchrow_[]; ($major, $minor, $patch) = ($row[1] =~ /(\d{1,2})\.(\d{1,2})\.(\d{1,2})/); } @@ -731,8 +731,8 @@ sub write_report $~ = 'SLOW_DMS', write; write_DMS(); write_Com(); - $~ = 'SAS', write; - write_qcache(); + $~ = 'SAS', write; + write_qcache(); $~ = 'REPORT_END', write; $~ = 'TAB', write; @@ -757,10 +757,10 @@ sub sec_to_dhms # Seconds to days hours:minutes:seconds $h = int $s / 3600; $s -= $h * 3600; } - + $m = int $s / 60; $s -= $m * 60; - + return "$d $h:$m:$s"; } @@ -1095,7 +1095,7 @@ $stat_name, make_short($stat_val), t($stat_val), $stat_label, perc($stat_val, $q . format SLOW_DMS = -Slow @<<<<<<< @>>>>>> @>>>>>/s @>>>>> %DMS: @>>>>> Log: @>> +Slow @<<<<<<< @>>>>>> @>>>>>/s @>>>>> %DMS: @>>>>> Log: @>> $slow_query_t, make_short($stats{'Slow_queries'}), t($stats{'Slow_queries'}), perc($stats{'Slow_queries'}, $questions), perc($stats{'Slow_queries'}, $dms), $vars{'log_slow_queries'} DMS @>>>>>>>> @>>>>>/s @>>>>> make_short($dms), t($dms), perc($dms, $questions) @@ -1225,7 +1225,7 @@ make_short($stats{'Innodb_buffer_pool_pages_data'}), perc($stats{'Innodb_buffer_ $stats{'Innodb_buffer_pool_pages_misc'}, perc($stats{'Innodb_buffer_pool_pages_misc'}, $stats{'Innodb_buffer_pool_pages_total'}) Latched @>>>>>>>> @>>>>> $stats{'Innodb_buffer_pool_pages_latched'}, perc($stats{'Innodb_buffer_pool_pages_latched'}, $stats{'Innodb_buffer_pool_pages_total'}) -Reads @>>>>>>>> @>>>>>/s +Reads @>>>>>>>> @>>>>>/s make_short($stats{'Innodb_buffer_pool_read_requests'}), t($stats{'Innodb_buffer_pool_read_requests'}) From file @>>>>>>>> @>>>>>/s @>>>>> make_short($stats{'Innodb_buffer_pool_reads'}), t($stats{'Innodb_buffer_pool_reads'}), perc($stats{'Innodb_buffer_pool_reads'}, $stats{'Innodb_buffer_pool_read_requests'}) diff --git a/newznab/controllers/AniDB.php b/newznab/controllers/AniDB.php index 1380fcf85..79c120281 100644 --- a/newznab/controllers/AniDB.php +++ b/newznab/controllers/AniDB.php @@ -12,7 +12,7 @@ class AniDB /** * @param array $options Class instances / Echo to cli. */ - public function __construct(array $options = array()) + public function __construct(array $options = []) { $defaults = [ 'Echo' => false, diff --git a/newznab/controllers/Categorize.php b/newznab/controllers/Categorize.php index d6caa0cd7..59de1cca5 100644 --- a/newznab/controllers/Categorize.php +++ b/newznab/controllers/Categorize.php @@ -45,7 +45,7 @@ class Categorize extends Category * * @param array $options Class instances. */ - public function __construct(array $options = array()) + public function __construct(array $options = []) { //parent::__construct($options); $this->pdo = new newznab\db\Settings(); diff --git a/newznab/controllers/Category.php b/newznab/controllers/Category.php index f1229bee1..ab196f53d 100644 --- a/newznab/controllers/Category.php +++ b/newznab/controllers/Category.php @@ -94,7 +94,7 @@ class Category * * @param array $options Class instances. */ - public function __construct(array $options = array()) + public function __construct(array $options = []) { $defaults = [ 'Settings' => null, @@ -111,7 +111,7 @@ class Category * * @return string $catsrch */ - public function getCategorySearch($cat = array()) + public function getCategorySearch($cat = []) { $catsrch = ' ('; @@ -353,7 +353,7 @@ class Category public function getForSelect($blnIncludeNoneSelected = true) { $categories = $this->get(); - $temp_array = array(); + $temp_array = []; if ($blnIncludeNoneSelected) { $temp_array[-1] = "--Please Select--"; @@ -368,7 +368,7 @@ class Category /** * Get a list of categories. */ - public function get($activeonly = false, $excludedcats = array()) + public function get($activeonly = false, $excludedcats = []) { $db = new newznab\db\Settings(); diff --git a/newznab/controllers/Console.php b/newznab/controllers/Console.php index 01c99fc95..1bc38f0f8 100644 --- a/newznab/controllers/Console.php +++ b/newznab/controllers/Console.php @@ -78,7 +78,7 @@ class Console /** * Get count of all consoleinfo rows for browse list. */ - public function getConsoleCount($cat, $maxage=-1, $excludedcats=array()) + public function getConsoleCount($cat, $maxage=-1, $excludedcats=[]) { $browseby = $this->getBrowseBy(); @@ -128,7 +128,7 @@ class Console /** * Get range of consoleinfo rows for browse list. */ - public function getConsoleRange($cat, $start, $num, $orderby, $maxage=-1, $excludedcats=array()) + public function getConsoleRange($cat, $start, $num, $orderby, $maxage=-1, $excludedcats=[]) { $browseby = $this->getBrowseBy(); @@ -268,14 +268,14 @@ class Console $gen = new Genres(); $ri = new ReleaseImage(); - $con = array(); + $con = []; $amaz = $this->fetchAmazonProperties($gameInfo['title'], $gameInfo['node']); if (!$amaz) return false; //load genres $defaultGenres = $gen->getGenres(Genres::CONSOLE_TYPE); - $genreassoc = array(); + $genreassoc = []; foreach($defaultGenres as $dg) { $genreassoc[$dg['id']] = strtolower($dg['title']); } @@ -571,7 +571,7 @@ class Console */ function parseTitle($releasename) { - $result = array(); + $result = []; //get name of the game from name of release preg_match('/^(?P.*?)[\.\-_ ](v\.?\d\.\d|PAL|NTSC|EUR|USA|JP|ASIA|JAP|JPN|AUS|MULTI\.?5|MULTI\.?4|MULTI\.?3|PATCHED|FULLDVD|DVD5|DVD9|DVDRIP|PROPER|REPACK|RETAIL|DEMO|DISTRIBUTION|REGIONFREE|READ\.?NFO|NFOFIX|PS2|PS3|PSP|WII|X\-?BOX|XBLA|X360|NDS|N64|NGC)/i', $releasename, $matches); diff --git a/newznab/controllers/ConsoleTools.php b/newznab/controllers/ConsoleTools.php index 27c7515eb..a5f7a8ebf 100644 --- a/newznab/controllers/ConsoleTools.php +++ b/newznab/controllers/ConsoleTools.php @@ -19,7 +19,7 @@ class ConsoleTools /** * Construct. */ - public function __construct(array $options = array()) + public function __construct(array $options = []) { $defaults = [ 'ColorCLI' => null diff --git a/newznab/controllers/Desura.php b/newznab/controllers/Desura.php index 10803a6fb..dc097ccbf 100644 --- a/newznab/controllers/Desura.php +++ b/newznab/controllers/Desura.php @@ -37,12 +37,12 @@ class Desura /** * @var array */ - protected $_postParams = array(); + protected $_postParams = []; /** * @var array */ - protected $_res = array(); + protected $_res = []; /** * @var @@ -218,7 +218,7 @@ class Desura */ public function getAll() { - $results = array(); + $results = []; if (isset($this->_directURL)) { $results['desuragameid'] = $this->_desuraGameID; $results['directurl'] = $this->_directURL; diff --git a/newznab/controllers/Enzebe.php b/newznab/controllers/Enzebe.php index e62fdf2c4..2d01d762b 100644 --- a/newznab/controllers/Enzebe.php +++ b/newznab/controllers/Enzebe.php @@ -307,7 +307,7 @@ class Enzebe public function nzbFileList($nzb) { $num_pars = $i = 0; - $result = array(); + $result = []; if (!$nzb) { return $result; @@ -356,7 +356,7 @@ class Enzebe // Parts. if (!isset($result[$i]['segments'])) { - $result[$i]['segments'] = array(); + $result[$i]['segments'] = []; } // File size. @@ -375,7 +375,7 @@ class Enzebe // Groups. if (!isset($result[$i]['groups'])) { - $result[$i]['groups'] = array(); + $result[$i]['groups'] = []; } foreach ($file->groups->group as $g) { array_push($result[$i]['groups'], (string) $g); diff --git a/newznab/controllers/Games.php b/newznab/controllers/Games.php index 3ab612d6b..1a2142129 100644 --- a/newznab/controllers/Games.php +++ b/newznab/controllers/Games.php @@ -90,7 +90,7 @@ class Games /** * @param array $options Class instances / Echo to cli. */ - public function __construct(array $options = array()) + public function __construct(array $options = []) { $defaults = [ 'Echo' => false, @@ -157,7 +157,7 @@ class Games return ($res === false ? 0 : $res["num"]); } - public function getGamesCount($cat, $maxage = -1, $excludedcats = array()) + public function getGamesCount($cat, $maxage = -1, $excludedcats = []) { $catsrch = ''; if (count($cat) > 0 && $cat[0] != -1) { @@ -185,7 +185,7 @@ class Games return ($res === false ? 0 : $res["num"]); } - public function getGamesRange($cat, $start, $num, $orderby, $maxage = -1, $excludedcats = array()) + public function getGamesRange($cat, $start, $num, $orderby, $maxage = -1, $excludedcats = []) { $browseby = $this->getBrowseBy(); @@ -317,7 +317,7 @@ class Games public function makeFieldLinks($data, $field) { $tmpArr = explode(', ', $data[$field]); - $newArr = array(); + $newArr = []; $i = 0; foreach ($tmpArr as $ta) { if (trim($ta) == '') { @@ -385,7 +385,7 @@ class Games $gen = new \Genres(['Settings' => $this->pdo]); $ri = new \ReleaseImage($this->pdo); - $con = array(); + $con = []; // Process Steam first before giantbomb // Steam has more details @@ -591,7 +591,7 @@ class Games } // Load genres. $defaultGenres = $gen->getGenres(\Genres::GAME_TYPE); - $genreassoc = array(); + $genreassoc = []; foreach ($defaultGenres as $dg) { $genreassoc[$dg['id']] = strtolower($dg['title']); } @@ -757,7 +757,7 @@ class Games $result = $result['results'][$i]; preg_match('/\/\d+\-(?<asin>\d+)\//', $result['api_detail_url'], $matches); $this->_gameID = (string)$matches['asin']; - $result = $this->fetchGiantBombArray(); + $result = $this->fetchGiantBomb[]; $this->_classUsed = "gb"; break; } @@ -782,7 +782,7 @@ class Games * * @return bool|mixed */ - public function fetchGiantBombArray() + public function fetchGiantBomb[] { $obj = new \GiantBomb($this->publicKey); try { @@ -899,7 +899,7 @@ class Games preg_replace('/\sMulti\d?\s/i', '', $releasename), $matches)) { // Replace dots, underscores, colons, or brackets with spaces. - $result = array(); + $result = []; $result['title'] = str_replace(' RF ', ' ', preg_replace('/(\-|\:|\.|_|\%20|\[|\])/', ' ', $matches['title'])); // Replace any foreign words at the end of the release $result['title'] = preg_replace('/(brazilian|chinese|croatian|danish|deutsch|dutch|english|estonian|flemish|finnish|french|german|greek|hebrew|icelandic|italian|latin|nordic|norwegian|polish|portuguese|japenese|japanese|russian|serbian|slovenian|spanish|spanisch|swedish|thai|turkish)$/i', '', $result['title']); diff --git a/newznab/controllers/Genres.php b/newznab/controllers/Genres.php index cf9a0d426..63f02d63b 100644 --- a/newznab/controllers/Genres.php +++ b/newznab/controllers/Genres.php @@ -19,7 +19,7 @@ class Genres /** * @param array $options Class instances. */ - public function __construct(array $options = array()) + public function __construct(array $options = []) { $defaults = [ 'Settings' => null diff --git a/newznab/controllers/Greenlight.php b/newznab/controllers/Greenlight.php index 1552cfdc5..f76fcf91b 100644 --- a/newznab/controllers/Greenlight.php +++ b/newznab/controllers/Greenlight.php @@ -33,12 +33,12 @@ class Greenlight /** * @var array */ - protected $_postParams = array(); + protected $_postParams = []; /** * @var array */ - protected $_res = array(); + protected $_res = []; /** * @var @@ -130,7 +130,7 @@ class Greenlight $ret = rtrim(trim($ret), ":"); if ($ret != "Languages") { if (count($detail->find("a")) > 1) { - $ret3 = array(); + $ret3 = []; foreach ($detail->find("a") as $a) { $ret3[] = trim($a->innertext); } @@ -206,7 +206,7 @@ class Greenlight */ public function getAll() { - $results = array(); + $results = []; if (!empty($this->_directURL)) { $results['greenlightgameid'] = $this->_greenlightGameID; $results['directurl'] = $this->_directURL; diff --git a/newznab/controllers/Groups.php b/newznab/controllers/Groups.php index f2d606025..7e07a891b 100644 --- a/newznab/controllers/Groups.php +++ b/newznab/controllers/Groups.php @@ -61,7 +61,7 @@ class Groups $categories = $this->pdo->query("SELECT * FROM groups WHERE active = 1 ORDER BY name", true, NN_CACHE_EXPIRY_LONG ); - $temp_array = array(); + $temp_array = []; $temp_array[-1] = "--Please Select--"; @@ -355,7 +355,7 @@ class Groups function addBulk($groupList, $active = 1, $backfill = 1) { - $ret = array(); + $ret = []; if ($groupList == "") { $ret[] = "No group list provided."; diff --git a/newznab/controllers/Hotmovies.php b/newznab/controllers/Hotmovies.php index 800d17069..025da63ee 100644 --- a/newznab/controllers/Hotmovies.php +++ b/newznab/controllers/Hotmovies.php @@ -57,14 +57,14 @@ class Hotmovies * * @var array */ - protected $_postParams = array(); + protected $_postParams = []; /** * Results return from some methods * * @var array */ - protected $_res = array(); + protected $_res = []; /** * Raw Html from Curl @@ -169,7 +169,7 @@ class Hotmovies */ public function getAll() { - $results = array(); + $results = []; if (isset($this->_directUrl)) { $results['title'] = $this->_title; $results['directurl'] = $this->_directUrl; @@ -291,7 +291,7 @@ class Hotmovies */ public function genres() { - $genres = array(); + $genres = []; if ($ret = $this->_html->find('div.categories',0)) { foreach ($ret->find('a') as $e) { if (stristr($e->title, "->")) { diff --git a/newznab/controllers/IRCClient.php b/newznab/controllers/IRCClient.php index 535680a0d..817233b88 100644 --- a/newznab/controllers/IRCClient.php +++ b/newznab/controllers/IRCClient.php @@ -116,7 +116,7 @@ class IRCClient * @var array * @access protected */ - protected $_channelData = array(); + protected $_channelData = []; /** * Nick name when we log in. @@ -478,7 +478,7 @@ class IRCClient * * @access public */ - public function joinChannels($channels = array()) + public function joinChannels($channels = []) { $this->_channels = $channels; diff --git a/newznab/controllers/IRCScraper.php b/newznab/controllers/IRCScraper.php index d8526e43a..9470cd120 100644 --- a/newznab/controllers/IRCScraper.php +++ b/newznab/controllers/IRCScraper.php @@ -119,7 +119,7 @@ class IRCScraper extends IRCClient } $this->_pdo = new Settings(); - $this->_groupList = array(); + $this->_groupList = []; $this->_silent = $silent; $this->_debug = $debug; $this->_resetPreVariables(); @@ -441,7 +441,7 @@ class IRCScraper extends IRCClient protected function _resetPreVariables() { $this->_nuked = false; - $this->_oldPre = array(); + $this->_oldPre = []; $this->_curPre = array( 'title' => '', diff --git a/newznab/controllers/Movie.php b/newznab/controllers/Movie.php index 6198d7dd0..121461a7c 100644 --- a/newznab/controllers/Movie.php +++ b/newznab/controllers/Movie.php @@ -129,7 +129,7 @@ class Movie /** * Get count of all movieinfo rows filter by category. */ - public function getMovieCount($cat, $maxage=-1, $excludedcats=array()) + public function getMovieCount($cat, $maxage=-1, $excludedcats=[]) { $browseby = $this->getBrowseBy(); @@ -181,7 +181,7 @@ class Movie /** * Get movieinfo rows for browse list by limit. */ - public function getMovieRange($cat, $start, $num, $orderby, $maxage=-1, $excludedcats=array()) + public function getMovieRange($cat, $start, $num, $orderby, $maxage=-1, $excludedcats=[]) { $browseby = $this->getBrowseBy(); @@ -249,7 +249,7 @@ class Movie // $sql = sprintf("select r.*, releasenfo.id as nfoid, groups.name as grpname, concat(cp.title, ' > ', c.title) as categoryname from releases r left outer join category c on c.id = r.categoryid left outer join category cp on cp.id = c.parentid left outer join releasenfo on releasenfo.releaseid = r.id left outer join groups on groups.id = r.groupid where imdbid in (%s) and %s %s %s order by r.postdate desc", $imdbds, $catsrch, $maxagesql, $exccatlist); $allrows = $this->pdo->query($sql, true); - $arr = array(); + $arr = []; // // build array indexed by imdbid @@ -373,7 +373,7 @@ class Movie return ""; $tmpArr = explode(', ',$data[$field]); - $newArr = array(); + $newArr = []; $i = 0; foreach($tmpArr as $ta) { if (trim($ta) == '') { @@ -419,7 +419,7 @@ class Movie return false; } - $mov = array(); + $mov = []; $mov['imdb_id'] = $imdbId; $mov['tmdb_id'] = (!isset($tmdb['tmdb_id']) || $tmdb['tmdb_id'] == '') ? "NULL" : $tmdb['tmdb_id']; @@ -540,7 +540,7 @@ class Movie if (!$movie || !is_array($movie)) { return false; } if (isset($movie['status_code']) && $movie['status_code'] > 1) { return false; } - $ret = array(); + $ret = []; $ret['title'] = $movie['title']; $ret['tmdb_id'] = $movie['id']; $ret['imdb_id'] = str_replace('tt', '', $movie['imdb_id']); @@ -552,7 +552,7 @@ class Movie $ret['year'] = date("Y", strtotime($movie['release_date'])); if (isset($movie['genres']) && sizeof($movie['genres']) > 0) { - $genres = array(); + $genres = []; foreach($movie['genres'] as $genre) { $genres[] = $genre['name']; @@ -590,7 +590,7 @@ class Movie } if (!$movies || !isset($movies['results'])) { return false; } - $ret = array(); + $ret = []; $c=0; foreach($movies['results'] as $movie) { @@ -629,7 +629,7 @@ class Movie // make sure we got some data if ($buffer !== false && strlen($buffer)) { - $ret = array(); + $ret = []; foreach ($imdb_regex as $field => $regex) { if (preg_match($regex, $buffer, $matches)) diff --git a/newznab/controllers/Music.php b/newznab/controllers/Music.php index 4b68d0b87..49da94fff 100644 --- a/newznab/controllers/Music.php +++ b/newznab/controllers/Music.php @@ -78,7 +78,7 @@ class Music /** * Get count of all musicinfo rows by filter. */ - public function getMusicCount($cat, $maxage=-1, $excludedcats=array()) + public function getMusicCount($cat, $maxage=-1, $excludedcats=[]) { $browseby = $this->getBrowseBy(); @@ -128,7 +128,7 @@ class Music /** * Get musicinfo rows for browse list by filters and limit. */ - public function getMusicRange($cat, $start, $num, $orderby, $maxage=-1, $excludedcats=array()) + public function getMusicRange($cat, $start, $num, $orderby, $maxage=-1, $excludedcats=[]) { $browseby = $this->getBrowseBy(); @@ -272,7 +272,7 @@ class Music $gen = new Genres(); $ri = new ReleaseImage(); - $mus = array(); + $mus = []; $amaz = $this->fetchAmazonProperties($artist." ".$album); if (!$amaz) return false; @@ -281,7 +281,7 @@ class Music //load genres $defaultGenres = $gen->getGenres(Genres::MUSIC_TYPE); - $genreassoc = array(); + $genreassoc = []; foreach($defaultGenres as $dg) { $genreassoc[$dg['id']] = strtolower($dg['title']); } @@ -485,7 +485,7 @@ class Music */ public function parseArtist($releasename) { - $result = array(); + $result = []; /*TODO: FIX VA lookups if (substr($releasename, 0, 3) == 'VA-') { $releasename = trim(str_replace('VA-', '', $releasename)); @@ -568,7 +568,7 @@ class Music //load genres $gen = new Genres(); $defaultGenres = $gen->getGenres(Genres::MUSIC_TYPE); - $genreassoc = array(); + $genreassoc = []; foreach($defaultGenres as $dg) $genreassoc[$dg['id']] = strtolower($dg['title']); diff --git a/newznab/controllers/NNTP.php b/newznab/controllers/NNTP.php index 540fbdcf5..008f3003c 100644 --- a/newznab/controllers/NNTP.php +++ b/newznab/controllers/NNTP.php @@ -1094,7 +1094,7 @@ class NNTP extends Net_NNTP_Client */ function decodeYenc2($yencodedvar) { - $input = array(); + $input = []; preg_match("/^(=ybegin.*=yend[^$]*)$/ims", $yencodedvar, $input); if (isset($input[1])) { $ret = ""; diff --git a/newznab/controllers/NZBContents.php b/newznab/controllers/NZBContents.php index a2b880eed..1bffba94a 100644 --- a/newznab/controllers/NZBContents.php +++ b/newznab/controllers/NZBContents.php @@ -74,7 +74,7 @@ Class NZBContents * * @access public */ - public function __construct(array $options = array()) + public function __construct(array $options = []) { $defaults = [ 'Echo' => false, diff --git a/newznab/controllers/NZBVortex.php b/newznab/controllers/NZBVortex.php index 0ac815752..707d9cbf7 100644 --- a/newznab/controllers/NZBVortex.php +++ b/newznab/controllers/NZBVortex.php @@ -270,7 +270,7 @@ final class NZBVortex * sendRequest() * @return array */ - protected function sendRequest($path, $params = array()) + protected function sendRequest($path, $params = []) { $user = new Users; $data = $user->getById($user->currentUserId()); diff --git a/newznab/controllers/NameFixer.php b/newznab/controllers/NameFixer.php index fb3529322..449fd1805 100644 --- a/newznab/controllers/NameFixer.php +++ b/newznab/controllers/NameFixer.php @@ -126,7 +126,7 @@ class NameFixer /** * @param array $options Class instances / Echo to cli. */ - public function __construct(array $options = array()) + public function __construct(array $options = []) { $defaults = [ 'Echo' => true, @@ -710,7 +710,7 @@ class NameFixer return $join; } - public function getPreFileNames($args = array()) + public function getPreFileNames($args = []) { $timestart = time(); $counter = $counted = 0; @@ -955,7 +955,7 @@ class NameFixer // Look for a TV name. public function tvCheck($release, $echo, $type, $namestatus, $show) { - $result = array(); + $result = []; if ($this->done === false && $this->relid !== $release["releaseid"]) { @@ -982,7 +982,7 @@ class NameFixer // Look for a movie name. public function movieCheck($release, $echo, $type, $namestatus, $show) { - $result = array(); + $result = []; if ($this->done === false && $this->relid !== $release["releaseid"]) { @@ -1019,7 +1019,7 @@ class NameFixer // Look for a game name. public function gameCheck($release, $echo, $type, $namestatus, $show) { - $result = array(); + $result = []; if ($this->done === false && $this->relid !== $release["releaseid"]) { @@ -1040,7 +1040,7 @@ class NameFixer // Look for a app name. public function appCheck($release, $echo, $type, $namestatus, $show) { - $result = array(); + $result = []; if ($this->done === false && $this->relid !== $release["releaseid"]) { @@ -1059,7 +1059,7 @@ class NameFixer // TV. public function nfoCheckTV($release, $echo, $type, $namestatus, $show) { - $result = array(); + $result = []; if ($this->done === false && $this->relid !== $release["releaseid"]) { @@ -1074,7 +1074,7 @@ class NameFixer // Movies. public function nfoCheckMov($release, $echo, $type, $namestatus, $show) { - $result = array(); + $result = []; if ($this->done === false && $this->relid !== $release["releaseid"]) { @@ -1091,7 +1091,7 @@ class NameFixer // Music. public function nfoCheckMus($release, $echo, $type, $namestatus, $show) { - $result = array(); + $result = []; if ($this->done === false && $this->relid !== $release["releaseid"]) { @@ -1105,7 +1105,7 @@ class NameFixer // Title (year) public function nfoCheckTY($release, $echo, $type, $namestatus, $show) { - $result = array(); + $result = []; if ($this->done === false && $this->relid !== $release["releaseid"]) { if (preg_match('/(\w[-\w`~!@#$%^&*()_+={}|"<>?\[\]\\;\',.\/ ]+\s?\((19|20)\d\d\))/i', $release["textstring"], $result) && !preg_match('/\.pdf|Audio ?Book/i', $release["textstring"])) { @@ -1273,7 +1273,7 @@ class NameFixer // Games. public function nfoCheckG($release, $echo, $type, $namestatus, $show) { - $result = array(); + $result = []; if ($this->done === false && $this->relid !== $release["releaseid"]) { @@ -1298,7 +1298,7 @@ class NameFixer if (preg_match('/Supplier.+?IGUANA/i', $release["textstring"])) { $releasename = ''; - $result = array(); + $result = []; if (preg_match('/\w[-\w`~!@#$%^&*()+={}|:"<>?\[\]\\;\',.\/ ]+\s\((19|20)\d\d\)/i', $release["textstring"], $result)) { $releasename = $result[0]; } else if (preg_match('/\s\[\*\] (English|Dutch|French|German|Spanish)\b/i', $release["textstring"], $result)) { @@ -1329,7 +1329,7 @@ class NameFixer public function fileCheck($release, $echo, $type, $namestatus, $show) { - $result = array(); + $result = []; if ($this->done === false && $this->relid !== $release["releaseid"]) { diff --git a/newznab/controllers/Nfo.php b/newznab/controllers/Nfo.php index ccb14f6bb..55f3da4c6 100644 --- a/newznab/controllers/Nfo.php +++ b/newznab/controllers/Nfo.php @@ -79,12 +79,12 @@ class Nfo // // Array of all possible matches to return - $nfo_idx = array(); + $nfo_idx = []; // Search for all entries that have a single segment if (empty($nzbInfo->segmentfiles)) // Nothing to Return - return array(); + return []; // Fetch Meta Information if (isset($nzbInfo->metadata['name'])) @@ -92,7 +92,7 @@ class Nfo else $name = ""; - $unordered_list=array(); + $unordered_list=[]; foreach($nzbInfo->segmentfiles as $segment){ if ($segment['filesize'] > Nfo::NFO_MAX_FILESIZE) continue; @@ -298,8 +298,8 @@ class Nfo // The function strips indexes that appear invalid // and stores the most ideal match per release - $parsed_blob = array(); - $parsed_meta = array(); + $parsed_blob = []; + $parsed_meta = []; foreach($nfometa as $uid => $info){ $ideal = Null; @@ -372,7 +372,7 @@ class Nfo } private function _nfo_grab($nfometa, &$blobhash){ - // nfometa should be an array() of segments from nzb file + // nfometa should be an [] of segments from nzb file // it will then populate the blobhash which uses the segments // as hash entries for the blob data. // nfometa is an array of arrays simiar to the following @@ -413,7 +413,7 @@ class Nfo // no error handling is needed here $nntp->doConnect(1, true); foreach($nfometa as $uid => $matches){ - $blobhash[$uid] = array(); + $blobhash[$uid] = []; foreach($matches as $idx => $match){ $fetched = false; foreach($match["groups"] as $group){ @@ -455,7 +455,7 @@ class Nfo // in a try catch block with a silent exception catcher $retries = nfo::USENET_RETRY_COUNT; set_error_handler('nfoHandleError'); - $_blobhash = array(); + $_blobhash = []; while($retries >0){ try{ $this->_nfo_grab($nfometa, $_blobhash); @@ -467,7 +467,7 @@ class Nfo // Decrement retry count $retries--; // Reset blobhash - $_blobhash = array(); + $_blobhash = []; continue; } } @@ -495,7 +495,7 @@ class Nfo $batch=Nfo::NNTP_BATCH_COUNT; // Build NFO List - $nfometa = array(); + $nfometa = []; // Missing NFO Query (oldest first so they don't expire on us) $mnfo = "SELECT id,guid, name FROM releases r ". @@ -551,7 +551,7 @@ class Nfo if(!($processed%$batch)) { - $nfoblob = array(); + $nfoblob = []; if($this->verbose) echo "NfoProc : Retrieval ..."; if($this->nfo_grab($nfometa, $nfoblob)){ $before = array_keys($nfoblob); @@ -563,11 +563,11 @@ class Nfo if($this->verbose) echo "\n"; // Reset nfo list array - $nfometa = array(); + $nfometa = []; } } if(($processed%$batch)){ - $nfoblob = array(); + $nfoblob = []; if($this->verbose) echo "NfoProc : Retrieval ..."; if($this->nfo_grab($nfometa, $nfoblob)){ $before = array_keys($nfoblob); diff --git a/newznab/controllers/Parsing.php b/newznab/controllers/Parsing.php index d238e7d09..39648c03e 100644 --- a/newznab/controllers/Parsing.php +++ b/newznab/controllers/Parsing.php @@ -415,7 +415,7 @@ class Parsing //The Big One if (preg_match_all('/([a-z0-9\ ]+)\.{1,}(\:|\[)(?P<name>.*)(\s{2}|\s{1})/i', $nfo, $matches) && $foundName == "") { - $lut = array(); + $lut = []; foreach ($matches[1] as $key => $k) { $lut[str_replace(' ', '', strtolower(trim($k)))] = trim($matches[3][$key]); } @@ -1419,7 +1419,7 @@ class Parsing } } - $this->cleanup = array('nuke' => array(), 'misc' => array()); + $this->cleanup = array('nuke' => [], 'misc' => []); } /** diff --git a/newznab/controllers/Popporn.php b/newznab/controllers/Popporn.php index 583391f96..7484fe1e2 100644 --- a/newznab/controllers/Popporn.php +++ b/newznab/controllers/Popporn.php @@ -54,7 +54,7 @@ class Popporn * * @var array */ - protected $_res = array(); + protected $_res = []; /** * This is set in the getAll method @@ -228,7 +228,7 @@ class Popporn { $cast = false; $director = false; - $er = array(); + $er = []; if ($ret = $this->_html->find('div#lside', 0)) { foreach ($ret->find("text") as $e) { $e = trim($e->innertext); @@ -272,7 +272,7 @@ class Popporn */ public function genres() { - $genres = array(); + $genres = []; if ($ret = $this->_html->find('div[id=thekeywords], p[class=keywords]', 1)) { foreach ($ret->find('a') as $e) { $genres[] = trim($e->plaintext); diff --git a/newznab/controllers/PostProcess.php b/newznab/controllers/PostProcess.php index bd6a7fc66..8b6894410 100644 --- a/newznab/controllers/PostProcess.php +++ b/newznab/controllers/PostProcess.php @@ -105,7 +105,7 @@ class PostProcess // if($this->pdo->getSetting('removespam') != 0) { - $spamIDs = array(); + $spamIDs = []; // // all releases where the only file inside the rars is *.exe and they are not in the PC category @@ -592,7 +592,7 @@ class PostProcess */ public function processReleaseFiles($fetchedBinary, $relid) { - $retval = array(); + $retval = []; $rar = new \ArchiveInfo(); $rf = new ReleaseFiles; @@ -749,7 +749,7 @@ class PostProcess // returns 1 if encrypted rar // returns 2 if passworded rar // returns array of files in the rar if normal rar - $filelist = array(); + $filelist = []; $rar = new ArchiveInfo; if ($rar->open($rarfile)) { diff --git a/newznab/controllers/PowerProcess.php b/newznab/controllers/PowerProcess.php index 880d4862f..86f23e6a7 100644 --- a/newznab/controllers/PowerProcess.php +++ b/newznab/controllers/PowerProcess.php @@ -304,7 +304,7 @@ class PowerProcess { $this->InstallSignalHandler(); // Init the Thread Queue - $this->myThreads = array(); + $this->myThreads = []; // Log completion of startup $this->Log("Startup process complete",true); diff --git a/newznab/controllers/PreHash.php b/newznab/controllers/PreHash.php index 3f3992221..3e7df9f0e 100644 --- a/newznab/controllers/PreHash.php +++ b/newznab/controllers/PreHash.php @@ -39,7 +39,7 @@ Class PreHash /** * @param array $options */ - public function __construct(array $options = array()) + public function __construct(array $options = []) { $defaults = [ 'Echo' => false, diff --git a/newznab/controllers/ReleaseCleaning.php b/newznab/controllers/ReleaseCleaning.php index 329bf452a..48d7bde98 100644 --- a/newznab/controllers/ReleaseCleaning.php +++ b/newznab/controllers/ReleaseCleaning.php @@ -92,7 +92,7 @@ class ReleaseCleaning public function releaseCleaner($subject, $fromName, $size, $groupName, $usepre = false) { - $match = $matches = array(); + $match = $matches = []; $this->groupName = $groupName; $this->subject = $subject; $this->fromName = $fromName; diff --git a/newznab/controllers/RequestID.php b/newznab/controllers/RequestID.php index a28b91d3e..587885459 100644 --- a/newznab/controllers/RequestID.php +++ b/newznab/controllers/RequestID.php @@ -47,7 +47,7 @@ abstract class RequestID * * @return int Quantity of releases matched to a request id. */ - public function lookupRequestIDs(array $options = array()) + public function lookupRequestIDs(array $options = []) { $curOptions = [ 'charGUID' => '', @@ -131,7 +131,7 @@ abstract class RequestID */ protected function _siftReqId() { - $requestID = array(); + $requestID = []; switch (true) { case preg_match('/\[\s*#?scnzb@?efnet\s*\]\[(\d+)\]/', $this->_release['name'], $requestID): case preg_match('/\[\s*(\d+)\s*\]/', $this->_release['name'], $requestID): diff --git a/newznab/controllers/RequestIDLocal.php b/newznab/controllers/RequestIDLocal.php index 555bd6098..6b2e134f5 100644 --- a/newznab/controllers/RequestIDLocal.php +++ b/newznab/controllers/RequestIDLocal.php @@ -11,7 +11,7 @@ class RequestIDLocal extends RequestID /** * @param array $options Class instances / Echo to cli? */ - public function __construct(array $options = array()) + public function __construct(array $options = []) { parent::__construct($options); } @@ -158,7 +158,7 @@ class RequestIDLocal extends RequestID '(avi|jpg|nzb|m3u|mkv|par2|part\d+|nfo|sample|sfv|rar|r?\d{1,3}|\d+|zip)*)\s*\".*/i' ; - $matches = array(); + $matches = []; switch (true) { case preg_match($regex1, $this->_release['name'], $matches): case preg_match($regex2, $this->_release['name'], $matches): @@ -189,7 +189,7 @@ class RequestIDLocal extends RequestID return false; } - private $groupIDCache = array(); + private $groupIDCache = []; /** * Attempts to remap the release groupid by extracting the new group name from the release usenet name. diff --git a/newznab/controllers/RequestIDWeb.php b/newznab/controllers/RequestIDWeb.php index be5be3b96..0574beb20 100644 --- a/newznab/controllers/RequestIDWeb.php +++ b/newznab/controllers/RequestIDWeb.php @@ -28,7 +28,7 @@ class RequestIDWeb extends RequestID * * @param array $options Class instances / Echo to cli? */ - public function __construct(array $options = array()) + public function __construct(array $options = []) { parent::__construct($options); $this->_request_hours = ($this->pdo->getSetting('request_hours') != '') ? (int)$this->pdo->getSetting('request_hours') : 1; @@ -106,7 +106,7 @@ class RequestIDWeb extends RequestID protected function _processReleases() { // Array to store results. - $requestArray = array(); + $requestArray = []; if ($this->_releases instanceof \Traversable) { // Loop all the results. diff --git a/newznab/controllers/Sharing.php b/newznab/controllers/Sharing.php index da71a788f..b63daf7b6 100644 --- a/newznab/controllers/Sharing.php +++ b/newznab/controllers/Sharing.php @@ -59,7 +59,7 @@ Class Sharing * * @var array */ - protected $siteSettings = array(); + protected $siteSettings = []; /** * Group to work in. diff --git a/newznab/controllers/Sites.php b/newznab/controllers/Sites.php index f6940858b..8109c860d 100644 --- a/newznab/controllers/Sites.php +++ b/newznab/controllers/Sites.php @@ -59,7 +59,7 @@ class Sites if ($site->sabcompletedir != "" && !file_exists($site->sabcompletedir)) return Sites::ERR_SABCOMPLETEPATH; - $sql = $sqlKeys = array(); + $sql = $sqlKeys = []; foreach ($form as $settingK => $settingV) { $sql[] = sprintf("WHEN %s THEN %s", $db->escapeString($settingK), $db->escapeString(trim($settingV))); $sqlKeys[] = $db->escapeString($settingK); @@ -116,7 +116,7 @@ class Sites $patchpath = WWW_DIR . "../db/patch/0.2.3/"; $patchfiles = glob($patchpath . "*.sql"); - $missingpatch = array(); + $missingpatch = []; foreach ($patchfiles as $file) { $filecontents = file_get_contents($file); if (preg_match("/Rev\: (\d+)/", $filecontents, $matches)) { diff --git a/newznab/controllers/Sphinx.php b/newznab/controllers/Sphinx.php index 9ef63f681..47a51685e 100644 --- a/newznab/controllers/Sphinx.php +++ b/newznab/controllers/Sphinx.php @@ -47,7 +47,7 @@ class Sphinx */ public function runCmd($cmd, $stdout=true) { - $output = array(); + $output = []; $handle = popen($cmd, "r"); while ($line = fgets($handle)) { if (\newznab\utility\Utility::startsWith($line, "Sphinx") || @@ -241,8 +241,8 @@ class Sphinx public function indexDetails($index, $main=False) { $details = array( "enabled" => false, - "field_list" => array(), - "attr_list" => array() + "field_list" => [], + "attr_list" => [] ); if ($this->isIndexEnabled($index)) { @@ -428,9 +428,9 @@ class Sphinx * @param boolean Whether or not to include the delta indexes as well. * @return array An array of string of the enabled indexes. */ - public function getAllEnabledIndexes($deltas=false, $exclude=array()) + public function getAllEnabledIndexes($deltas=false, $exclude=[]) { - $enabled = array(); + $enabled = []; foreach($this->indexes as $index) { if ($this->isIndexEnabled($index) && !in_array($index, $exclude)) { $enabled[] = $index; @@ -651,7 +651,7 @@ class Sphinx } // Get the query metadata. - $meta = array(); + $meta = []; $mresult = mysqli_query($sdb,"SHOW META"); if (!$mresult) { return false; @@ -660,7 +660,7 @@ class Sphinx $meta[$row[0]] = $row[1]; } - $results = array(); + $results = []; if ($result) { while($row = mysqli_fetch_assoc($result)) { @@ -679,7 +679,7 @@ class Sphinx $result = $ndb->queryDirect($sql); if ($result) { - $results = array(); + $results = []; while ($row = $ndb->getAssocArray($result)) { $results[] = $row; } @@ -714,10 +714,10 @@ class Sphinx * @param string $lookupQuery * */ - public function buildQuery($search, $cat=array(), $offset=0, $limit=100, + public function buildQuery($search, $cat=[], $offset=0, $limit=100, $order=array("postdate", "desc"), $maxage=-1, - $excludedcats=array(), $grp=array(), - $indexes=array(), $lookup=true, $where=array(), + $excludedcats=[], $grp=[], + $indexes=[], $lookup=true, $where=[], &$lookupQuery="") { $ndb = new newznab\db\Settings; @@ -735,7 +735,7 @@ class Sphinx // Create a comma separated string of indexes, but only of enabled // indexes - $searchIndexes = array(); + $searchIndexes = []; foreach($indexes as $index) { if ($this->isIndexEnabled($index)) { $searchIndexes[] = $index; @@ -806,7 +806,7 @@ class Sphinx // Build the category query. If any of the categories are a "parent" // then we need to explicitly include their children as well. - $categoryIDs = array(); + $categoryIDs = []; if (count($cat) > 0 && $cat[0] != -1) { foreach ($cat as $category) { if ($category != -1) { @@ -908,10 +908,10 @@ class Sphinx * @param boolean $lookup Retrieve latest data from database. * @return array|false */ - public function search($search, $cat=array(), $offset=0, $limit=1000, + public function search($search, $cat=[], $offset=0, $limit=1000, $order=array("postdate", "desc"), $maxage=-1, - $excludedcats=array(), $grp=array(), - $indexes=array(), $lookup=true, $minsize=-1, $maxsize=-1) + $excludedcats=[], $grp=[], + $indexes=[], $lookup=true, $minsize=-1, $maxsize=-1) { if (count($indexes) == 0) { // Remove predb from the default list of indexes to search @@ -947,7 +947,7 @@ class Sphinx . "AND releases.id IN (%s)"; } - $where = array(); + $where = []; if ($minsize != -1) { $where[] = sprintf("size > %d ", $minsize); } @@ -967,7 +967,7 @@ class Sphinx */ public function searchbyRageId($rageId, $series="", $episode="", $offset=0, $limit=100, $name="", $cat=array(-1), - $maxage=-1, $indexes=array(), $lookup=true) + $maxage=-1, $indexes=[], $lookup=true) { $db = new newznab\db\Settings(); $order = array("postdate", "desc"); @@ -989,7 +989,7 @@ class Sphinx $search[] = sprintf("@episode %s", $db->escapeString($episode)); } - $where = array(); + $where = []; if ($rageId != "-1") { $where[] = "rageid = ".$rageId; } @@ -1022,7 +1022,7 @@ class Sphinx . "AND releases.id IN (%s)"; } $sphinxQuery = $this->buildQuery($search, $cat, $offset, $limit, $order, - $maxage, array(), array(), $indexes, + $maxage, [], [], $indexes, $lookup, $where, $lookupQuery); return $this->searchDirect($sphinxQuery, $lookupQuery, 180); } @@ -1033,12 +1033,12 @@ class Sphinx */ public function searchbyImdbId($imdbId, $offset=0, $limit=100, $name="", $cat=array(-1), $genre="", $maxage=-1, - $indexes=array(), $lookup=true) + $indexes=[], $lookup=true) { $db = new newznab\db\Settings(); - $search = array(); + $search = []; $order = array("postdate", "desc"); - $where = array(); + $where = []; if ($imdbId != "-1" && is_numeric($imdbId)) { // Pad id with zeros just in case. $imdbId = str_pad($imdbId, 7, "0", STR_PAD_LEFT); @@ -1088,7 +1088,7 @@ class Sphinx . "AND releases.id IN (%s)"; } $sphinxQuery = $this->buildQuery($search, $cat, $offset, $limit, $order, - $maxage, array(), array(), $indexes, + $maxage, [], [], $indexes, $lookup, $where, $lookupQuery); return $this->searchDirect($sphinxQuery, $lookupQuery, 180); } @@ -1099,12 +1099,12 @@ class Sphinx */ public function searchAudio($artist, $album, $label, $track, $year, $genre=array(-1), $offset=0, $limit=100, - $cat=array(-1), $maxage=-1, $indexes=array(), + $cat=array(-1), $maxage=-1, $indexes=[], $lookup=true) { $db = new newznab\db\Settings(); - $search = array(); - $where = array(); + $search = []; + $where = []; $order = array("postdate", "desc"); if ($artist != "") { $search[] = sprintf("@musicinfo_artist %s", $db->escapeString($artist)); @@ -1166,7 +1166,7 @@ class Sphinx . "AND releases.id IN (%s)"; } $sphinxQuery = $this->buildQuery($search, $cat, $offset, $limit, $order, - $maxage, array(), array(), $indexes, + $maxage, [], [], $indexes, $lookup, $where, $lookupQuery); return $this->searchDirect($sphinxQuery, $lookupQuery, 180); } @@ -1176,11 +1176,11 @@ class Sphinx * presents the same interface as :php:meth:`Releases::searchBook`. */ public function searchBook($author, $title, $offset=0, $limit=100, - $maxage=-1, $indexes=array(), $lookup=true) + $maxage=-1, $indexes=[], $lookup=true) { $db = new newznab\db\Settings(); $order = array("postdate", "desc"); - $search = array(); + $search = []; if ($author != "") { $search[] = sprintf("@bookinfo_author %s", $db->escapeString($author)); } @@ -1228,8 +1228,8 @@ class Sphinx } $sphinxQuery = $this->buildQuery($search, array(-1), $offset, $limit, - $order, $maxage, array(), array(), - $indexes, $lookup, array(), $lookupQuery); + $order, $maxage, [], [], + $indexes, $lookup, [], $lookupQuery); return $this->searchDirect($sphinxQuery, $lookupQuery, 180); } @@ -1238,12 +1238,12 @@ class Sphinx * presents the same interface as :php:meth:`Releases::searchbyAnidbId`. */ public function searchbyAnidbId($anidbID, $epno='', $offset=0, $limit=100, - $name='', $maxage=-1, $indexes=array(), + $name='', $maxage=-1, $indexes=[], $lookup=true) { $db = new newznab\db\Settings(); - $where = array(); - $search = array(); + $where = []; + $search = []; $order = array("postdate", "desc"); if ($anidbID > -1) { $where[] = sprintf("anidbid = %d", $anidbID); @@ -1279,7 +1279,7 @@ class Sphinx . "AND releases.id IN (%s)"; } $sphinxQuery = $this->buildQuery($search, array(-1), $offset, $limit, - $order, $maxage, array(), array(), + $order, $maxage, [], [], $indexes, $lookup, $where, $lookupQuery); return $this->searchDirect($sphinxQuery, $lookupQuery, 180); } diff --git a/newznab/controllers/Steam.php b/newznab/controllers/Steam.php index ba72bae16..c71c31f08 100644 --- a/newznab/controllers/Steam.php +++ b/newznab/controllers/Steam.php @@ -65,12 +65,12 @@ class Steam /** * @var array */ - protected $_postParams = array(); + protected $_postParams = []; /** * @var array */ - protected $_res = array(); + protected $_res = []; /** * @var @@ -126,7 +126,7 @@ class Steam public function details() { if ($this->_ret = $this->_html->find("div.details_block", 0)) { - $textarr = array(); + $textarr = []; foreach ($this->_ret->find('text') as $text) { $text = trim($text->plaintext); if (!empty($text)) { @@ -180,7 +180,7 @@ class Steam */ public function getAll() { - $results = array(); + $results = []; if (isset($this->_directURL)) { $results['steamgameid'] = $this->_steamGameID; $results['directurl'] = $this->_directURL; diff --git a/newznab/controllers/TheTVDB.php b/newznab/controllers/TheTVDB.php index 24ec1c7a0..537dcac8b 100644 --- a/newznab/controllers/TheTVDB.php +++ b/newznab/controllers/TheTVDB.php @@ -416,18 +416,18 @@ class TheTVDB //'seriesname' => ((string) $TheTVDBAPIXML->Series->SeriesName != '') ? (string) $TheTVDBAPIXML->Series->SeriesName : $seriesName, 'seriesname' => $seriesName, 'status' => (string) $TheTVDBAPIXML->Series->Status, - 'episodetvdbID' => isset($episodetvdbIDArray) ? $episodetvdbIDArray : array(), - 'episodenumber' => isset($episodenumberArray) ? $episodenumberArray : array(), - 'episodeseason' => isset($episodeseasonArray) ? $episodeseasonArray : array(), - 'episodedirector' => isset($episodedirectorArray) ? $episodedirectorArray : array(), - 'episodename' => isset($episodenameArray) ? $episodenameArray : array(), - 'episodefirstaired' => isset($episodefirstairedArray) ? $episodefirstairedArray : array(), - 'episodegueststars' => isset($episodegueststarsArray) ? $episodegueststarsArray : array(), - 'episodeimdbID' => isset($episodeimdbID) ? $episodeimdbID : array(), - 'episodeoverview' => isset($episodeoverviewArray) ? $episodeoverviewArray : array(), - 'episoderating' => isset($episoderatingArray) ? $episoderatingArray : array(), - 'episodewriter' => isset($episodewriterArray) ? $episodewriterArray : array(), - 'episodeabsolutenumber' => isset($episodeabsolutenumberArray) ? $episodeabsolutenumberArray : array(), + 'episodetvdbID' => isset($episodetvdbIDArray) ? $episodetvdbIDArray : [], + 'episodenumber' => isset($episodenumberArray) ? $episodenumberArray : [], + 'episodeseason' => isset($episodeseasonArray) ? $episodeseasonArray : [], + 'episodedirector' => isset($episodedirectorArray) ? $episodedirectorArray : [], + 'episodename' => isset($episodenameArray) ? $episodenameArray : [], + 'episodefirstaired' => isset($episodefirstairedArray) ? $episodefirstairedArray : [], + 'episodegueststars' => isset($episodegueststarsArray) ? $episodegueststarsArray : [], + 'episodeimdbID' => isset($episodeimdbID) ? $episodeimdbID : [], + 'episodeoverview' => isset($episodeoverviewArray) ? $episodeoverviewArray : [], + 'episoderating' => isset($episoderatingArray) ? $episoderatingArray : [], + 'episodewriter' => isset($episodewriterArray) ? $episodewriterArray : [], + 'episodeabsolutenumber' => isset($episodeabsolutenumberArray) ? $episodeabsolutenumberArray : [], ); return $TheTVDBAPIArray; diff --git a/newznab/controllers/Tmux.php b/newznab/controllers/Tmux.php index acaf384af..29979d47e 100644 --- a/newznab/controllers/Tmux.php +++ b/newznab/controllers/Tmux.php @@ -57,7 +57,7 @@ class Tmux public function getConnectionsInfo($constants) { - $runVar = array(); + $runVar = []; $runVar['connections']['port_a'] = $runVar['connections']['host_a'] = $runVar['connections']['ip_a'] = false; if ($constants['nntpproxy'] == 0) { @@ -118,7 +118,7 @@ class Tmux $port = 'port'; break; } - $runVar = array(); + $runVar = []; $runVar['conncounts'][$which]['active'] = $runVar['conncounts'][$which]['total'] = 0; @@ -347,7 +347,7 @@ class Tmux public function relativeTime($_time) { - $d = array(); + $d = []; $d[0] = [1, "sec"]; $d[1] = [60, "min"]; $d[2] = [3600, "hr"]; diff --git a/newznab/controllers/TvRage.php b/newznab/controllers/TvRage.php index 4f81abf9f..158ce4418 100644 --- a/newznab/controllers/TvRage.php +++ b/newznab/controllers/TvRage.php @@ -147,7 +147,7 @@ class TvRage $countries = $this->pdo->query("select distinct(country) as country from tvrage where country != ''"); $showsindb = $this->pdo->query("select distinct(rageid) as rageid from tvrage"); - $showarray = array(); + $showarray = []; foreach($showsindb as $show) { $showarray[] = $show['rageid']; @@ -175,7 +175,7 @@ class TvRage { $tzOffset = 60*60*6; $yesterday = strtotime("-1 day") - $tzOffset; - $xmlSchedule = array(); + $xmlSchedule = []; foreach ($sched as $dayObj) { @@ -232,7 +232,7 @@ class TvRage foreach ($res as $arr) { $prev_ep = $next_ep = ""; - $query = array(); + $query = []; // previous episode if (isset($epInfo['prev']) && $epInfo['prev']['episode'] != '') @@ -635,14 +635,14 @@ class TvRage if (isset($arrXml['show']) && is_array($arrXml['show'])) { // we got a valid xml response - $titleMatches = array(); - $urlMatches = array(); - $akaMatches = array(); + $titleMatches = []; + $urlMatches = []; + $akaMatches = []; if (isset($arrXml['show']['showid'])) { // we got exactly 1 match so lets convert it to an array so we can use it in the logic below - $newArr = array(); + $newArr = []; $newArr[] = $arrXml['show']; unset($arrXml); $arrXml['show'] = $newArr; @@ -988,7 +988,7 @@ class TvRage $showInfo['season'] = sprintf('S%02d', $showInfo['season']); //check for multi episode release if (is_array($showInfo['episode'])) { - $tmpArr = array(); + $tmpArr = []; foreach ($showInfo['episode'] as $ep) { $tmpArr[] = sprintf('E%02d', $ep); } diff --git a/newznab/controllers/zipfile.php b/newznab/controllers/zipfile.php index 769e47435..9b71db786 100644 --- a/newznab/controllers/zipfile.php +++ b/newznab/controllers/zipfile.php @@ -33,14 +33,14 @@ class zipfile * * @var array $datasec */ - var $datasec = array(); + var $datasec = []; /** * Central directory * * @var array $ctrl_dir */ - var $ctrl_dir = array(); + var $ctrl_dir = []; /** * End of central directory record diff --git a/newznab/processing/post/AniDB.php b/newznab/processing/post/AniDB.php index a2faa6c05..50a7af039 100644 --- a/newznab/processing/post/AniDB.php +++ b/newznab/processing/post/AniDB.php @@ -38,7 +38,7 @@ class AniDB /** * @param array $options Class instances / Echo to cli. */ - public function __construct(array $options = array()) + public function __construct(array $options = []) { $defaults = [ 'Echo' => false, @@ -199,7 +199,7 @@ class AniDB * * @return bool */ - private function matchAnimeRelease($release = array()) + private function matchAnimeRelease($release = []) { $matched = false; $type = 'Local'; diff --git a/newznab/processing/post/ProcessAdditional.php b/newznab/processing/post/ProcessAdditional.php index 64859acb9..bea0f8b0c 100644 --- a/newznab/processing/post/ProcessAdditional.php +++ b/newznab/processing/post/ProcessAdditional.php @@ -309,7 +309,7 @@ class ProcessAdditional $this->_unrarPath = false; // Pass the binary extractors to ArchiveInfo. - $clients = array(); + $clients = []; if ($this->pdo->getSetting('unrarpath') != '') { $clients += array(\ArchiveInfo::TYPE_RAR => $this->pdo->getSetting('unrarpath')); $this->_unrarPath = $this->pdo->getSetting('unrarpath'); @@ -527,7 +527,7 @@ class ProcessAdditional if (is_array($this->_releases)) { $this->_totalReleases = count($this->_releases); } else { - $this->_releases = array(); + $this->_releases = []; $this->_totalReleases = 0; } } @@ -640,7 +640,7 @@ class ProcessAdditional * @void * @access protected */ - protected function _recursivePathDelete($path, $ignoredFolders = array()) + protected function _recursivePathDelete($path, $ignoredFolders = []) { if (is_dir($path)) { @@ -1056,7 +1056,7 @@ class ProcessAdditional break; } - $fileName = array(); + $fileName = []; if (preg_match('/[^\/\\\\]*\.[a-zA-Z0-9]*$/', $file['name'], $fileName)) { $fileName = $fileName[0]; } else { @@ -1184,7 +1184,7 @@ class ProcessAdditional $nestedLevels++; } - $fileType = array(); + $fileType = []; // Get all the remaining files in the temp dir. $files = $this->_getTempDirectoryContents(); @@ -2535,8 +2535,8 @@ class ProcessAdditional $this->_NZBHasCompressedFile = false; - $this->_sampleMessageIDs = $this->_JPGMessageIDs = $this->_MediaInfoMessageIDs = array(); - $this->_AudioInfoMessageIDs = $this->_RARFileMessageIDs = array(); + $this->_sampleMessageIDs = $this->_JPGMessageIDs = $this->_MediaInfoMessageIDs = []; + $this->_AudioInfoMessageIDs = $this->_RARFileMessageIDs = []; $this->_AudioInfoExtension = ''; $this->_addedFileInfo = 0; diff --git a/www/admin/binaryblacklist-edit.php b/www/admin/binaryblacklist-edit.php index 2edf52103..c543b1dd9 100644 --- a/www/admin/binaryblacklist-edit.php +++ b/www/admin/binaryblacklist-edit.php @@ -55,7 +55,7 @@ switch($action) else { $page->title = "Binary Black/Whitelist Add"; - $r = array(); + $r = []; $r["status"] = 1; $r["optype"] = 1; $r["msgcol"] = 1; diff --git a/www/admin/index.php b/www/admin/index.php index 2f1c379c8..2317accb8 100644 --- a/www/admin/index.php +++ b/www/admin/index.php @@ -8,7 +8,7 @@ $page = new AdminPage(); $page->title = "Admin Hangout"; -$statusmsgs = array(); +$statusmsgs = []; // // status messages diff --git a/www/admin/menu-edit.php b/www/admin/menu-edit.php index 216e54e33..293e52891 100644 --- a/www/admin/menu-edit.php +++ b/www/admin/menu-edit.php @@ -10,7 +10,7 @@ $id = 0; //get the user roles $userroles = $users->getRoles(); -$roles = array(); +$roles = []; foreach ($userroles as $r) { $roles[$r['ID']] = $r['name']; } diff --git a/www/admin/preview-list.php b/www/admin/preview-list.php index b818a53e0..e2fab6650 100644 --- a/www/admin/preview-list.php +++ b/www/admin/preview-list.php @@ -13,7 +13,7 @@ $previewcat="-1"; if (isset($_REQUEST["previewcat"])) $previewcat = $_REQUEST["previewcat"]; -$catarray = array(); +$catarray = []; $catarray[] = $previewcat; $releasecount = $releases->getPreviewCount($previewtype, $catarray); diff --git a/www/admin/regex-edit.php b/www/admin/regex-edit.php index 7826558e1..084377c4a 100644 --- a/www/admin/regex-edit.php +++ b/www/admin/regex-edit.php @@ -44,7 +44,7 @@ switch($action) } else { - $r = array(); + $r = []; $r["status"] = 1; } $page->smarty->assign('regex', $r); diff --git a/www/admin/regex-test.php b/www/admin/regex-test.php index 03266dd23..b7dc126bb 100644 --- a/www/admin/regex-test.php +++ b/www/admin/regex-test.php @@ -16,7 +16,7 @@ $numarticlesdefault = 20000; $groupList = $groups->getAll(); array_unshift($groupList, array('ID'=>0, 'name'=>'All Groups')); -$gid = $gnames = array(); +$gid = $gnames = []; $groupname = (isset($_REQUEST['groupname']) && !empty($_REQUEST['groupname'])) ? $_REQUEST['groupname'] : ''; $groupID = isset($_REQUEST['groupID']) ? $_REQUEST['groupID'] : '0'; $regex = (isset($_REQUEST['regex']) && !empty($_REQUEST['regex'])) ? $_REQUEST['regex'] : '/^(?P<name>.*)$/i'; diff --git a/www/admin/role-edit.php b/www/admin/role-edit.php index 49cb02fe8..1f85ec6c7 100644 --- a/www/admin/role-edit.php +++ b/www/admin/role-edit.php @@ -12,7 +12,7 @@ $action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'view'; //get the user roles $userroles = $users->getRoles(); -$roles = array(); +$roles = []; foreach ($userroles as $r) { $roles[$r['ID']] = $r['name']; } @@ -21,7 +21,7 @@ switch($action) { case 'add': $page->title = "User Roles Add"; - $role = array(); + $role = []; $role["name"] = ''; $role["apirequests"] = ''; $role["downloadrequests"] = ''; @@ -43,7 +43,7 @@ switch($action) $ret = $users->updateRole($_POST['id'], $_POST['name'], $_POST['apirequests'], $_POST['downloadrequests'], $_POST['defaultinvites'], $_POST['isdefault'], $_POST['canpreview'], $_POST['canpre'], $_POST['hidetads']); header("Location:".WWW_TOP."/role-list.php"); - $_POST['exccat'] = (!isset($_POST['exccat']) || !is_array($_POST['exccat'])) ? array() : $_POST['exccat']; + $_POST['exccat'] = (!isset($_POST['exccat']) || !is_array($_POST['exccat'])) ? [] : $_POST['exccat']; $users->addRoleCategoryExclusions($_POST['id'], $_POST['exccat']); } diff --git a/www/admin/site-edit.php b/www/admin/site-edit.php index aca42b65b..1f1eb6cb1 100644 --- a/www/admin/site-edit.php +++ b/www/admin/site-edit.php @@ -143,8 +143,8 @@ $page->smarty->assign('coversPath', NN_COVERS); $result = $page->settings->query("SELECT id, title FROM category WHERE id in (3030, 7010, 7020, 7040, 7060)"); // setup the display lists for these categories, this could have been static, but then if names changed they would be wrong -$book_reqids_ids = array(); -$book_reqids_names = array(); +$book_reqids_ids = []; +$book_reqids_names = []; foreach ($result as $bookcategory) { $book_reqids_ids[] = $bookcategory["id"]; diff --git a/www/admin/spotnab-edit.php b/www/admin/spotnab-edit.php index 601bc9c6e..542987552 100644 --- a/www/admin/spotnab-edit.php +++ b/www/admin/spotnab-edit.php @@ -13,7 +13,7 @@ switch($action) { case 'add': $page->title = "Spotnab Source Add"; - $source = array(); + $source = []; $source["description"] = ''; $row = $spotnab->getDefaultValue('spotnabsources','username'); $source["username"] = $row[0]["Default"]; diff --git a/www/admin/user-list.php b/www/admin/user-list.php index 7e4b1d331..42de55676 100644 --- a/www/admin/user-list.php +++ b/www/admin/user-list.php @@ -10,7 +10,7 @@ $page->title = "User List"; $usercount = $users->getCount(); $userroles = $users->getRoles(); -$roles = array(); +$roles = []; foreach ($userroles as $r) { $roles[$r['id']] = $r['name']; } diff --git a/www/pages/ajax_mymovies.php b/www/pages/ajax_mymovies.php index be4bcb74e..e9e03938a 100644 --- a/www/pages/ajax_mymovies.php +++ b/www/pages/ajax_mymovies.php @@ -12,7 +12,7 @@ if (isset($_REQUEST['del'])) { $usermovies = $um->delMovie($page->users->currentUserId(), $_REQUEST['del']); } else if (isset($_REQUEST['add'])) { // Derive cats from user preferences. - $cats = array(); + $cats = []; $cats[] = '2030'; $cats[] = '2040'; @@ -40,7 +40,7 @@ if (isset($_REQUEST['del'])) { $searchm = $tmdb->searchMovie($_REQUEST['id']); if ($searchm !== false) { if (isset($searchm['results'])) { - $obj = array(); + $obj = []; $limit = 0; foreach ($searchm['results'] as $movie) { $limit++; @@ -55,7 +55,7 @@ if (isset($_REQUEST['del'])) { } } } - $imdbids = array(); + $imdbids = []; if (isset($obj) && count($obj) > 0) { foreach ($obj as $movie) { @@ -67,7 +67,7 @@ if (isset($_REQUEST['del'])) { if (count($imdbids) == 0) { print "<h3 style='padding-top:30px;'>No results found</h3>"; } else { - $ourmovieimdbs = array(); + $ourmovieimdbs = []; if (count($imdbids) > 0) { $m = new Film(['Settings' => $page->settings, 'TMDb' => $tmdb]); $allmovies = $m->getMovieInfoMultiImdb($imdbids); @@ -78,7 +78,7 @@ if (isset($_REQUEST['del'])) { } } - $userimdbs = array(); + $userimdbs = []; $usermovies = $um->getMovies($page->users->currentUserId()); foreach ($usermovies as $umovie) { $userimdbs[$umovie['imdbid']] = $umovie['imdbid']; diff --git a/www/pages/anime.php b/www/pages/anime.php index a79f5f915..7da5c437a 100644 --- a/www/pages/anime.php +++ b/www/pages/anime.php @@ -20,7 +20,7 @@ if (isset($_GET['id']) && ctype_digit($_GET['id'])) { $page->smarty->assign('nodata', 'No releases for this series.'); } else { // Sort releases by season, episode, date posted. - $season = $episode = $posted = array(); + $season = $episode = $posted = []; foreach ($releases as $rlk => $rlv) { $season[$rlk] = $rlv['season']; @@ -30,7 +30,7 @@ if (isset($_GET['id']) && ctype_digit($_GET['id'])) { array_multisort($episode, SORT_DESC, $posted, SORT_DESC, $releases); - $seasons = array(); + $seasons = []; foreach ($releases as $r) { $seasons[$r['season']][$r['episode']][] = $r; } @@ -38,7 +38,7 @@ if (isset($_GET['id']) && ctype_digit($_GET['id'])) { $page->smarty->assign('seasons', $seasons); $page->smarty->assign('anidb', $anidb); - $animeEpisodeTitles = array(); + $animeEpisodeTitles = []; foreach ($releases as $r) { $animeEpisodeTitles[$r['tvtitle']][] = $r; } @@ -82,7 +82,7 @@ if (isset($_GET['id']) && ctype_digit($_GET['id'])) { $page->meta_keywords = 'view,anime,series,description,details'; $page->meta_description = 'View Anime List'; - $animelist = array(); + $animelist = []; if ($masterserieslist instanceof \Traversable) { foreach ($masterserieslist as $s) { if (preg_match('/^[0-9]/', $s['title'])) { diff --git a/www/pages/api.php b/www/pages/api.php index 77cc7a14e..d708d7011 100644 --- a/www/pages/api.php +++ b/www/pages/api.php @@ -224,7 +224,7 @@ switch ($function) { if ($data) $reldata = $data; else - $reldata = array(); + $reldata = []; $page->smarty->assign('comments',$reldata); $page->smarty->assign('rsstitle',"API Comments"); @@ -306,7 +306,7 @@ switch ($function) { case "mu": if (isset($_GET["artist"]) && $_GET["artist"]=="" && isset($_GET["album"]) && $_GET["album"]=="") showApiError(200); - $categoryId = array(); + $categoryId = []; if (isset($_GET["cat"])) $categoryId = explode(",",$_GET["cat"]); else @@ -323,7 +323,7 @@ switch ($function) { $maxage = $_GET["maxage"]; } - $genreId = array(); + $genreId = []; if (isset($_GET["genre"])) $genreId = explode(",",$_GET["genre"]); else @@ -560,7 +560,7 @@ function maxAge() */ function categoryid() { - $categoryID = array(); + $categoryID = []; $categoryID[] = -1; if (isset($_GET['cat'])) { $categoryIDs = $_GET['cat']; diff --git a/www/pages/console.php b/www/pages/console.php index 617b5b92f..f51d33e05 100644 --- a/www/pages/console.php +++ b/www/pages/console.php @@ -9,7 +9,7 @@ $cat = new Category(['Settings' => $page->settings]); $gen = new Genres(['Settings' => $page->settings]); $concats = $cat->getChildren(Category::CAT_PARENT_GAME); -$ctmp = array(); +$ctmp = []; foreach ($concats as $ccat) { $ctmp[$ccat['id']] = $ccat; } @@ -18,7 +18,7 @@ if (isset($_REQUEST["t"]) && array_key_exists($_REQUEST['t'], $ctmp)) { $category = $_REQUEST["t"] + 0; } -$catarray = array(); +$catarray = []; $catarray[] = $category; $page->smarty->assign('catlist', $ctmp); @@ -30,7 +30,7 @@ $offset = (isset($_REQUEST["offset"]) && ctype_digit($_REQUEST['offset'])) ? $_R $ordering = $console->getConsoleOrdering(); $orderby = isset($_REQUEST["ob"]) && in_array($_REQUEST['ob'], $ordering) ? $_REQUEST["ob"] : ''; -$results = $consoles = array(); +$results = $consoles = []; $results = $console->getConsoleRange($catarray, $offset, ITEMS_PER_COVER_PAGE, $orderby, $page->userdata["categoryexclusions"]); $maxwords = 50; @@ -52,7 +52,7 @@ $title = (isset($_REQUEST['title']) && !empty($_REQUEST['title'])) ? stripslashe $page->smarty->assign('title', $title); $genres = $gen->getGenres(Genres::CONSOLE_TYPE, true); -$tmpgnr = array(); +$tmpgnr = []; foreach ($genres as $gn) { $tmpgnr[$gn['id']] = $gn['title']; } diff --git a/www/pages/details.php b/www/pages/details.php index f4cdfb729..2be14428c 100644 --- a/www/pages/details.php +++ b/www/pages/details.php @@ -34,7 +34,7 @@ if (isset($_GET["id"])) $rageinfo = $tvrage->getByRageID($data["rageid"]); if (count($rageinfo) > 0) { - $seriesnames = $seriesdescription = $seriescountry = $seriesgenre = $seriesimg = $seriesid = array(); + $seriesnames = $seriesdescription = $seriescountry = $seriesgenre = $seriesimg = $seriesid = []; foreach($rageinfo as $r) { $seriesnames[] = $r['releasetitle']; diff --git a/www/pages/dlbrowse.php b/www/pages/dlbrowse.php index 859b7f973..c91e04e42 100644 --- a/www/pages/dlbrowse.php +++ b/www/pages/dlbrowse.php @@ -40,11 +40,11 @@ if (!Utility::startsWith(realpath($path), realpath($basepath))) $files = glob(preg_replace('/(\*|\?|\[)/', '[$1]', $path)."/*"); -$items = array(); -$dirs = array(); +$items = []; +$dirs = []; foreach($files as $f) { - $i = array(); + $i = []; $i["name"] = basename($f); $i["isdir"] = (is_dir($f)?1:0); $i["fullname"] = $f; diff --git a/www/pages/games.php b/www/pages/games.php index 26c0108fa..bc37fbfb9 100644 --- a/www/pages/games.php +++ b/www/pages/games.php @@ -9,7 +9,7 @@ $cat = new Category(['Settings' => $page->settings]); $gen = new Genres(['Settings' => $page->settings]); $concats = $cat->getChildren(Category::CAT_PARENT_PC); -$ctmp = array(); +$ctmp = []; foreach ($concats as $ccat) { $ctmp[$ccat['id']] = $ccat; } @@ -18,7 +18,7 @@ if (isset($_REQUEST["t"]) && array_key_exists($_REQUEST['t'], $ctmp)) { $category = $_REQUEST["t"] + 0; } -$catarray = array(); +$catarray = []; $catarray[] = $category; $page->smarty->assign('catlist', $ctmp); @@ -31,7 +31,7 @@ $ordering = $games->getGamesOrdering(); $orderby = isset($_REQUEST["ob"]) && in_array($_REQUEST['ob'], $ordering) ? $_REQUEST["ob"] : ''; -$results = $games2 = array(); +$results = $games2 = []; $results = $games->getGamesRange($catarray, $offset, ITEMS_PER_COVER_PAGE, $orderby, -1, $page->userdata["categoryexclusions"]); $maxwords = 50; foreach ($results as $result) { @@ -53,7 +53,7 @@ $title = (isset($_REQUEST['title']) && !empty($_REQUEST['title'])) ? stripslashe $page->smarty->assign('title', $title); $genres = $gen->getGenres(Genres::GAME_TYPE, true); -$tmpgnr = array(); +$tmpgnr = []; foreach ($genres as $gn) { $tmpgnr[$gn['id']] = $gn['title']; } diff --git a/www/pages/mymoviesedit.php b/www/pages/mymoviesedit.php index 2d2c30a6d..4a386d2ed 100644 --- a/www/pages/mymoviesedit.php +++ b/www/pages/mymoviesedit.php @@ -12,17 +12,17 @@ if (isset($_REQUEST["del"])) { $cat = new Category(['Settings' => $page->settings]); $tmpcats = $cat->getChildren(Category::CAT_PARENT_MOVIE); -$categories = array(); +$categories = []; foreach ($tmpcats as $c) { $categories[$c['id']] = $c['title']; } $movies = $um->getMovies($page->users->currentUserId()); -$results = array(); +$results = []; foreach ($movies as $mov => $m) { $movcats = explode('|', $m['categoryid']); if (is_array($movcats) && sizeof($movcats) > 0) { - $catarr = array(); + $catarr = []; foreach ($movcats as $movcat) { if (!empty($movcat)) { $catarr[] = $categories[$movcat]; diff --git a/www/pages/newposterwall.php b/www/pages/newposterwall.php index 1c327325f..ccd634e6c 100644 --- a/www/pages/newposterwall.php +++ b/www/pages/newposterwall.php @@ -12,7 +12,7 @@ $error = false; // Array with all the possible poster wall types. $startTypes = array('Books', 'Console', 'Movies', 'XXX', 'Audio', 'PC', 'TV'/*, 'Recent'*/); // Array that will contain the poster wall types (the above array minus whatever they have disabled in admin). -$types = array(); +$types = []; // Get the names of all enabled parent categories. $categories = $category->getEnabledParentNames(); // Loop through our possible ones and check if they are in the enabled categories. diff --git a/www/pages/series.php b/www/pages/series.php index 35f57b4f8..3ca7924ed 100644 --- a/www/pages/series.php +++ b/www/pages/series.php @@ -15,7 +15,7 @@ if (isset($_GET["id"]) && ctype_digit($_GET['id'])) { $category = $_REQUEST["t"]; } - $catarray = array(); + $catarray = []; $catarray[] = $category; $rel = $releases->searchbyRageId($_GET["id"], '', '', 0, 1000, "", $catarray, -1); @@ -29,7 +29,7 @@ if (isset($_GET["id"]) && ctype_digit($_GET['id'])) { $myshows = $us->getShow($page->users->currentUserId(), $rage[0]['rageid']); // Sort releases by season, episode, date posted. - $season = $episode = $posted = array(); + $season = $episode = $posted = []; foreach ($rel as $rlk => $rlv) { $season[$rlk] = $rlv['season']; $episode[$rlk] = $rlv['episode']; @@ -37,7 +37,7 @@ if (isset($_GET["id"]) && ctype_digit($_GET['id'])) { } array_multisort($season, SORT_DESC, $episode, SORT_DESC, $posted, SORT_DESC, $rel); - $seasons = array(); + $seasons = []; foreach ($rel as $r) { $seasons[$r['season']][$r['episode']][] = $r; } @@ -47,7 +47,7 @@ if (isset($_GET["id"]) && ctype_digit($_GET['id'])) { $page->smarty->assign('myshows', $myshows); //get series name(s), description, country and genre - $seriesnames = $seriesdescription = $seriescountry = $seriesgenre = array(); + $seriesnames = $seriesdescription = $seriescountry = $seriesgenre = []; foreach ($rage as $r) { $seriesnames[] = $r['releasetitle']; if (!empty($r['description'])) { @@ -101,7 +101,7 @@ if (isset($_GET["id"]) && ctype_digit($_GET['id'])) { $page->meta_keywords = "view,series,tv,show,description,details"; $page->meta_description = "View Series List"; - $serieslist = array(); + $serieslist = []; foreach ($masterserieslist as $s) { if (preg_match('/^[0-9]/', $s['releasetitle'])) { $thisrange = '0-9'; diff --git a/www/pages/xxx.php b/www/pages/xxx.php index db171324f..ef6458e70 100644 --- a/www/pages/xxx.php +++ b/www/pages/xxx.php @@ -8,7 +8,7 @@ $movie = new XXX(); $cat = new Category(); $moviecats = $cat->getChildren(Category::CAT_PARENT_XXX); -$mtmp = array(); +$mtmp = []; foreach ($moviecats as $mcat) { $mtmp[$mcat['id']] = $mcat; } @@ -16,7 +16,7 @@ $category = Category::CAT_PARENT_XXX; if (isset($_REQUEST['t']) && array_key_exists($_REQUEST['t'], $mtmp)) { $category = $_REQUEST['t'] + 0; } -$catarray = array(); +$catarray = []; $catarray[] = $category; $page->smarty->assign('catlist', $mtmp); @@ -28,7 +28,7 @@ $offset = (isset($_REQUEST['offset']) && ctype_digit($_REQUEST['offset'])) ? $_R $ordering = $movie->getXXXOrdering(); $orderby = isset($_REQUEST['ob']) && in_array($_REQUEST['ob'], $ordering) ? $_REQUEST['ob'] : ''; -$results = $movies = array(); +$results = $movies = []; $results = $movie->getXXXRange($catarray, $offset, ITEMS_PER_COVER_PAGE, $orderby, -1, $page->userdata['categoryexclusions']); foreach ($results as $result) { $result['genre'] = $movie->makeFieldLinks($result, 'genre');