Removed default mysql port settings from files and left empty values (#403)

This commit is contained in:
Tom Hatzer 2018-08-09 19:16:20 +02:00 committed by Tim
parent 5e61d89b7f
commit 1f2dde3963
6 changed files with 12 additions and 11 deletions

View File

@ -4,5 +4,5 @@ define('PSM_DB_USER', 'db_user');
define('PSM_DB_PASS', 'db_pass');
define('PSM_DB_NAME', 'db_name');
define('PSM_DB_HOST', 'localhost');
define('PSM_DB_PORT', '3306');
define('PSM_BASE_URL', '');
define('PSM_DB_PORT', '3306'); //3306 is the default port for MySQL. If no specfic port is used, leave it empty.
define('PSM_BASE_URL', '');

View File

@ -27,7 +27,7 @@ To change these values correctly, only update the second parameter of the functi
define('PSM_DB_NAME', 'db_name');
define('PSM_DB_USER', 'db_user');
define('PSM_DB_PASS', 'db_user_password');
define('PSM_DB_PORT', '3306');
define('PSM_DB_PORT', 'most likely 3306, may also be empty');
For example: to change your username you should ONLY change the 'db\_user' part.
Do NOT remove the quotes around your username as that will result in an error.

View File

@ -6,7 +6,7 @@ define('PSM_DB_USER', 'psm'); \
define('PSM_DB_PASS', 'psm'); \
define('PSM_DB_NAME', 'psm'); \
define('PSM_DB_HOST', 'localhost'); \
define('PSM_DB_PORT', '3306'); \
define('PSM_DB_PORT', ''); \
?>" > /var/www/default/psm/config.php
echo "<?php \

View File

@ -124,7 +124,7 @@ class InstallController extends AbstractController {
$config = array(
'db_host' => 'localhost',
'db_port' => '3306',
'db_port' => '',
'db_name' => '',
'db_user' => '',
'db_pass' => '',
@ -315,7 +315,7 @@ class InstallController extends AbstractController {
'pass' => '',
'name' => '',
'host' => '',
'port' => '3306'
'port' => ''
);
$pattern = "/define\('SM_{key}', '(.*?)'/u";

View File

@ -37,9 +37,9 @@ class Database {
/**
* DB port
* @var string $db_port
* @var string|integer $db_port
*/
protected $db_port = 3306;
protected $db_port;
/**
* DB name
@ -86,11 +86,12 @@ class Database {
* @param string $user
* @param string $pass
* @param string $db
* @param string|integer $port
*/
function __construct($host = null, $user = null, $pass = null, $db = null, $port = null) {
function __construct($host = null, $user = null, $pass = null, $db = null, $port = '') {
if ($host != null && $user != null && $pass !== null && $db != null) {
$this->db_host = $host;
$this->db_port = (!empty($port)) ? $port : 3306;
$this->db_port = $port;
$this->db_name = $db;
$this->db_user = $user;
$this->db_pass = $pass;

View File

@ -27,7 +27,7 @@
<div class="control-group">
<label class="control-label" for="host">Database port</label>
<div class="controls">
<input type="text" id="port" name="db_port" value="{{ db_port }}" />
<input type="text" id="port" name="db_port" value="{{ db_port }}" placeholder="3306 most likely, may be empty" />
</div>
</div>
<div class="control-group">