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
653c4df3
Commit
653c4df3
authored
Nov 14, 2013
by
Steve Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make driver method for constructing the DSN private
parent
4ab3010e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
33 deletions
+33
-33
Driver.php
lib/Doctrine/DBAL/Driver/SQLAnywhere/Driver.php
+33
-33
No files found.
lib/Doctrine/DBAL/Driver/SQLAnywhere/Driver.php
View file @
653c4df3
...
@@ -33,39 +33,6 @@ use Doctrine\DBAL\Schema\SQLAnywhereSchemaManager;
...
@@ -33,39 +33,6 @@ use Doctrine\DBAL\Schema\SQLAnywhereSchemaManager;
*/
*/
class
Driver
implements
\Doctrine\DBAL\Driver
class
Driver
implements
\Doctrine\DBAL\Driver
{
{
/**
* Build the connection string for given connection parameters and driver options.
*
* @param string $host Host address to connect to.
* @param integer $port Port to use for the connection (default to SQL Anywhere standard port 2683).
* @param string $server Database server name on the host to connect to.
* SQL Anywhere allows multiple database server instances on the same host,
* therefore specifying the server instance name to use is mandatory.
* @param string $dbname Name of the database on the server instance to connect to.
* @param string $username User name to use for connection authentication.
* @param string $password Password to use for connection authentication.
* @param array $driverOptions Additional parameters to use for the connection.
*
* @return string
*/
public
function
buildDsn
(
$host
,
$port
,
$server
,
$dbname
,
$username
=
null
,
$password
=
null
,
array
$driverOptions
=
array
())
{
$port
=
$port
?:
2683
;
return
'LINKS=tcpip(HOST='
.
$host
.
';PORT='
.
$port
.
';DoBroadcast=Direct)'
.
';ServerName='
.
$server
.
';DBN='
.
$dbname
.
';UID='
.
$username
.
';PWD='
.
$password
.
';'
.
implode
(
';'
,
array_map
(
function
(
$key
,
$value
)
{
return
$key
.
'='
.
$value
;
},
array_keys
(
$driverOptions
),
$driverOptions
)
);
}
/**
/**
* {@inheritdoc}
* {@inheritdoc}
*
*
...
@@ -166,4 +133,37 @@ class Driver implements \Doctrine\DBAL\Driver
...
@@ -166,4 +133,37 @@ class Driver implements \Doctrine\DBAL\Driver
{
{
return
new
SQLAnywhereSchemaManager
(
$conn
);
return
new
SQLAnywhereSchemaManager
(
$conn
);
}
}
/**
* Build the connection string for given connection parameters and driver options.
*
* @param string $host Host address to connect to.
* @param integer $port Port to use for the connection (default to SQL Anywhere standard port 2683).
* @param string $server Database server name on the host to connect to.
* SQL Anywhere allows multiple database server instances on the same host,
* therefore specifying the server instance name to use is mandatory.
* @param string $dbname Name of the database on the server instance to connect to.
* @param string $username User name to use for connection authentication.
* @param string $password Password to use for connection authentication.
* @param array $driverOptions Additional parameters to use for the connection.
*
* @return string
*/
private
function
buildDsn
(
$host
,
$port
,
$server
,
$dbname
,
$username
=
null
,
$password
=
null
,
array
$driverOptions
=
array
())
{
$port
=
$port
?:
2683
;
return
'LINKS=tcpip(HOST='
.
$host
.
';PORT='
.
$port
.
';DoBroadcast=Direct)'
.
';ServerName='
.
$server
.
';DBN='
.
$dbname
.
';UID='
.
$username
.
';PWD='
.
$password
.
';'
.
implode
(
';'
,
array_map
(
function
(
$key
,
$value
)
{
return
$key
.
'='
.
$value
;
},
array_keys
(
$driverOptions
),
$driverOptions
)
);
}
}
}
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