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
ffbd72bb
Commit
ffbd72bb
authored
13 years ago
by
Tom Needham
Browse files
Options
Downloads
Patches
Plain Diff
Fix user app data export
parent
a248cc73
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/migration/content.php
+7
-3
7 additions, 3 deletions
lib/migration/content.php
with
7 additions
and
3 deletions
lib/migration/content.php
+
7
−
3
View file @
ffbd72bb
...
...
@@ -47,7 +47,6 @@ class OC_Migration_Content{
// Get db path
$db
=
$this
->
db
->
getDatabase
();
$this
->
tmpfiles
[]
=
$db
;
OC_Log
::
write
(
'user-migrate'
,
$db
,
OC_Log
::
INFO
);
}
}
...
...
@@ -110,7 +109,8 @@ class OC_Migration_Content{
foreach
(
$options
[
'matchval'
]
as
$matchval
){
// Run the query for this match value (where x = y value)
$query
=
OC_DB
::
prepare
(
"SELECT * FROM *PREFIX*"
.
$options
[
'table'
]
.
" WHERE "
.
$options
[
'matchcol'
]
.
" LIKE ?"
);
$sql
=
"SELECT * FROM *PREFIX*"
.
$options
[
'table'
]
.
" WHERE "
.
$options
[
'matchcol'
]
.
" LIKE ?"
;
$query
=
OC_DB
::
prepare
(
$sql
);
$results
=
$query
->
execute
(
array
(
$matchval
)
);
$newreturns
=
$this
->
insertData
(
$results
,
$options
);
$return
=
array_merge
(
$return
,
$newreturns
);
...
...
@@ -118,7 +118,8 @@ class OC_Migration_Content{
}
else
{
// Just get everything
$query
=
OC_DB
::
prepare
(
"SELECT * FROM *PREFIX*"
.
$options
[
'table'
]
);
$sql
=
"SELECT * FROM *PREFIX*"
.
$options
[
'table'
];
$query
=
OC_DB
::
prepare
(
$sql
);
$results
=
$query
->
execute
();
$return
=
$this
->
insertData
(
$results
,
$options
);
...
...
@@ -136,6 +137,7 @@ class OC_Migration_Content{
*/
private
function
insertData
(
$data
,
$options
){
$return
=
array
();
// Foreach row of data to insert
while
(
$row
=
$data
->
fetchRow
()
){
// Now save all this to the migration.db
foreach
(
$row
as
$field
=>
$value
){
...
...
@@ -166,6 +168,8 @@ class OC_Migration_Content{
$return
[]
=
reset
(
$row
);
}
}
$fields
=
''
;
$values
=
''
;
}
return
$return
;
}
...
...
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