mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 10:37:30 -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' => [
|
||||
// Don't change the settings here!!! Go to .env file
|
||||
env('DB_HOST', 'localhost'),
|
||||
env('DB_PORT', 3306),
|
||||
env('DB_DATABASE', 'torrentpier'),
|
||||
env('DB_USERNAME', 'root'),
|
||||
env('DB_PASSWORD'),
|
||||
|
|
|
@ -19,7 +19,7 @@ use TorrentPier\Dev;
|
|||
class SqlDb
|
||||
{
|
||||
public $cfg = [];
|
||||
public $cfg_keys = ['dbhost', 'dbname', 'dbuser', 'dbpasswd', 'charset', 'persist'];
|
||||
public $cfg_keys = ['dbhost', 'dbport', 'dbname', 'dbuser', 'dbpasswd', 'charset', 'persist'];
|
||||
private $link;
|
||||
public $result;
|
||||
public $db_server = '';
|
||||
|
@ -97,11 +97,11 @@ class SqlDb
|
|||
*/
|
||||
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');
|
||||
|
||||
$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'];
|
||||
|
||||
register_shutdown_function([&$this, 'close']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue