summaryrefslogtreecommitdiffstats
path: root/lib/migration/provider.php
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-03-19 20:44:20 +0000
committerTom Needham <needham.thomas@gmail.com>2012-03-19 20:44:20 +0000
commit145d6f35660669397eaee08988ffbad1b65daff0 (patch)
tree2aa52588ebc1e4cc1b211cc147febccf1b85e88b /lib/migration/provider.php
parent77f6872ea4859e13637efbc6d051072a5085394f (diff)
downloadnextcloud-server-145d6f35660669397eaee08988ffbad1b65daff0.tar.gz
nextcloud-server-145d6f35660669397eaee08988ffbad1b65daff0.zip
Add OC_Migration_Content class to help app devs. Restructure OC_Migrate.
Diffstat (limited to 'lib/migration/provider.php')
-rw-r--r--lib/migration/provider.php49
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/migration/provider.php b/lib/migration/provider.php
new file mode 100644
index 00000000000..b9e2c476203
--- /dev/null
+++ b/lib/migration/provider.php
@@ -0,0 +1,49 @@
+<?php
+/**
+ * provides search functionalty
+ */
+abstract class OC_Migration_Provider{
+
+ protected $id=false;
+ protected $content=false;
+ protected $uid=false;
+ protected $info=false;
+ protected $appinfo=false;
+
+ public function __construct( $appid ){
+ // Set the id
+ $this->id = $appid;
+ OC_Migrate::registerProvider( $this );
+ }
+
+ /**
+ * @breif exports data for apps
+ * @return array appdata to be exported
+ */
+ abstract function export( );
+
+ /**
+ * @breif imports data for the app
+ * @return void
+ */
+ abstract function import( );
+
+ /**
+ * @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 ){
+ $this->content = $content;
+ $this->uid = $uid;
+ $this->info = $info;
+ $this->appinfo = $appinfo;
+ }
+
+ /**
+ * @breif returns the appid of the provider
+ * @return string
+ */
+ public function getID(){
+ return $this->id;
+ }
+}