summaryrefslogtreecommitdiffstats
path: root/apps/contacts/appinfo/migrate.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/contacts/appinfo/migrate.php')
-rw-r--r--apps/contacts/appinfo/migrate.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/apps/contacts/appinfo/migrate.php b/apps/contacts/appinfo/migrate.php
index 02026c5979c..2559b4ea456 100644
--- a/apps/contacts/appinfo/migrate.php
+++ b/apps/contacts/appinfo/migrate.php
@@ -2,7 +2,7 @@
class OC_Migration_Provider_Contacts extends OC_Migration_Provider{
// Create the xml for the user supplied
- function export( ){
+ function export( ) {
$options = array(
'table'=>'contacts_addressbooks',
'matchcol'=>'userid',
@@ -21,9 +21,8 @@ class OC_Migration_Provider_Contacts extends OC_Migration_Provider{
$ids2 = $this->content->copyRows( $options );
// If both returned some ids then they worked
- if( is_array( $ids ) && is_array( $ids2 ) )
- {
- return true;
+ if(is_array($ids) && is_array($ids2)) {
+ return true;
} else {
return false;
}
@@ -31,14 +30,14 @@ class OC_Migration_Provider_Contacts extends OC_Migration_Provider{
}
// Import function for contacts
- function import( ){
- switch( $this->appinfo->version ){
+ function import( ) {
+ switch( $this->appinfo->version ) {
default:
// All versions of the app have had the same db structure, so all can use the same import function
$query = $this->content->prepare( "SELECT * FROM contacts_addressbooks WHERE userid LIKE ?" );
$results = $query->execute( array( $this->olduid ) );
$idmap = array();
- while( $row = $results->fetchRow() ){
+ while( $row = $results->fetchRow() ) {
// Import each addressbook
$addressbookquery = OCP\DB::prepare( "INSERT INTO *PREFIX*contacts_addressbooks (`userid`, `displayname`, `uri`, `description`, `ctag`) VALUES (?, ?, ?, ?, ?)" );
$addressbookquery->execute( array( $this->uid, $row['displayname'], $row['uri'], $row['description'], $row['ctag'] ) );
@@ -48,7 +47,7 @@ class OC_Migration_Provider_Contacts extends OC_Migration_Provider{
OC_Contacts_Addressbook::setActive($idmap[$row['id']], true);
}
// Now tags
- foreach($idmap as $oldid => $newid){
+ foreach($idmap as $oldid => $newid) {
$query = $this->content->prepare( "SELECT * FROM contacts_cards WHERE addressbookid LIKE ?" );
$results = $query->execute( array( $oldid ) );