mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
Make caching for ban list (#1269)
This commit is contained in:
parent
ed34bbb735
commit
66083cabad
7 changed files with 46 additions and 31 deletions
21
library/includes/datastore/build_bans.php
Normal file
21
library/includes/datastore/build_bans.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
/**
|
||||
* TorrentPier – Bull-powered BitTorrent tracker engine
|
||||
*
|
||||
* @copyright Copyright (c) 2005-2024 TorrentPier (https://torrentpier.com)
|
||||
* @link https://github.com/torrentpier/torrentpier for the canonical source repository
|
||||
* @license https://github.com/torrentpier/torrentpier/blob/master/LICENSE MIT License
|
||||
*/
|
||||
|
||||
if (!defined('BB_ROOT')) {
|
||||
die(basename(__FILE__));
|
||||
}
|
||||
|
||||
$sql = "SELECT * FROM " . BB_BANLIST;
|
||||
$bans = [];
|
||||
|
||||
foreach (DB()->fetch_rowset($sql) as $row) {
|
||||
$bans[$row['ban_userid']] = $row;
|
||||
}
|
||||
|
||||
$this->store('ban_list', $bans);
|
|
@ -11,9 +11,8 @@ if (!defined('BB_ROOT')) {
|
|||
die(basename(__FILE__));
|
||||
}
|
||||
|
||||
$ranks = [];
|
||||
|
||||
$sql = "SELECT * FROM " . BB_RANKS;
|
||||
$ranks = [];
|
||||
|
||||
foreach (DB()->fetch_rowset($sql) as $row) {
|
||||
$ranks[$row['rank_id']] = $row;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue