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
46e01370
Commit
46e01370
authored
May 07, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
6bd8eaf8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
Connection management - Managing connections.php
manual/docs/Connection management - Managing connections.php
+8
-8
No files found.
manual/docs/Connection management - Managing connections.php
View file @
46e01370
...
...
@@ -8,7 +8,7 @@ connection alias.
<
code
type
=
"php"
>
// Doctrine_Manager controls all the connections
\
$manager
=
Doctrine_Manager
::
getInstance
();
$manager
=
Doctrine_Manager
::
getInstance
();
// open first connection
...
...
@@ -25,9 +25,9 @@ connection when no arguments have been speficied.
<
code
type
=
"php"
>
// open first connection
\
$conn
=
Doctrine_Manager
::
connection
(
new
PDO
(
'dsn'
,
'username'
,
'password'
),
'connection 1'
);
$conn
=
Doctrine_Manager
::
connection
(
new
PDO
(
'dsn'
,
'username'
,
'password'
),
'connection 1'
);
\
$conn2
=
Doctrine_Manager
::
connection
();
$conn2
=
Doctrine_Manager
::
connection
();
// $conn2 == $conn
</
code
>
...
...
@@ -43,9 +43,9 @@ The current connection is the lastly opened connection.
<
code
type
=
"php"
>
// open second connection
\
$conn2
=
\
$manager
->
openConnection
(
new
PDO
(
'dsn2'
,
'username2'
,
'password2'
),
'connection 2'
);
$conn2
=
$manager
->
openConnection
(
new
PDO
(
'dsn2'
,
'username2'
,
'password2'
),
'connection 2'
);
\
$manager
->
getCurrentConnection
();
// $conn2
$manager
->
getCurrentConnection
();
// $conn2
</
code
>
...
...
@@ -55,9 +55,9 @@ You can change the current connection by calling setCurrentConnection().
<
code
type
=
"php"
>
\
$manager
->
setCurrentConnection
(
'connection 1'
);
$manager
->
setCurrentConnection
(
'connection 1'
);
\
$manager
->
getCurrentConnection
();
// $conn
$manager
->
getCurrentConnection
();
// $conn
</
code
>
...
...
@@ -71,7 +71,7 @@ special IteratorAggregate interface.
<
code
type
=
"php"
>
// iterating through connections
foreach
(
\
$manager
as
\
$conn
)
{
foreach
(
$manager
as
$conn
)
{
}
</
code
>
...
...
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