Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
8cbfefe0
Commit
8cbfefe0
authored
Jul 08, 2014
by
Marco Pivetta
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #629 from mikeSimonson/patch-1
Allow to connect without a dbname param
parents
5eb36c7a
387eb545
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
MysqliConnection.php
lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php
+2
-1
No files found.
lib/Doctrine/DBAL/Driver/Mysqli/MysqliConnection.php
View file @
8cbfefe0
...
@@ -51,6 +51,7 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
...
@@ -51,6 +51,7 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
{
{
$port
=
isset
(
$params
[
'port'
])
?
$params
[
'port'
]
:
ini_get
(
'mysqli.default_port'
);
$port
=
isset
(
$params
[
'port'
])
?
$params
[
'port'
]
:
ini_get
(
'mysqli.default_port'
);
$socket
=
isset
(
$params
[
'unix_socket'
])
?
$params
[
'unix_socket'
]
:
ini_get
(
'mysqli.default_socket'
);
$socket
=
isset
(
$params
[
'unix_socket'
])
?
$params
[
'unix_socket'
]
:
ini_get
(
'mysqli.default_socket'
);
$dbname
=
isset
(
$params
[
'dbname'
])
?
$params
[
'dbname'
]
:
null
;
$flags
=
isset
(
$driverOptions
[
static
::
OPTION_FLAGS
])
?
$driverOptions
[
static
::
OPTION_FLAGS
]
:
null
;
$flags
=
isset
(
$driverOptions
[
static
::
OPTION_FLAGS
])
?
$driverOptions
[
static
::
OPTION_FLAGS
]
:
null
;
...
@@ -61,7 +62,7 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
...
@@ -61,7 +62,7 @@ class MysqliConnection implements Connection, PingableConnection, ServerInfoAwar
$previousHandler
=
set_error_handler
(
function
()
{
$previousHandler
=
set_error_handler
(
function
()
{
});
});
if
(
!
$this
->
_conn
->
real_connect
(
$params
[
'host'
],
$username
,
$password
,
$
params
[
'dbname'
]
,
$port
,
$socket
,
$flags
))
{
if
(
!
$this
->
_conn
->
real_connect
(
$params
[
'host'
],
$username
,
$password
,
$
dbname
,
$port
,
$socket
,
$flags
))
{
set_error_handler
(
$previousHandler
);
set_error_handler
(
$previousHandler
);
$sqlState
=
'HY000'
;
$sqlState
=
'HY000'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment