Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
034cf191
Commit
034cf191
authored
13 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
allow changing database backends between PDO and MDB2
parent
010bfa11
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/db.php
+19
-4
19 additions, 4 deletions
lib/db.php
with
19 additions
and
4 deletions
lib/db.php
+
19
−
4
View file @
034cf191
...
...
@@ -71,7 +71,14 @@ class OC_DB {
/**
* connect to the database using pdo
*/
private
static
function
connectPDO
(){
public
static
function
connectPDO
(){
if
(
self
::
$connection
){
if
(
self
::
$backend
==
self
::
BACKEND_MDB2
){
self
::
disconnect
();
}
else
{
return
;
}
}
// The global data we need
$name
=
OC_Config
::
getValue
(
"dbname"
,
"owncloud"
);
$host
=
OC_Config
::
getValue
(
"dbhost"
,
""
);
...
...
@@ -113,7 +120,14 @@ class OC_DB {
/**
* connect to the database using mdb2
*/
static
private
function
connectMDB2
(){
public
static
function
connectMDB2
(){
if
(
self
::
$connection
){
if
(
self
::
$backend
==
self
::
BACKEND_PDO
){
self
::
disconnect
();
}
else
{
return
;
}
}
// The global data we need
$name
=
OC_Config
::
getValue
(
"dbname"
,
"owncloud"
);
$host
=
OC_Config
::
getValue
(
"dbhost"
,
""
);
...
...
@@ -255,8 +269,8 @@ class OC_DB {
self
::
$connection
->
disconnect
();
}
self
::
$connection
=
false
;
self
::
$
mdb
2
=
false
;
self
::
$
pdo
=
false
;
self
::
$
MDB
2
=
false
;
self
::
$
PDO
=
false
;
}
return
true
;
...
...
@@ -374,6 +388,7 @@ class OC_DB {
private
static
function
connectScheme
(){
// We need a mdb2 database connection
self
::
connectMDB2
();
self
::
$MDB2
->
loadModule
(
'Manager'
);
// Connect if this did not happen before
if
(
!
self
::
$schema
){
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment