Skip to content

Commit c84a6d5

Browse files
committed
Added: FS#1691 - Add support for mysql flags like MYSQL_CLIENT_SSL in ISPConfig mysql library
1 parent 3335f3c commit c84a6d5

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

install/tpl/config.inc.php.master

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ $conf['db_database'] = '{mysql_server_database}';
6767
$conf['db_user'] = '{mysql_server_ispconfig_user}';
6868
$conf['db_password'] = '{mysql_server_ispconfig_password}';
6969
$conf['db_charset'] = 'utf8'; // same charset as html-charset - (HTML --> MYSQL: "utf-8" --> "utf8", "iso-8859-1" --> "latin1")
70+
$conf['db_new_link'] = false;
71+
$conf['db_client_flags'] = 0;
7072

7173
define('DB_TYPE',$conf['db_type']);
7274
define('DB_HOST',$conf['db_host']);
@@ -82,6 +84,8 @@ $conf['dbmaster_host'] = '{mysql_master_server_host}';
8284
$conf['dbmaster_database'] = '{mysql_master_server_database}';
8385
$conf['dbmaster_user'] = '{mysql_master_server_ispconfig_user}';
8486
$conf['dbmaster_password'] = '{mysql_master_server_ispconfig_password}';
87+
$conf['dbmaster_new_link'] = false;
88+
$conf['dbmaster_client_flags'] = 0;
8589

8690

8791
//** Paths

interface/lib/classes/db_mysql.inc.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class db {
3333
private $dbUser = ''; // database authorized user
3434
private $dbPass = ''; // user's password
3535
private $dbCharset = ''; // what charset comes and goes to mysql: utf8 / latin1
36+
private $dbNewLink = false; // Return a new linkID when connect is called again
37+
private $dbClientFlags = 0; // MySQL Client falgs
3638
private $linkId = 0; // last result of mysql_connect()
3739
private $queryId = 0; // last result of mysql_query()
3840
private $record = array(); // last record fetched
@@ -51,6 +53,8 @@ public function __construct()
5153
$this->dbUser = $conf['db_user'];
5254
$this->dbPass = $conf['db_password'];
5355
$this->dbCharset = $conf['db_charset'];
56+
$this->dbNewLink = $conf['db_new_link'];
57+
$this->dbClientFlags = $conf['db_client_flags'];
5458
//$this->connect();
5559
}
5660

@@ -69,7 +73,7 @@ public function updateError($location)
6973
public function connect()
7074
{
7175
if($this->linkId == 0){
72-
$this->linkId = mysql_connect($this->dbHost, $this->dbUser, $this->dbPass);
76+
$this->linkId = mysql_connect($this->dbHost, $this->dbUser, $this->dbPass, $this->dbNewLink, $this->dbClientFlags);
7377
if(!$this->linkId){
7478
$this->updateError('DB::connect()<br />mysql_connect');
7579
return false;

interface/lib/config.inc.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@
5454
$conf['db_user'] = 'root';
5555
$conf['db_password'] = '';
5656
$conf['db_charset'] = 'utf8'; // same charset as html-charset - (HTML --> MYSQL: "utf-8" --> "utf8", "iso-8859-1" --> "latin1")
57+
$conf['db_new_link'] = false;
58+
$conf['db_client_flags'] = 0;
5759

5860
define('DB_TYPE',$conf['db_type']);
5961
define('DB_HOST',$conf['db_host']);
@@ -69,6 +71,8 @@
6971
$conf['dbmaster_database'] = '{mysql_master_server_database}';
7072
$conf['dbmaster_user'] = '{mysql_master_server_ispconfig_user}';
7173
$conf['dbmaster_password'] = '{mysql_master_server_ispconfig_password}';
74+
$conf['dbmaster_new_link'] = false;
75+
$conf['dbmaster_client_flags'] = 0;
7276

7377

7478
//** Paths

server/lib/classes/db_mysql.inc.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ class db
3434
var $dbUser = ''; // database authorized user
3535
var $dbPass = ''; // user's password
3636
var $dbCharset = 'utf8';// Database charset
37+
var $dbNewLink = false; // Return a new linkID when connect is called again
38+
var $dbClientFlags = 0; // MySQL Client falgs
3739
var $linkId = 0; // last result of mysql_connect()
3840
var $queryId = 0; // last result of mysql_query()
3941
var $record = array(); // last record fetched
@@ -53,6 +55,8 @@ public function __construct() {
5355
$this->dbUser = $conf['db_user'];
5456
$this->dbPass = $conf['db_password'];
5557
$this->dbCharset = $conf['db_charset'];
58+
$this->dbNewLink = $conf['db_new_link'];
59+
$this->dbClientFlags = $conf['db_client_flags'];
5660
//$this->connect();
5761
}
5862

@@ -79,7 +83,7 @@ function connect()
7983
{
8084
if($this->linkId == 0)
8185
{
82-
$this->linkId = @mysql_connect($this->dbHost, $this->dbUser, $this->dbPass);
86+
$this->linkId = @mysql_connect($this->dbHost, $this->dbUser, $this->dbPass, $this->dbNewLink, $this->dbClientFlags);
8387
if(!$this->linkId)
8488
{
8589
$this->updateError('DB::connect()-> mysql_connect');

0 commit comments

Comments
 (0)