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
7a5cda86
Commit
7a5cda86
authored
Nov 19, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added getServerVersion to pgsql driver
parent
231be655
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
Pgsql.php
lib/Doctrine/Connection/Pgsql.php
+36
-0
No files found.
lib/Doctrine/Connection/Pgsql.php
View file @
7a5cda86
...
...
@@ -137,4 +137,40 @@ class Doctrine_Connection_Pgsql extends Doctrine_Connection_Common {
}
return
$query
;
}
/**
* return version information about the server
*
* @param string $native determines if the raw version string should be returned
* @return array|string an array or string with version information
*/
public
function
getServerVersion
(
$native
=
false
)
{
$query
=
'SHOW SERVER_VERSION'
;
$serverInfo
=
$this
->
fetchOne
(
$query
);
if
(
!
$native
)
{
$tmp
=
explode
(
'.'
,
$server_info
,
3
);
if
(
empty
(
$tmp
[
2
])
&&
isset
(
$tmp
[
1
])
&&
preg_match
(
'/(\d+)(.*)/'
,
$tmp
[
1
],
$tmp2
))
{
$serverInfo
=
array
(
'major'
=>
$tmp
[
0
],
'minor'
=>
$tmp2
[
1
],
'patch'
=>
null
,
'extra'
=>
$tmp2
[
2
],
'native'
=>
$serverInfo
,
);
}
else
{
$serverInfo
=
array
(
'major'
=>
isset
(
$tmp
[
0
])
?
$tmp
[
0
]
:
null
,
'minor'
=>
isset
(
$tmp
[
1
])
?
$tmp
[
1
]
:
null
,
'patch'
=>
isset
(
$tmp
[
2
])
?
$tmp
[
2
]
:
null
,
'extra'
=>
null
,
'native'
=>
$serverInfo
,
);
}
}
return
$serverInfo
;
}
}
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