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
cdddf751
Commit
cdddf751
authored
Jan 25, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added contains
parent
b23a69c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
5 deletions
+21
-5
Manager.php
lib/Doctrine/Manager.php
+21
-5
No files found.
lib/Doctrine/Manager.php
View file @
cdddf751
...
...
@@ -57,7 +57,14 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
* @var Doctrine_Null $null Doctrine_Null object, used for extremely fast null value checking
*/
private
$null
;
/**
* @var array $driverMap
*/
private
$driverMap
=
array
(
'oracle'
=>
'oci8'
,
'postgres'
=>
'pgsql'
,
'oci'
=>
'oci8'
,
'sqlite2'
=>
'sqlite'
,
'sqlite3'
=>
'sqlite'
);
/**
* constructor
*
...
...
@@ -171,6 +178,7 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
* @param PDO|Doctrine_Adapter_Interface $adapter database driver
* @param string $name name of the connection, if empty numeric key is used
* @throws Doctrine_Manager_Exception if trying to bind a connection with an existing name
* @throws Doctrine_Manager_Exception if trying to open connection for unknown driver
* @return Doctrine_Connection
*/
public
function
openConnection
(
$adapter
,
$name
=
null
,
$setCurrent
=
true
)
...
...
@@ -191,6 +199,7 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
$name
=
$this
->
index
;
$this
->
index
++
;
}
switch
(
$adapter
->
getAttribute
(
PDO
::
ATTR_DRIVER_NAME
))
{
case
'mysql'
:
$this
->
connections
[
$name
]
=
new
Doctrine_Connection_Mysql
(
$this
,
$adapter
);
...
...
@@ -226,10 +235,6 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
}
return
$this
->
connections
[
$name
];
}
public
function
openSession
(
PDO
$pdo
,
$name
=
null
)
{
return
$this
->
openConnection
(
$pdo
,
$name
);
}
/**
* getConnection
* @param integer $index
...
...
@@ -321,6 +326,17 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
}
$this
->
currIndex
=
$key
;
}
/**
* contains
* whether or not the manager contains specified connection
*
* @param mixed $key the connection key
* @return boolean
*/
public
function
contains
(
$key
)
{
return
isset
(
$this
->
connections
[
$key
]);
}
/**
* count
* returns the number of opened connections
...
...
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