File tree Expand file tree Collapse file tree
src/app/CliTools/Console/Command/Sync Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,13 +159,18 @@ protected function initializeConfiguration()
159159 protected function initDatabaseConfiguration ()
160160 {
161161 $ hostname = DatabaseConnection::getDbHostname ();
162+ $ port = DatabaseConnection::getDbPort ();
162163 $ username = DatabaseConnection::getDbUsername ();
163164 $ password = DatabaseConnection::getDbPassword ();
164165
165166 if ($ this ->config ->exists ('LOCAL.mysql.hostname ' )) {
166167 $ hostname = $ this ->config ->get ('LOCAL.mysql.hostname ' );
167168 }
168169
170+ if ($ this ->config ->exists ('LOCAL.mysql.port ' )) {
171+ $ port = $ this ->config ->get ('LOCAL.mysql.port ' );
172+ }
173+
169174 if ($ this ->config ->exists ('LOCAL.mysql.username ' )) {
170175 $ username = $ this ->config ->get ('LOCAL.mysql.username ' );
171176 }
@@ -174,7 +179,9 @@ protected function initDatabaseConfiguration()
174179 $ password = $ this ->config ->get ('LOCAL.mysql.password ' );
175180 }
176181
177- DatabaseConnection::setDsn ('mysql:host= ' . $ hostname , $ username , $ password );
182+ $ dsn = 'mysql:host= ' . urlencode ($ hostname ) . ';port= ' . (int )$ port ;
183+
184+ DatabaseConnection::setDsn ($ dsn , $ username , $ password );
178185 }
179186
180187 /**
You can’t perform that action at this time.
0 commit comments