Merge pull request #1401 from sagarsneh/master
Port number added to database connection
This commit is contained in:
commit
87ab5b1fe2
|
|
@ -141,7 +141,7 @@ Although, mailer environment variables are also required to be set up as **Bagis
|
|||
|
||||
##### On server:
|
||||
|
||||
Warning: Before going full on production mode we recommend you to install developer dependencies.
|
||||
Warning: Before going full on production mode we recommend you to uninstall developer dependencies.
|
||||
In order to do that, run the command below:
|
||||
|
||||
> composer install --no-dev
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ $data = array();
|
|||
|
||||
// reading env content
|
||||
$data = file($envFile);
|
||||
$databaseArray = ['DB_HOST', 'DB_DATABASE', 'DB_USERNAME', 'DB_PASSWORD', 'DB_CONNECTION'];
|
||||
$databaseArray = ['DB_HOST', 'DB_DATABASE', 'DB_USERNAME', 'DB_PASSWORD', 'DB_CONNECTION', 'DB_PORT'];
|
||||
$key = $value = [];
|
||||
|
||||
if ($data) {
|
||||
|
|
@ -67,10 +67,11 @@ $data = array();
|
|||
$password = $databaseData['DB_PASSWORD'];
|
||||
$dbname = $databaseData['DB_DATABASE'];
|
||||
$connection = $databaseData['DB_CONNECTION'];
|
||||
$port = $databaseData['DB_PORT'];
|
||||
|
||||
if ($connection == 'mysql' ) {
|
||||
// Create connection
|
||||
@$conn = new mysqli($servername, $username, $password, $dbname);
|
||||
@$conn = new mysqli($servername, $username, $password, $dbname, (int)$port);
|
||||
|
||||
// check connection
|
||||
if ($conn->connect_error) {
|
||||
|
|
|
|||
|
|
@ -117,8 +117,8 @@ $data = array();
|
|||
// checking database connection(mysql only)
|
||||
if ($_POST["database_connection"] == 'mysql') {
|
||||
// Create connection
|
||||
@$conn = new mysqli($_POST["host_name"], $_POST["user_name"], $_POST["user_password"], $_POST["database_name"]);
|
||||
|
||||
@$conn = new mysqli($_POST["host_name"], $_POST["user_name"], $_POST["user_password"], $_POST["database_name"], $_POST['port_name']);
|
||||
|
||||
// check connection
|
||||
if ($conn->connect_error) {
|
||||
$errors['database_error'] = $conn->connect_error;
|
||||
|
|
|
|||
Loading…
Reference in New Issue