2012-03-20 00:44:20 +04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* provides search functionalty
|
|
|
|
*/
|
|
|
|
abstract class OC_Migration_Provider{
|
2012-08-29 10:38:33 +04:00
|
|
|
|
2012-03-20 00:44:20 +04:00
|
|
|
protected $id=false;
|
2012-08-29 10:38:33 +04:00
|
|
|
protected $content=false;
|
2012-03-20 00:44:20 +04:00
|
|
|
protected $uid=false;
|
2012-03-21 00:19:21 +04:00
|
|
|
protected $olduid=false;
|
2012-03-20 00:44:20 +04:00
|
|
|
protected $appinfo=false;
|
2012-08-29 10:38:33 +04:00
|
|
|
|
2012-09-07 17:22:01 +04:00
|
|
|
public function __construct( $appid ) {
|
2012-03-20 00:44:20 +04:00
|
|
|
// Set the id
|
|
|
|
$this->id = $appid;
|
|
|
|
OC_Migrate::registerProvider( $this );
|
|
|
|
}
|
2012-08-29 10:38:33 +04:00
|
|
|
|
2012-03-20 00:44:20 +04:00
|
|
|
/**
|
2014-05-19 19:50:53 +04:00
|
|
|
* exports data for apps
|
2012-03-20 00:44:20 +04:00
|
|
|
* @return array appdata to be exported
|
|
|
|
*/
|
|
|
|
abstract function export( );
|
2012-08-29 10:38:33 +04:00
|
|
|
|
2012-03-20 00:44:20 +04:00
|
|
|
/**
|
2014-05-19 19:50:53 +04:00
|
|
|
* imports data for the app
|
2012-03-20 00:44:20 +04:00
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
abstract function import( );
|
2012-08-29 10:38:33 +04:00
|
|
|
|
2012-03-20 00:44:20 +04:00
|
|
|
/**
|
2014-05-19 19:50:53 +04:00
|
|
|
* sets the OC_Migration_Content object to $this->content
|
2014-02-19 12:31:54 +04:00
|
|
|
* @param OC_Migration_Content $content a OC_Migration_Content object
|
2012-03-20 00:44:20 +04:00
|
|
|
*/
|
2012-09-07 17:22:01 +04:00
|
|
|
public function setData( $uid, $content, $info=null ) {
|
2012-08-29 10:38:33 +04:00
|
|
|
$this->content = $content;
|
2012-03-20 00:44:20 +04:00
|
|
|
$this->uid = $uid;
|
2012-03-28 01:21:14 +04:00
|
|
|
$id = $this->id;
|
2012-09-07 17:22:01 +04:00
|
|
|
if( !is_null( $info ) ) {
|
2012-03-28 00:43:44 +04:00
|
|
|
$this->olduid = $info->exporteduser;
|
|
|
|
$this->appinfo = $info->apps->$id;
|
|
|
|
}
|
2012-03-20 00:44:20 +04:00
|
|
|
}
|
2012-08-29 10:38:33 +04:00
|
|
|
|
2012-03-20 00:44:20 +04:00
|
|
|
/**
|
2014-05-19 19:50:53 +04:00
|
|
|
* returns the appid of the provider
|
2012-03-20 00:44:20 +04:00
|
|
|
* @return string
|
|
|
|
*/
|
2012-09-07 17:22:01 +04:00
|
|
|
public function getID() {
|
2012-08-29 10:38:33 +04:00
|
|
|
return $this->id;
|
2012-03-20 00:44:20 +04:00
|
|
|
}
|
|
|
|
}
|