moves mysql config to separate file
This commit is contained in:
parent
f148f3bf10
commit
41ebe20498
7
help.php
7
help.php
|
@ -406,10 +406,11 @@ function setupMySQL()
|
|||
// we need to locate tracker.mysql.php
|
||||
// first, try the most obvious location.. which should be in the
|
||||
// same directory as the ./help.php file being ran
|
||||
if (is_readable('./tracker.mysql.php'))
|
||||
if (is_readable('./mysql/tracker.mysql.php'))
|
||||
{
|
||||
// require
|
||||
require './tracker.mysql.php';
|
||||
require './mysql/tracker.mysql.php';
|
||||
require './mysql.config.php';
|
||||
}
|
||||
// unfortunately, it does not seem the file is located in the current
|
||||
// directory, we will recurse the paths below and attempt to locate it
|
||||
|
@ -669,4 +670,4 @@ utilMySQL();
|
|||
</table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
29
mysql.config.php
Normal file
29
mysql.config.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
|
||||
<?php
|
||||
$_SERVER['tracker'] = array(
|
||||
// general tracker options
|
||||
'open_tracker' => true, /* track anything announced to it */
|
||||
'announce_interval' => 1800, /* how often client will send requests */
|
||||
'min_interval' => 900, /* how often client can force requests */
|
||||
'default_peers' => 50, /* default # of peers to announce */
|
||||
'max_peers' => 100, /* max # of peers to announce */
|
||||
|
||||
// advanced tracker options
|
||||
'external_ip' => true, /* allow client to specify ip address */
|
||||
'force_compact' => false, /* force compact announces only */
|
||||
'full_scrape' => false, /* allow scrapes without info_hash */
|
||||
'random_limit' => 500, /* if peers > #, use alternate SQL RAND() */
|
||||
'clean_idle_peers' => 10, /* tweaks % of time tracker attempts idle peer removal */
|
||||
/* if you have a busy tracker, you may adjust this */
|
||||
/* example: 10 = 10%, 20 = 5%, 50 = 2%, 100 = 1% */
|
||||
// database options
|
||||
'db_host' => 'localhost', /* ip or hostname to mysql server */
|
||||
'db_user' => 'root', /* username used to connect to mysql */
|
||||
'db_pass' => '', /* password used to connect to mysql */
|
||||
'db_name' => 'peertracker', /* name of the PeerTracker database */
|
||||
|
||||
// advanced database options
|
||||
'db_prefix' => 'pt_', /* name prefixes for the PeerTracker tables */
|
||||
'db_persist' => false, /* use persistent connections if available. */
|
||||
);
|
||||
?>
|
|
@ -24,33 +24,7 @@
|
|||
// Configuration ///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// tracker state
|
||||
$_SERVER['tracker'] = array(
|
||||
// general tracker options
|
||||
'open_tracker' => true, /* track anything announced to it */
|
||||
'announce_interval' => 1800, /* how often client will send requests */
|
||||
'min_interval' => 900, /* how often client can force requests */
|
||||
'default_peers' => 50, /* default # of peers to announce */
|
||||
'max_peers' => 100, /* max # of peers to announce */
|
||||
|
||||
// advanced tracker options
|
||||
'external_ip' => true, /* allow client to specify ip address */
|
||||
'force_compact' => false, /* force compact announces only */
|
||||
'full_scrape' => false, /* allow scrapes without info_hash */
|
||||
'random_limit' => 500, /* if peers > #, use alternate SQL RAND() */
|
||||
'clean_idle_peers' => 10, /* tweaks % of time tracker attempts idle peer removal */
|
||||
/* if you have a busy tracker, you may adjust this */
|
||||
/* example: 10 = 10%, 20 = 5%, 50 = 2%, 100 = 1% */
|
||||
// database options
|
||||
'db_host' => 'localhost', /* ip or hostname to mysql server */
|
||||
'db_user' => 'root', /* username used to connect to mysql */
|
||||
'db_pass' => '', /* password used to connect to mysql */
|
||||
'db_name' => 'peertracker', /* name of the PeerTracker database */
|
||||
|
||||
// advanced database options
|
||||
'db_prefix' => 'pt_', /* name prefixes for the PeerTracker tables */
|
||||
'db_persist' => false, /* use persistent connections if available. */
|
||||
);
|
||||
|
||||
require('../mysql.config.php')
|
||||
// Tracker Operations //////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// fatal error, stop execution
|
||||
|
|
Loading…
Reference in New Issue
Block a user