2012-03-20 00:44:20 +04:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* provides search functionalty
|
|
|
|
*/
|
|
|
|
abstract class OC_Migration_Provider{
|
|
|
|
|
|
|
|
protected $id=false;
|
|
|
|
protected $content=false;
|
|
|
|
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;
|
|
|
|
|
|
|
|
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
|
|
|
|
*/
|
2012-03-28 00:43:44 +04:00
|
|
|
public function setData( $uid, $content, $info=null ){
|
2012-03-20 00:44:20 +04:00
|
|
|
$this->content = $content;
|
|
|
|
$this->uid = $uid;
|
2012-03-28 01:21:14 +04:00
|
|
|
$id = $this->id;
|
2012-03-28 00:43:44 +04:00
|
|
|
if( !is_null( $info ) ){
|
|
|
|
$this->olduid = $info->exporteduser;
|
|
|
|
$this->appinfo = $info->apps->$id;
|
|
|
|
}
|
2012-03-20 00:44:20 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @breif returns the appid of the provider
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getID(){
|
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
}
|