summaryrefslogtreecommitdiffstats
path: root/lib/migration
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-03-20 20:19:21 +0000
committerTom Needham <needham.thomas@gmail.com>2012-03-20 20:19:21 +0000
commit514c9ad8e7df1d7882adc33c42eb32a209537273 (patch)
treef39dae7822c3b7ddf678861a41a0ceea93e267f2 /lib/migration
parent145d6f35660669397eaee08988ffbad1b65daff0 (diff)
downloadnextcloud-server-514c9ad8e7df1d7882adc33c42eb32a209537273.tar.gz
nextcloud-server-514c9ad8e7df1d7882adc33c42eb32a209537273.zip
Added unified import method.
Diffstat (limited to 'lib/migration')
-rw-r--r--lib/migration/content.php6
-rw-r--r--lib/migration/provider.php10
2 files changed, 10 insertions, 6 deletions
diff --git a/lib/migration/content.php b/lib/migration/content.php
index fe8a21a45b4..d25b5af293c 100644
--- a/lib/migration/content.php
+++ b/lib/migration/content.php
@@ -53,7 +53,7 @@ class OC_Migration_Content{
$query = $this->processQuery( $query );
// Optimize the query
- $query = $this->MDB2->prepare( $query );
+ $query = $this->db->prepare( $query );
// Die if we have an error (error means: bad query, not 0 results!)
if( PEAR::isError( $query ) ) {
@@ -174,7 +174,9 @@ class OC_Migration_Content{
$dirname = basename($dir);
$this->zip->addEmptyDir($internaldir . $dirname);
$internaldir.=$dirname.='/';
-
+ if( !file_exists( $dir ) ){
+ return false;
+ }
if ($dirhandle = opendir($dir)) {
while (false !== ( $file = readdir($dirhandle))) {
diff --git a/lib/migration/provider.php b/lib/migration/provider.php
index b9e2c476203..d592ed67264 100644
--- a/lib/migration/provider.php
+++ b/lib/migration/provider.php
@@ -7,7 +7,7 @@ abstract class OC_Migration_Provider{
protected $id=false;
protected $content=false;
protected $uid=false;
- protected $info=false;
+ protected $olduid=false;
protected $appinfo=false;
public function __construct( $appid ){
@@ -32,11 +32,13 @@ abstract class OC_Migration_Provider{
* @breif sets the OC_Migration_Content object to $this->content
* @param $content a OC_Migration_Content object
*/
- public function setData( $uid, $content, $info=false, $appinfo=false ){
+ public function setData( $uid, $content, $info=false ){
$this->content = $content;
$this->uid = $uid;
- $this->info = $info;
- $this->appinfo = $appinfo;
+ $this->olduid = $info->exporteduser;
+ $id = $this->id;
+ $this->appinfo = $info->apps->$id;
+
}
/**