Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
integration
prechecker
Commits
3c1293fe
Commit
3c1293fe
authored
Jan 14, 2011
by
Petr Skoda
Browse files
MDL-25910 custom socket location for postgresql driver, improved config-dist.php info
parent
79ac5a8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
config-dist.php
View file @
3c1293fe
...
...
@@ -50,9 +50,12 @@ $CFG->dboptions = array(
// used? set to 'false' for the most stable
// setting, 'true' can improve performance
// sometimes
'dbsocket'
=>
false
,
// should connection via UNIX socket be
// used? if you set it to 'true' here,
// set dbhost to 'localhost'
'dbsocket'
=>
false
,
// should connection via UNIX socket be used?
// if you set it to 'true' or custom path
// here set dbhost to 'localhost',
// (please note mysql is always using socket
// if dbhost is 'localhost' - if you need
// local port connection use '127.0.0.1')
'dbport'
=>
''
,
// the TCP port number to use when connecting
// to the server. keep empty string for the
// default port
...
...
lib/dml/pgsql_native_moodle_database.php
View file @
3c1293fe
...
...
@@ -138,8 +138,11 @@ class pgsql_native_moodle_database extends moodle_database {
// Unix socket connections should have lower overhead
if
(
!
empty
(
$this
->
dboptions
[
'dbsocket'
])
and
(
$this
->
dbhost
===
'localhost'
or
$this
->
dbhost
===
'127.0.0.1'
))
{
$connection
=
"user='
$this->dbuser
' password='
$pass
' dbname='
$this->dbname
'"
;
if
(
strpos
(
$this
->
dboptions
[
'dbsocket'
],
'/'
)
!==
false
)
{
$connection
=
$connection
.
" host='"
.
$this
->
dboptions
[
'dbsocket'
]
.
"'"
;
}
}
else
{
$this
->
dboptions
[
'dbsocket'
]
=
0
;
$this
->
dboptions
[
'dbsocket'
]
=
''
;
if
(
empty
(
$this
->
dbname
))
{
// probably old style socket connection - do not add port
$port
=
""
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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