more commenting out for debugging, added logging commands

This commit is contained in:
Tom Needham 2012-02-03 21:00:12 +00:00
parent 0bbc9ade7d
commit ee88ded463
5 changed files with 18 additions and 16 deletions

View File

@ -17,3 +17,7 @@ OC_App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'hr
OC_App::registerPersonal('bookmarks', 'settings');
require_once('apps/bookmarks/lib/search.php');
OC_Util::addScript('bookmarks','bookmarksearch');
// Include the migration provider
require_once('apps/bookmarks/lib/migrate.php');

View File

@ -1,18 +1,15 @@
<?php
class OC_Migrate_Provider_Bookmarks extends OC_Migrate_Provider{
$this->appid = 'bookmarks';
// Create the xml for the user supplied
function export($uid){
$xml = '';
$query = OC_DB::prepare("SELECT * FROM *PREFIX*bookmarks WHERE *PREFIX*bookmakrs.user_id = ?");
$bookmarks = $query->execute($uid);
OC_Log::write('user_migrate',print_r($bookmarks));
foreach($bookmarks as $bookmark){
$xml .= '<bookmark>';
$xml .='DATA WILL BE HERE';
$xml .= '</bookmark>';
}
$xml = 'debugfrombookmarks';
//$query = OC_DB::prepare("SELECT * FROM *PREFIX*bookmarks WHERE *PREFIX*bookmakrs.user_id = ?");
//$bookmarks = $query->execute($uid);
//foreach($bookmarks as $bookmark){
// $xml .= '<bookmark>';
// $xml .='DATA WILL BE HERE';
// $xml .= '</bookmark>';
//}
return $xml;
}
}

View File

@ -47,7 +47,7 @@ if (isset($_POST['user_migrate'])) {
// Does the user want their app data?
if (isset($_POST['user_appdata'])) {
// adding owncloud system files
OC_Log::write('user_migrate',"Adding app data to user export",OC_Log::INFO);
OC_Log::write('user_migrate',"Adding app data to user export file",OC_Log::INFO);
// Call to OC_Migrate for the xml file.
//$appdatafile = $tempdir . "/appdata.xml";
//$fh = fopen($appdatafile, 'w');

View File

@ -25,7 +25,7 @@
* provides an interface to all search providers
*/
class OC_Migrate{
static public $providers=array();
static private $providers=array();
/**
* register a new migration provider
@ -33,6 +33,7 @@ class OC_Migrate{
*/
public static function registerProvider($provider){
self::$providers[]=$provider;
OC_Log::write('user_migrate','Provider registered',OC_Log::INFO);
}
/**
@ -46,7 +47,7 @@ class OC_Migrate{
foreach(self::$providers as $provider){
OC_Log::write('user_migrate','Getting app data for app:'.$provider->appid,OC_Log::INFO);
$xml .= '<app>';
$xml .= self::appInfoXML($provider->$appid);
//$xml .= self::appInfoXML($provider->$appid);
$xml .= $provider->export($uid);
$xml .= '</app>';
}

View File

@ -6,7 +6,7 @@ abstract class OC_Migrate_Provider{
public function __construct(){
OC_Migrate::registerProvider($this);
}
public static $appid;
//public static $appid;
/**
* exports data for apps
* @param string $uid
@ -19,5 +19,5 @@ abstract class OC_Migrate_Provider{
* @param string $query
* @return array An array of OC_Search_Result's
*/
abstract function import($data);
//abstract function import($data);
}