Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Yeray Santana Hualde
syncEnrollments
Commits
faa42874
Commit
faa42874
authored
Jul 22, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for generic PDO connections.
parent
e0a8d173
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
connector.php
system/db/connector.php
+5
-5
No files found.
system/db/connector.php
View file @
faa42874
...
@@ -35,8 +35,8 @@ class Connector {
...
@@ -35,8 +35,8 @@ class Connector {
case
'pgsql'
:
case
'pgsql'
:
return
static
::
connect_to_server
(
$config
);
return
static
::
connect_to_server
(
$config
);
case
'odbc'
:
default
:
return
static
::
connect_to_
odb
c
(
$config
);
return
static
::
connect_to_
generi
c
(
$config
);
}
}
throw
new
\Exception
(
'Database driver '
.
$config
->
driver
.
' is not supported.'
);
throw
new
\Exception
(
'Database driver '
.
$config
->
driver
.
' is not supported.'
);
...
@@ -93,14 +93,14 @@ class Connector {
...
@@ -93,14 +93,14 @@ class Connector {
}
}
/**
/**
* Connect to a
n ODBC
data source.
* Connect to a
generic
data source.
*
*
* @param object $config
* @param object $config
* @return PDO
* @return PDO
*/
*/
private
static
function
connect_to_
odb
c
(
$config
)
private
static
function
connect_to_
generi
c
(
$config
)
{
{
return
new
\PDO
(
$config
->
dsn
,
$config
->
username
,
$config
->
password
,
static
::
$options
);
return
new
\PDO
(
$config
->
d
river
.
':'
.
$config
->
d
sn
,
$config
->
username
,
$config
->
password
,
static
::
$options
);
}
}
/**
/**
...
...
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