mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-20 13:24:01 -07:00
Fixed issue with DB_PORT not applying (#710)
This commit is contained in:
parent
7b456fcb54
commit
95d280175a
2 changed files with 4 additions and 3 deletions
|
@ -31,6 +31,7 @@ $bb_cfg['db'] = [
|
||||||
'db' => [
|
'db' => [
|
||||||
// Don't change the settings here!!! Go to .env file
|
// Don't change the settings here!!! Go to .env file
|
||||||
env('DB_HOST', 'localhost'),
|
env('DB_HOST', 'localhost'),
|
||||||
|
env('DB_PORT', 3306),
|
||||||
env('DB_DATABASE', 'torrentpier'),
|
env('DB_DATABASE', 'torrentpier'),
|
||||||
env('DB_USERNAME', 'root'),
|
env('DB_USERNAME', 'root'),
|
||||||
env('DB_PASSWORD'),
|
env('DB_PASSWORD'),
|
||||||
|
|
|
@ -19,7 +19,7 @@ use TorrentPier\Dev;
|
||||||
class SqlDb
|
class SqlDb
|
||||||
{
|
{
|
||||||
public $cfg = [];
|
public $cfg = [];
|
||||||
public $cfg_keys = ['dbhost', 'dbname', 'dbuser', 'dbpasswd', 'charset', 'persist'];
|
public $cfg_keys = ['dbhost', 'dbport', 'dbname', 'dbuser', 'dbpasswd', 'charset', 'persist'];
|
||||||
private $link;
|
private $link;
|
||||||
public $result;
|
public $result;
|
||||||
public $db_server = '';
|
public $db_server = '';
|
||||||
|
@ -97,11 +97,11 @@ class SqlDb
|
||||||
*/
|
*/
|
||||||
public function connect()
|
public function connect()
|
||||||
{
|
{
|
||||||
$this->cur_query = $this->dbg_enabled ? "connect to: {$this->cfg['dbhost']}" : 'connect';
|
$this->cur_query = $this->dbg_enabled ? "connect to: {$this->cfg['dbhost']}:{$this->cfg['dbport']}" : 'connect';
|
||||||
$this->debug('start');
|
$this->debug('start');
|
||||||
|
|
||||||
$p = ((bool)$this->cfg['persist']) ? 'p:' : '';
|
$p = ((bool)$this->cfg['persist']) ? 'p:' : '';
|
||||||
$this->link = mysqli_connect($p . $this->cfg['dbhost'], $this->cfg['dbuser'], $this->cfg['dbpasswd'], $this->cfg['dbname']);
|
$this->link = mysqli_connect($p . $this->cfg['dbhost'], $this->cfg['dbuser'], $this->cfg['dbpasswd'], $this->cfg['dbname'], $this->cfg['dbport']);
|
||||||
$this->selected_db = $this->cfg['dbname'];
|
$this->selected_db = $this->cfg['dbname'];
|
||||||
|
|
||||||
register_shutdown_function([&$this, 'close']);
|
register_shutdown_function([&$this, 'close']);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue