/**
* Exports users.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUsers($offset, $limit) {
// cache profile fields
/**
* Exports user options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserOptions($offset, $limit) {
$conditionBuilder = new PreparedStatementConditionBuilder();
/**
* Exports user groups.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserGroups($offset, $limit) {
$sql = "SELECT *
/**
* Exports user avatars.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserAvatars($offset, $limit) {
$sql = "SELECT *
/**
* Exports status updates.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportStatusUpdates($offset, $limit) {
$sql = "SELECT status_updates.*, members.name
/**
* Exports status replies.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportStatusReplies($offset, $limit) {
$sql = "SELECT member_status_replies.*, members.name
/**
* Exports followers.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportFollowers($offset, $limit) {
$sql = "SELECT *
/**
* Exports conversations.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversations($offset, $limit) {
$sql = "SELECT message_topics.*, members.name
/**
* Exports conversation messages.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationMessages($offset, $limit) {
$sql = "SELECT message_posts.*, members.name
/**
* Exports conversation recipients.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationUsers($offset, $limit) {
$sql = "SELECT message_topic_user_map.*, members.name
/**
* Exports conversation attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationAttachments($offset, $limit) {
$this->exportAttachments('msg', 'com.woltlab.wcf.conversation.attachment', $offset, $limit);
/**
* Exports boards.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBoards($offset, $limit) {
$sql = "SELECT *
/**
* Exports the boards recursively.
+ *
+ * @param integer $parentID
*/
protected function exportBoardsRecursively($parentID = -1) {
if (!isset($this->boardCache[$parentID])) return;
/**
* Exports threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportThreads($offset, $limit) {
// get thread ids
/**
* Exports posts.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPosts($offset, $limit) {
$sql = "SELECT *
/**
* Exports watched threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportWatchedThreads($offset, $limit) {
$sql = "SELECT *
/**
* Exports polls.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPolls($offset, $limit) {
$sql = "SELECT polls.*, topics.topic_firstpost
/**
* Exports poll option votes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptionVotes($offset, $limit) {
$sql = "SELECT polls.*, voters.*
/**
* Exports likes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportLikes($offset, $limit) {
$sql = "SELECT core_like.*, topics.topic_firstpost, topics.starter_id
/**
* Exports post attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPostAttachments($offset, $limit) {
$this->exportAttachments('post', 'com.woltlab.wbb.attachment', $offset, $limit);
}
+ /**
+ * Returns the number of attachments of the given type.
+ *
+ * @param string $type
+ * @return integer
+ */
private function countAttachments($type) {
$sql = "SELECT COUNT(*) AS count
FROM ".$this->databasePrefix."attachments
return $row['count'];
}
+ /**
+ * Exports attachments.
+ *
+ * @param string $type
+ * @param string $objectType
+ * @param integer $offset
+ * @param integer $limit
+ */
private function exportAttachments($type, $objectType, $offset, $limit) {
$sql = "SELECT *
FROM ".$this->databasePrefix."attachments
}
}
+ /**
+ * Returns the data of tags.
+ *
+ * @param string $app
+ * @param string $area
+ * @param integer[] $objectIDs
+ * @return string[][]
+ */
private function getTags($app, $area, array $objectIDs) {
$tags = [];
$conditionBuilder = new PreparedStatementConditionBuilder();
return $tags;
}
+ /**
+ * Returns message with fixed formatting as used in WCF.
+ *
+ * @param string $string
+ * @return string
+ */
private static function fixMessage($string) {
// <br /> to newline
$string = str_ireplace('<br />', "\n", $string);
return $string;
}
+ /**
+ * Returns subject with encoding as used in WCF.
+ *
+ * @param string $string
+ * @return string
+ */
private static function fixSubject($string) {
// decode html entities
$string = StringUtil::decodeHTML($string);
return $string;
}
+ /**
+ * Returns status update with encoding as used in WCF.
+ *
+ * @param string $string
+ * @return string
+ */
private static function fixStatusUpdate($string) {
// <br /> to newline
$string = str_ireplace('<br />', "\n", $string);
/**
* Exports users.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUsers($offset, $limit) {
// cache profile fields
/**
* Exports user options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserOptions($offset, $limit) {
$sql = "SELECT *
/**
* Exports user groups.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserGroups($offset, $limit) {
$sql = "SELECT *
/**
* Exports user avatars.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserAvatars($offset, $limit) {
$sql = "SELECT *
/**
* Exports status updates.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportStatusUpdates($offset, $limit) {
$sql = "SELECT status_updates.*, members.name
/**
* Exports status replies.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportStatusReplies($offset, $limit) {
$sql = "SELECT member_status_replies.*, members.name
/**
* Exports followers.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportFollowers($offset, $limit) {
$sql = "SELECT *
/**
* Exports conversations.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversations($offset, $limit) {
$sql = "SELECT message_topics.*, members.name
/**
* Exports conversation messages.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationMessages($offset, $limit) {
$sql = "SELECT message_posts.*, members.name
/**
* Exports conversation recipients.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationUsers($offset, $limit) {
$sql = "SELECT message_topic_user_map.*, members.name
/**
* Exports conversation attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationAttachments($offset, $limit) {
$this->exportAttachments('core_Messaging', 'com.woltlab.wcf.conversation.attachment', $offset, $limit);
/**
* Exports boards.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBoards($offset, $limit) {
$sql = "SELECT *
/**
* Exports the boards recursively.
+ *
+ * @param integer $parentID
*/
protected function exportBoardsRecursively($parentID = -1) {
if (!isset($this->boardCache[$parentID])) return;
'posts' => $board['posts'],
'threads' => $board['topics']
]);
-
+
$this->exportBoardsRecursively($board['id']);
}
}
/**
* Exports threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportThreads($offset, $limit) {
// get thread ids
/**
* Exports posts.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPosts($offset, $limit) {
$sql = "SELECT *
/**
* Exports watched threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportWatchedThreads($offset, $limit) {
$sql = "SELECT *
/**
* Exports polls.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPolls($offset, $limit) {
$sql = "SELECT polls.*, topics.topic_firstpost
/**
* Exports poll option votes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptionVotes($offset, $limit) {
$sql = "SELECT polls.*, voters.*
/**
* Exports likes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportLikes($offset, $limit) {
$sql = "SELECT core_reputation_index.*, forums_posts.author_id
/**
* Exports post attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPostAttachments($offset, $limit) {
$this->exportAttachments('forums_Forums', 'com.woltlab.wbb.attachment', $offset, $limit);
}
+ /**
+ * Returns the number of attachments of the given type.
+ *
+ * @param string $type
+ * @return integer
+ */
private function countAttachments($type) {
$sql = "SELECT COUNT(*) AS count
FROM ".$this->databasePrefix."core_attachments_map
return $row['count'];
}
+ /**
+ * Exports attachments.
+ *
+ * @param string $type
+ * @param string $objectType
+ * @param integer $offset
+ * @param integer $limit
+ */
private function exportAttachments($type, $objectType, $offset, $limit) {
$sql = "SELECT core_attachments.*, core_attachments_map.id2
FROM ".$this->databasePrefix."core_attachments_map core_attachments_map
$statement->execute([$type]);
while ($row = $statement->fetchArray()) {
$fileLocation = $this->fileSystemPath.'uploads/'.$row['attach_location'];
-
+
ImportHandler::getInstance()->getImporter($objectType)->import($row['attach_id'], [
'objectID' => $row['id2'],
'userID' => ($row['attach_member_id'] ?: null),
}
}
+ /**
+ * Returns the data of tags.
+ *
+ * @param string $app
+ * @param string $area
+ * @param integer[] $objectIDs
+ * @return string[][]
+ */
private function getTags($app, $area, array $objectIDs) {
$tags = [];
$conditionBuilder = new PreparedStatementConditionBuilder();
return $tags;
}
-
+ /**
+ * Returns the id of the default language in the imported board.
+ *
+ * @return integer
+ */
private function getDefaultLanguageID() {
if ($this->defaultLanguageID === null) {
$sql = "SELECT lang_id
}
+ /**
+ * Returns the value of a language variable.
+ *
+ * @param string $prefix
+ * @param integer $id
+ * @param string $suffix
+ * @return string
+ */
private function getLanguageVar($prefix, $id, $suffix = '') {
if ($this->languageStatement === null) {
$sql = "SELECT word_custom
return '';
}
+ /**
+ * Returns message with fixed formatting as used in WCF.
+ *
+ * @param string $string
+ * @return string
+ */
private static function fixMessage($string) {
// align
$string = preg_replace('~<p style="text-align:(left|center|right);">(.*?)</p>~is', "[align=\\1]\\2[/align]\n\n", $string);
/**
* Exports user groups.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserGroups($offset, $limit) {
$sql = "SELECT *
/**
* Exports users.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUsers($offset, $limit) {
// prepare password update
/**
* Exports user ranks.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserRanks($offset, $limit) {
$sql = "SELECT *
/**
* Exports user avatars.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserAvatars($offset, $limit) {
$sql = "SELECT userid, avatar
/**
* Exports boards.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBoards($offset, $limit) {
$sql = "SELECT *
/**
* Exports the boards recursively.
+ *
+ * @param integer $parentID
*/
protected function exportBoardsRecursively($parentID = 0) {
if (!isset($this->boardCache[$parentID])) return;
/**
* Exports threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportThreads($offset, $limit) {
$sql = "SELECT kunena_topics.*
/**
* Exports posts.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPosts($offset, $limit) {
$sql = "SELECT *
/**
* Exports attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportAttachments($offset, $limit) {
$sql = "SELECT *
}
}
+ /**
+ * Returns message with fixed BBCodes as used in WCF.
+ *
+ * @param string $message
+ * @return string
+ */
private static function fixBBCodes($message) {
static $quoteRegex = null;
static $quoteCallback = null;
/**
* Exports user groups.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserGroups($offset, $limit) {
$sql = "SELECT *
/**
* Exports users.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUsers($offset, $limit) {
// cache profile fields
/**
* Exports user options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserOptions($offset, $limit) {
$conditionBuilder = new PreparedStatementConditionBuilder();
/**
* Exports user ranks.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserRanks($offset, $limit) {
$sql = "(
/**
* Exports followers.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportFollowers($offset, $limit) {
$sql = "SELECT uid, buddylist
/**
* Exports user avatars.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserAvatars($offset, $limit) {
$sql = "SELECT uid, avatar, avatardimensions, avatartype
/**
* Exports conversation folders.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationFolders($offset, $limit) {
$sql = "SELECT uid, pmfolders
/**
* Exports conversations.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversations($offset, $limit) {
$sql = "SELECT message_table.*, user_table.username
/**
* Exports conversation recipients.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationUsers($offset, $limit) {
$sql = "SELECT message_table.*, user_table.username
/**
* Exports boards.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBoards($offset, $limit) {
$sql = "SELECT *
/**
* Exports the boards recursively.
+ *
+ * @param integer $parentID
*/
protected function exportBoardsRecursively($parentID = 0) {
if (!isset($this->boardCache[$parentID])) return;
/**
* Exports threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportThreads($offset, $limit) {
$sql = "SELECT *
/**
* Exports posts.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPosts($offset, $limit) {
$sql = "SELECT post_table.*, user_table.username AS editor
/**
* Exports post attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPostAttachments($offset, $limit) {
static $uploadsPath = null;
/**
* Exports watched threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportWatchedThreads($offset, $limit) {
$sql = "SELECT *
/**
* Exports polls.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPolls($offset, $limit) {
$sql = "SELECT poll_table.*, thread_table.firstpost
/**
* Exports poll options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptions($offset, $limit) {
$sql = "SELECT pid, options, votes
/**
* Exports poll option votes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptionVotes($offset, $limit) {
$sql = "SELECT *
/**
* Exports likes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportLikes($offset, $limit) {
$sql = "SELECT *
/**
* Exports labels.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportLabels($offset, $limit) {
$prefixMap = [];
/**
* Exports ACLs.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportACLs($offset, $limit) {
// get ids
/**
* Exports smilies.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportSmilies($offset, $limit) {
$sql = "SELECT *
}
}
+ /**
+ * Returns message with BBCodes as used in WCF.
+ *
+ * @param string $message
+ * @return string
+ */
private static function fixBBCodes($message) {
static $videoRegex = null;
static $quoteRegex = null;
/**
* Exports users.
+ *
+ * @param integer $offset
+ * @param integer $limit
+ * @throws SystemException
*/
public function exportUsers($offset, $limit) {
// prepare password update
/**
* Exports boards.
+ *
+ * @param integer $offset
+ * @param integer $limit
+ * @throws SystemException
*/
public function exportBoards($offset, $limit) {
$boardIDs = $this->database->zrange('categories:cid', 0, -1);
/**
* Exports the boards recursively.
+ *
+ * @param integer $parentID
*/
protected function exportBoardsRecursively($parentID = 0) {
if (!isset($this->boardCache[$parentID])) return;
/**
* Exports threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
+ * @throws SystemException
*/
public function exportThreads($offset, $limit) {
$threadIDs = $this->database->zrange('topics:tid', $offset, $offset + $limit);
/**
* Exports posts.
+ *
+ * @param integer $offset
+ * @param integer $limit
+ * @throws SystemException
*/
public function exportPosts($offset, $limit) {
$postIDs = $this->database->zrange('posts:pid', $offset, $offset + $limit);
/**
* Exports likes.
+ *
+ * @param integer $offset
+ * @param integer $limit
+ * @throws SystemException
*/
public function exportLikes($offset, $limit) {
$userIDs = $this->database->zrange('users:joindate', $offset, $offset + $limit);
/**
* Exports followers.
+ *
+ * @param integer $offset
+ * @param integer $limit
+ * @throws SystemException
*/
public function exportFollowers($offset, $limit) {
$userIDs = $this->database->zrange('users:joindate', $offset, $offset + $limit);
/**
* Exports conversations.
+ *
+ * @param integer $offset
+ * @param integer $limit
+ * @throws SystemException
*/
public function exportConversations($offset, $limit) {
$userIDs = $this->database->zrange('users:joindate', $offset, $offset + $limit);
/**
* Exports conversation messages.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationMessages($offset, $limit) {
for ($i = 1; $i <= $limit; $i++) {
}
}
+ /**
+ * Returns message with markdown being convered into BBCodes.
+ *
+ * @param string $message
+ * @return string
+ */
protected static function convertMarkdown($message) {
static $parsedown = null;
static $codeRegex = null;
/**
* Exports user groups.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserGroups($offset, $limit) {
$sql = "SELECT *
/**
* Exports users.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUsers($offset, $limit) {
// cache profile fields
/**
* Exports user options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserOptions($offset, $limit) {
$condition = new PreparedStatementConditionBuilder();
/**
* Exports user ranks.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserRanks($offset, $limit) {
$sql = "SELECT *
/**
* Exports followers.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportFollowers($offset, $limit) {
$sql = "SELECT *
/**
* Exports user avatars.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserAvatars($offset, $limit) {
static $avatar_salt = null, $avatar_path = null, $avatar_gallery_path = null;
/**
* Exports conversation folders.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationFolders($offset, $limit) {
$sql = "SELECT *
}
/**
- * Creates a conversation id out of the old rootLevel
- * and the participants.
+ * Creates a conversation id out of the old rootLevel and the participants.
*
- * This ensures that only the actual receivers of a pm
- * are able to see it after import, while minimizing the
- * number of conversations.
+ * This ensures that only the actual receivers of a pm are able to see it
+ * after import, while minimizing the number of conversations.
+ *
+ * @param integer $rootLevel
+ * @param integer[] $participants
+ * @return string
*/
private function getConversationID($rootLevel, array $participants) {
$conversationID = $rootLevel;
/**
* Exports conversations.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversations($offset, $limit) {
$sql = "(
/**
* Exports conversation messages.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationMessages($offset, $limit) {
$sql = "(
/**
* Exports conversation recipients.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationUsers($offset, $limit) {
$sql = "SELECT to_table.*, msg_table.root_level, msg_table.author_id, msg_table.bcc_address, user_table.username, msg_table.message_time,
/**
* Exports conversation attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationAttachments($offset, $limit) {
return $this->exportAttachments(1, $offset, $limit);
/**
* Exports boards.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBoards($offset, $limit) {
$sql = "SELECT *
/**
* Exports the boards recursively.
+ *
+ * @param integer $parentID
*/
protected function exportBoardsRecursively($parentID = 0) {
if (!isset($this->boardCache[$parentID])) return;
/**
* Exports threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportThreads($offset, $limit) {
$boardIDs = array_keys(BoardCache::getInstance()->getBoards());
/**
* Exports posts.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPosts($offset, $limit) {
$sql = "SELECT post_table.*, user_table.username, editor.username AS editorName,
/**
* Exports post attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPostAttachments($offset, $limit) {
$this->exportAttachments(0, $offset, $limit);
/**
* Exports watched threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportWatchedThreads($offset, $limit) {
// TODO: This is untested. I cannot find the button to watch a topic.
/**
* Exports polls.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPolls($offset, $limit) {
$sql = "SELECT topic_id, topic_first_post_id, poll_title, poll_start, poll_length, poll_max_options, poll_vote_change,
/**
* Exports poll options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptions($offset, $limit) {
$sql = "SELECT *
/**
* Exports poll option votes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptionVotes($offset, $limit) {
$sql = "SELECT *
/**
* Exports ACLs.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportACLs($offset, $limit) {
$sql = "SELECT *
/**
* Exports smilies.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportSmilies($offset, $limit) {
$sql = "SELECT MIN(smiley_id) AS smiley_id,
}
}
+ /**
+ * Returns the number of attachments.
+ *
+ * @param integer $conversation
+ * @return integer
+ */
protected function countAttachments($conversation) {
$sql = "SELECT COUNT(*) AS count
FROM ".$this->databasePrefix."attachments
return $row['count'];
}
+ /**
+ * Exports attachments.
+ *
+ * @param integer $conversation
+ * @param integer $offset
+ * @param integer $limit
+ */
protected function exportAttachments($conversation, $offset, $limit) {
static $upload_path = null;
if ($upload_path === null) {
}
}
+ /**
+ * Returns message with fixed BBCodes as used in WCF.
+ *
+ * @param string $text
+ * @param string $uid
+ * @return string
+ */
protected static function fixBBCodes($text, $uid) {
// fix closing list tags
$text = preg_replace('~\[/list:(u|o)~i', '[/list', $text);
/**
* Exports user groups.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserGroups($offset, $limit) {
$sql = "SELECT *
/**
* Exports users.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUsers($offset, $limit) {
// cache profile fields
/**
* Exports user options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserOptions($offset, $limit) {
$sql = "SELECT fields.*,
/**
* Exports user ranks.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserRanks($offset, $limit) {
$sql = "SELECT *
/**
* Exports followers.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportFollowers($offset, $limit) {
$sql = "SELECT *
/**
* Exports user avatars.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserAvatars($offset, $limit) {
static $avatar_salt = null, $avatar_path = null, $avatar_gallery_path = null;
/**
* Exports conversation folders.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationFolders($offset, $limit) {
$sql = "SELECT *
}
/**
- * Creates a conversation id out of the old rootLevel
- * and the participants.
+ * Creates a conversation id out of the old rootLevel and the participants.
*
- * This ensures that only the actual receivers of a pm
- * are able to see it after import, while minimizing the
- * number of conversations.
+ * This ensures that only the actual receivers of a pm are able to see it
+ * after import, while minimizing the number of conversations.
+ *
+ * @param integer $rootLevel
+ * @param integer[] $participants
+ * @return string
*/
private function getConversationID($rootLevel, array $participants) {
$conversationID = $rootLevel;
/**
* Exports conversations.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversations($offset, $limit) {
$sql = "(
/**
* Exports conversation messages.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationMessages($offset, $limit) {
$sql = "(
/**
* Exports conversation recipients.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationUsers($offset, $limit) {
$sql = "SELECT to_table.*, msg_table.root_level, msg_table.author_id, msg_table.bcc_address, user_table.username, msg_table.message_time,
/**
* Exports conversation attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationAttachments($offset, $limit) {
return $this->exportAttachments(1, $offset, $limit);
/**
* Exports boards.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBoards($offset, $limit) {
$sql = "SELECT *
/**
* Exports the boards recursively.
+ *
+ * @param integer $parentID
*/
protected function exportBoardsRecursively($parentID = 0) {
if (!isset($this->boardCache[$parentID])) return;
/**
* Exports threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportThreads($offset, $limit) {
$boardIDs = array_keys(BoardCache::getInstance()->getBoards());
/**
* Exports posts.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPosts($offset, $limit) {
$sql = "SELECT post_table.*, user_table.username, editor.username AS editorName,
/**
* Exports post attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPostAttachments($offset, $limit) {
return $this->exportAttachments(0, $offset, $limit);
/**
* Exports watched threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportWatchedThreads($offset, $limit) {
// TODO: This is untested. I cannot find the button to watch a topic.
/**
* Exports polls.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPolls($offset, $limit) {
$sql = "SELECT topic_id, topic_first_post_id, poll_title, poll_start, poll_length, poll_max_options, poll_vote_change,
/**
* Exports poll options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptions($offset, $limit) {
$sql = "SELECT *
/**
* Exports poll option votes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptionVotes($offset, $limit) {
$sql = "SELECT *
/**
* Exports ACLs.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportACLs($offset, $limit) {
$sql = "SELECT *
/**
* Exports smilies.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportSmilies($offset, $limit) {
$sql = "SELECT MIN(smiley_id) AS smiley_id,
}
}
+ /**
+ * Returns the number of atatchments.
+ *
+ * @param integer $conversation
+ * @return integer
+ */
protected function countAttachments($conversation) {
$sql = "SELECT COUNT(*) AS count
FROM ".$this->databasePrefix."attachments
return $row['count'];
}
+ /**
+ * Exports attachments.
+ *
+ * @param integer $conversation
+ * @param integer $offset
+ * @param integer $limit
+ */
protected function exportAttachments($conversation, $offset, $limit) {
static $upload_path = null;
if ($upload_path === null) {
}
}
+ /**
+ * Returns message with fixed BBCodes as used in WCF.
+ *
+ * @param string $text
+ * @param string $uid
+ * @return string
+ */
protected static function fixBBCodes($text, $uid) {
// fix closing list tags
$text = preg_replace('~\[/list:(u|o)~i', '[/list', $text);
/**
* Exports user groups.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserGroups($offset, $limit) {
// import everyone, guests and users pseudogroups
/**
* Exports users.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUsers($offset, $limit) {
// cache profile fields
/**
* Exports user options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserOptions($offset, $limit) {
$sql = "SELECT *
/**
* Exports user ranks.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserRanks($offset, $limit) {
$sql = "SELECT *
/**
* Exports followers.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportFollowers($offset, $limit) {
$sql = "SELECT id_member, buddy_list
/**
* Exports user avatars.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserAvatars($offset, $limit) {
$sql = "(
/**
* Exports conversation folders.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationFolders($offset, $limit) {
$sql = "SELECT id_member, message_labels
}
/**
- * Creates a conversation id out of the old pmHead
- * and the participants.
+ * Creates a conversation id out of the old pmHead and the participants.
*
- * This ensures that only the actual receivers of a pm
- * are able to see it after import, while minimizing the
- * number of conversations.
+ * This ensures that only the actual receivers of a pm are able to see it
+ * after import, while minimizing the number of conversations.
+ *
+ * @param integer $pmHead
+ * @param integer[] $participants
+ * @return string
*/
private function getConversationID($pmHead, array $participants) {
$conversationID = $pmHead;
/**
* Exports conversations.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversations($offset, $limit) {
$sql = "SELECT pm.*,
/**
* Exports conversation messages.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationMessages($offset, $limit) {
$sql = "SELECT pm.*,
/**
* Exports conversation recipients.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationUsers($offset, $limit) {
$sql = "SELECT recipients.*, pm.id_pm_head, members.member_name, pm.msgtime, pm.id_member_from,
/**
* Exports boards.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBoards($offset, $limit) {
$sql = "SELECT *
/**
* Exports the boards recursively.
+ *
+ * @param integer $parentID
*/
protected function exportBoardsRecursively($parentID = 0) {
if (!isset($this->boardCache[$parentID])) return;
/**
* Exports threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportThreads($offset, $limit) {
// get threads
/**
* Exports posts.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPosts($offset, $limit) {
$sql = "SELECT message.*, member.id_member AS editorID
/**
* Exports post attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPostAttachments($offset, $limit) {
$sql = "SELECT attachment.*, message.id_member, message.poster_time
/**
* Exports watched threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportWatchedThreads($offset, $limit) {
$sql = "SELECT *
/**
* Exports polls.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPolls($offset, $limit) {
$sql = "SELECT poll.*, topic.id_first_msg,
/**
* Exports poll options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptions($offset, $limit) {
$sql = "SELECT *
/**
* Exports poll option votes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptionVotes($offset, $limit) {
$sql = "SELECT *
/**
* Exports ACLs.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportACLs($offset, $limit) {
// TODO: try to split this into several requests
/**
* Exports smilies.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportSmilies($offset, $limit) {
$sql = "SELECT MIN(id_smiley) AS id_smiley,
}
}
+ /**
+ * Returns the value of the given option in the imported board.
+ *
+ * @param string $optionName
+ * @return mixed
+ */
private function readOption($optionName) {
static $optionCache = [];
return $optionCache[$optionName];
}
+ /**
+ * Returns message with fixed BBCodes as used in WCF.
+ *
+ * @param string $message
+ * @return string
+ */
private static function fixBBCodes($message) {
static $sizeRegex = null;
static $quoteRegex = null;
/**
* Exports user groups.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserGroups($offset, $limit) {
$sql = "SELECT *
/**
* Exports users.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUsers($offset, $limit) {
// cache user options
/**
* Exports user ranks.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserRanks($offset, $limit) {
$sql = "(
/**
* Exports followers.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportFollowers($offset, $limit) {
$sql = "SELECT userid, buddylist
/**
* Exports guestbook entries.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportGuestbookEntries($offset, $limit) {
$sql = "SELECT *
/**
* Exports user avatars.
+ *
+ * @param integer $offset
+ * @param integer $limit
+ * @throws \Exception
*/
public function exportUserAvatars($offset, $limit) {
$sql = "SELECT customavatar.*, user.avatarrevision
/**
* Exports user options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserOptions($offset, $limit) {
$sql = "SELECT *
/**
* Exports conversation folders.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationFolders($offset, $limit) {
$sql = "SELECT userid, pmfolders
}
/**
- * Creates a conversation id out of the old parentpmid
- * and the participants.
+ * Creates a conversation id out of the old parentpmid and the participants.
*
- * This ensures that only the actual receivers of a pm
- * are able to see it after import, while minimizing the
- * number of conversations.
+ * This ensures that only the actual receivers of a pm are able to see it
+ * after import, while minimizing the number of conversations.
+ *
+ * @param integer $parentpmid
+ * @param integer[] $participants
+ * @return string
*/
private function getConversationID($parentpmid, array $participants) {
$conversationID = $parentpmid;
/**
* Exports conversations.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversations($offset, $limit) {
$sql = "SELECT pm.*, text.*,
/**
* Exports conversation messages.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationMessages($offset, $limit) {
$sql = "SELECT pmtext.*,
/**
* Exports conversation recipients.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationUsers($offset, $limit) {
$sql = "SELECT pm.*, user.username, pmtext.touserarray, pmtext.dateline, pmtext.fromuserid,
/**
* Exports boards.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBoards($offset, $limit) {
$sql = "SELECT *
/**
* Exports the boards recursively.
+ *
+ * @param integer $parentID
*/
protected function exportBoardsRecursively($parentID = -1) {
if (!isset($this->boardCache[$parentID])) return;
/**
* Exports threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportThreads($offset, $limit) {
$sql = "SELECT thread.*,
/**
* Exports posts.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPosts($offset, $limit) {
$sql = "SELECT post.*,
/**
* Exports post attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
+ * @throws \Exception
*/
public function exportPostAttachments($offset, $limit) {
try {
/**
* Exports watched threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportWatchedThreads($offset, $limit) {
$sql = "SELECT *
/**
* Exports polls.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPolls($offset, $limit) {
$sql = "SELECT poll.*, thread.firstpostid
/**
* Exports poll options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptions($offset, $limit) {
$sql = "SELECT *
/**
* Exports poll option votes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptionVotes($offset, $limit) {
$sql = "SELECT *
/**
* Exports likes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportLikes($offset, $limit) {
$sql = "SELECT *
/**
* Exports labels.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportLabels($offset, $limit) {
if (!$offset) {
/**
* Exports ACLs.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportACLs($offset, $limit) {
$mapping = [
/**
* Exports smilies.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportSmilies($offset, $limit) {
$sql = "SELECT *
/**
* Exports smiley categories.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportSmileyCategories($offset, $limit) {
$sql = "SELECT *
/**
* Exports gallery albums.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportGalleryAlbums($offset, $limit) {
$sql = "SELECT album.*, user.username
/**
* Exports gallery images.
+ *
+ * @param integer $offset
+ * @param integer $limit
+ * @throws \Exception
*/
public function exportGalleryImages($offset, $limit) {
try {
/**
* Exports gallery comments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportGalleryComments($offset, $limit) {
$sql = "SELECT comment.*, user.username
/**
* Exports calendar categories.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportCalendarCategories($offset, $limit) {
$sql = "SELECT *
/**
* Exports calendar events.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportCalendarEvents($offset, $limit) {
$sql = "SELECT event.*, user.username
}
}
+ /**
+ * Returns the value of the given option in the imported board.
+ *
+ * @param string $optionName
+ * @return mixed
+ */
private function readOption($optionName) {
static $optionCache = [];
return $optionCache[$optionName];
}
+ /**
+ * Returns message with fixed BBCodes as used in WCF.
+ *
+ * @param string $message
+ * @return string
+ */
private static function fixBBCodes($message) {
static $quoteRegex = null;
static $quoteCallback = null;
/**
* Exports user groups.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserGroups($offset, $limit) {
$sql = "SELECT *
/**
* Exports users.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUsers($offset, $limit) {
// prepare password update
/**
* Exports user avatars.
+ *
+ * @param integer $offset
+ * @param integer $limit
+ * @throws \Exception
*/
public function exportUserAvatars($offset, $limit) {
$sql = "SELECT customavatar.*, user.avatarrevision
/**
* Exports boards.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBoards($offset, $limit) {
$sql = "SELECT node.*
/**
* Exports the boards recursively.
+ *
+ * @param integer $parentID
*/
protected function exportBoardsRecursively($parentID = 0) {
if (!isset($this->boardCache[$parentID])) return;
/**
* Exports threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportThreads($offset, $limit) {
$sql = "SELECT child.*, view.count AS views
/**
* Exports posts.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPosts($offset, $limit) {
$sql = "SELECT child.*, IF(parent.contenttypeid = child.contenttypeid, 0, 1) AS isFirstPost, text.*
/**
* Exports post attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
+ * @throws \Exception
*/
public function exportPostAttachments($offset, $limit) {
$sql = "SELECT child.*, attach.*, filedata.*
/**
* Exports polls.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPolls($offset, $limit) {
$sql = "SELECT *
/**
* Exports poll options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptions($offset, $limit) {
$sql = "SELECT polloption.*, poll.pollid
/**
* Exports poll option votes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptionVotes($offset, $limit) {
$sql = "SELECT *
}
}
+ /**
+ * Returns the value of the given option in the imported board.
+ *
+ * @param string $optionName
+ * @return mixed
+ */
private function readOption($optionName) {
static $optionCache = [];
return $optionCache[$optionName];
}
+ /**
+ * Returns message with fixed BBCodes as used in WCF.
+ *
+ * @param string $message
+ * @return string
+ */
private static function fixBBCodes($message) {
static $quoteRegex = null;
static $quoteCallback = null;
/**
* Exports user groups.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserGroups($offset, $limit) {
$sql = "SELECT *
/**
* Exports users.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUsers($offset, $limit) {
// cache profile fields
/**
* Exports user ranks.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserRanks($offset, $limit) {
$sql = "SELECT *
/**
* Exports user avatars.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserAvatars($offset, $limit) {
$sql = "SELECT *
/**
* Exports user options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserOptions($offset, $limit) {
$sql = "SELECT *
/**
* Exports conversation folders.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationFolders($offset, $limit) {
$sql = "SELECT *
/**
* Exports conversations.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversations($offset, $limit) {
$sql = "SELECT pm.*, user_table.username
/**
* Exports conversation recipients.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationUsers($offset, $limit) {
$sql = "SELECT *
/**
* Exports conversation attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationAttachments($offset, $limit) {
$this->exportAttachments('privatemessageid', 'com.woltlab.wcf.conversation.attachment', $offset, $limit);
/**
* Exports boards.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBoards($offset, $limit) {
$sql = "SELECT *
/**
* Exports the boards recursively.
+ *
+ * @param integer $parentID
*/
protected function exportBoardsRecursively($parentID = 0) {
if (!isset($this->boardCache[$parentID])) return;
/**
* Exports threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportThreads($offset, $limit) {
// get global prefixes
/**
* Exports posts.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPosts($offset, $limit) {
$sql = "SELECT *
/**
* Exports post attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPostAttachments($offset, $limit) {
$this->exportAttachments('postid', 'com.woltlab.wbb.attachment', $offset, $limit);
/**
* Exports watched threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportWatchedThreads($offset, $limit) {
$sql = "SELECT *
/**
* Exports polls.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPolls($offset, $limit) {
// prepare statements
/**
* Exports poll options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptions($offset, $limit) {
$sql = "SELECT *
$statement->execute([]);
while ($row = $statement->fetchArray()) {
ImportHandler::getInstance()->getImporter('com.woltlab.wbb.poll.option')->import($row['polloptionid'], [
- 'pollID' => $row['pollid'],
- 'optionValue' => $row['polloption'],
- 'votes' => $row['votes']
+ 'pollID' => $row['pollid'],
+ 'optionValue' => $row['polloption'],
+ 'votes' => $row['votes']
]);
}
}
/**
* Exports labels.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportLabels($offset, $limit) {
$prefixMap = [];
/**
* Exports ACLs.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportACLs($offset, $limit) {
$sql = "SELECT *
/**
* Exports smilies.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportSmilies($offset, $limit) {
$sql = "SELECT *
}
}
+ /**
+ * Returns the number of attachments.
+ *
+ * @param integer $indexName
+ * @return integer
+ */
private function countAttachments($indexName) {
$sql = "SELECT COUNT(*) AS count
FROM ".$this->databasePrefix."attachments
return $row['count'];
}
+ /**
+ * Exports attachments.
+ *
+ * @param integer $indexName
+ * @param string $objectType
+ * @param integer $offset
+ * @param integer $limit
+ */
private function exportAttachments($indexName, $objectType, $offset, $limit) {
$sql = "SELECT *
FROM ".$this->databasePrefix."attachments
}
}
+ /**
+ * Returns message with BBCodes as used in WCF.
+ *
+ * @param string $text
+ * @return string
+ */
private static function fixBBCodes($text) {
$text = str_ireplace('[center]', '[align=center]', $text);
$text = str_ireplace('[/center]', '[/align]', $text);
/**
* Exports user groups.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserGroups($offset, $limit) {
$sql = "SELECT *
/**
* Exports users.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUsers($offset, $limit) {
// cache existing user options
/**
* Exports user ranks.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserRanks($offset, $limit) {
$sql = "SELECT *
/**
* Exports followers.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportFollowers($offset, $limit) {
$sql = "SELECT *
/**
* Exports guestbook entries.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportGuestbookEntries($offset, $limit) {
$sql = "SELECT *
/**
* Exports guestbook responses.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportGuestbookResponses($offset, $limit) {
$sql = "SELECT user_guestbook.*, user_table.username AS ownerName
/**
* Exports user avatars.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserAvatars($offset, $limit) {
$sql = "SELECT *
/**
* Exports user options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserOptions($offset, $limit) {
// get existing option names
/**
* Exports conversation folders.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationFolders($offset, $limit) {
$sql = "SELECT *
}
/**
- * Creates a conversation id out of the old parentPmID
- * and the participants.
+ * Creates a conversation id out of the old parentPmID and the participants.
*
- * This ensures that only the actual receivers of a pm
- * are able to see it after import, while minimizing the
- * number of conversations.
+ * This ensures that only the actual receivers of a pm are able to see it
+ * after import, while minimizing the number of conversations.
+ *
+ * @param integer $parentPmID
+ * @param integer[] $participants
+ * @return string
*/
private function getConversationID($parentPmID, array $participants) {
$conversationID = $parentPmID;
/**
* Exports conversations.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversations($offset, $limit) {
$sql = "SELECT pm.*,
/**
* Exports conversation messages.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationMessages($offset, $limit) {
$sql = "SELECT pm.*,
/**
* Exports conversation recipients.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationUsers($offset, $limit) {
$sql = "SELECT pm_to_user.*,
/**
* Exports conversation attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationAttachments($offset, $limit) {
$this->exportAttachments('pm', 'com.woltlab.wcf.conversation.attachment', $offset, $limit);
/**
* Exports boards.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBoards($offset, $limit) {
$sql = "SELECT board.*, structure.position
/**
* Exports the boards recursively.
+ *
+ * @param integer $parentID
*/
protected function exportBoardsRecursively($parentID = 0) {
if (!isset($this->boardCache[$parentID])) return;
/**
* Exports threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportThreads($offset, $limit) {
// get global prefixes
/**
* Exports posts.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPosts($offset, $limit) {
$sql = "SELECT *
/**
* Exports post attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPostAttachments($offset, $limit) {
$this->exportAttachments('post', 'com.woltlab.wbb.attachment', $offset, $limit);
/**
* Exports watched threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportWatchedThreads($offset, $limit) {
$sql = "SELECT *
/**
* Exports polls.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPolls($offset, $limit) {
$sql = "SELECT *
/**
* Exports poll options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptions($offset, $limit) {
$sql = "SELECT *
/**
* Exports poll option votes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptionVotes($offset, $limit) {
$sql = "SELECT *
/**
* Exports thread ratings.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportThreadRatings($offset, $limit) {
$sql = "SELECT thread_rating.*, thread.firstPostID, thread.userID AS objectUserID,
/**
* Exports labels.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportLabels($offset, $limit) {
$prefixMap = [];
/**
* Exports ACLs.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportACLs($offset, $limit) {
// get ids
/**
* Exports smilies.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportSmilies($offset, $limit) {
$sql = "SELECT *
/**
* Exports smiley categories.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportSmileyCategories($offset, $limit) {
$sql = "SELECT *
/**
* Exports blog categories.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogCategories($offset, $limit) {
$sql = "SELECT *
/**
* Exports blog entries.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogEntries($offset, $limit) {
// get entry ids
/**
* Exports blog attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogAttachments($offset, $limit) {
$this->exportAttachments('userBlogEntry', 'com.woltlab.blog.entry.attachment', $offset, $limit);
/**
* Exports blog comments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogComments($offset, $limit) {
$sql = "SELECT *
/**
* Exports blog entry likes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogEntryLikes($offset, $limit) {
$sql = "SELECT rating.*, blog.userID AS objectUserID
/**
* Exports gallery categories.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportGalleryCategories($offset, $limit) {
$sql = "SELECT *
/**
* Exports gallery albums.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportGalleryAlbums($offset, $limit) {
$destVersion21 = version_compare(GALLERYCore::getInstance()->getPackage()->packageVersion, '2.1.0 Alpha 1', '>=');
/**
* Exports gallery images.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportGalleryImages($offset, $limit) {
// get ids
/**
* Exports gallery comments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportGalleryComments($offset, $limit) {
$sql = "SELECT *
/**
* Exports gallery image likes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportGalleryImageLikes($offset, $limit) {
$sql = "SELECT rating.*, photo.ownerID AS objectUserID
/**
* Exports calendar categories.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportCalendarCategories($offset, $limit) {
$sql = "SELECT *
/**
* Exports calendar events.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportCalendarEvents($offset, $limit) {
$sql = "SELECT calendar_event_participation.*, calendar_event_message.*, calendar_event.*
/**
* Exports calendar attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportCalendarAttachments($offset, $limit) {
$this->exportAttachments('event', 'com.woltlab.calendar.event.attachment', $offset, $limit);
/**
* Exports calendar event dates.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportCalendarEventDates($offset, $limit) {
$sql = "SELECT *
/**
* Exports calendar event date comments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportCalendarEventDateComments($offset, $limit) {
$sql = "SELECT startTime
/**
* Exports calendar event date participations.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportCalendarEventDateParticipation($offset, $limit) {
$sql = "SELECT startTime
}
}
+ /**
+ * Returns the number of attachments.
+ *
+ * @param string $type
+ * @return integer
+ */
private function countAttachments($type) {
if (substr($this->getPackageVersion('com.woltlab.wcf'), 0, 3) == '1.1') {
$sql = "SELECT COUNT(*) AS count
return $row['count'];
}
+ /**
+ * Exports attachments.
+ *
+ * @param string $type
+ * @param string $objectType
+ * @param integer $offset
+ * @param integer $limit
+ */
private function exportAttachments($type, $objectType, $offset, $limit) {
if (substr($this->getPackageVersion('com.woltlab.wcf'), 0, 3) == '1.1') {
$sql = "SELECT *
return $optionsNames;
}
+ /**
+ * Returns the version of a package in the imported system or `false` if the package is
+ * not installed in the imported system.
+ *
+ * @param string $name
+ * @return string|boolean
+ */
private function getPackageVersion($name) {
$sql = "SELECT packageVersion
FROM wcf".$this->dbNo."_package
return false;
}
+ /**
+ * Returns tags to import.
+ *
+ * @param string $name
+ * @param integer[] $objectIDs
+ * @return string[][]
+ */
private function getTags($name, array $objectIDs) {
$tags = [];
if (substr($this->getPackageVersion('com.woltlab.wcf'), 0, 3) == '1.1' && $this->getPackageVersion('com.woltlab.wcf.tagging')) {
return $tags;
}
+ /**
+ * Returns message with fixed BBCodes as used in WCF.
+ *
+ * @param string $message
+ * @return string
+ */
private static function fixBBCodes($message) {
// code bbcodes
$message = preg_replace('~\[(php|java|css|html|xml|tpl|js|c)\]~', '[code=\\1]', $message);
/**
* Exports user groups.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserGroups($offset, $limit) {
$sql = "SELECT *
/**
* Exports users.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUsers($offset, $limit) {
// cache existing user options
/**
* Exports user ranks.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserRanks($offset, $limit) {
$sql = "SELECT *
/**
* Exports followers.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportFollowers($offset, $limit) {
$sql = "SELECT *
/**
* Exports profile comments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportProfileComments($offset, $limit) {
$this->exportComments('com.woltlab.wcf.user.profileComment', 'com.woltlab.wcf.user.comment', $offset, $limit);
/**
* Exports profile comment responses.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportProfileCommentResponses($offset, $limit) {
$this->exportCommentResponses('com.woltlab.wcf.user.profileComment', 'com.woltlab.wcf.user.comment.response', $offset, $limit);
/**
* Exports user avatars.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserAvatars($offset, $limit) {
$sql = "SELECT *
/**
* Exports user options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserOptions($offset, $limit) {
// get existing option names
/**
* Exports conversation labels.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationLabels($offset, $limit) {
$sql = "SELECT *
/**
* Exports conversations.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversations($offset, $limit) {
$sql = "SELECT *
/**
* Exports conversation messages.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationMessages($offset, $limit) {
$sql = "SELECT *
/**
* Exports conversation recipients.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationUsers($offset, $limit) {
$conversationIDs = $userID = $rows = [];
/**
* Exports conversation attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationAttachments($offset, $limit) {
$this->exportAttachments('com.woltlab.wcf.conversation.message', 'com.woltlab.wcf.conversation.attachment', $offset, $limit);
/**
* Exports boards.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBoards($offset, $limit) {
$sql = "SELECT *
/**
* Exports the boards recursively.
+ *
+ * @param integer $parentID
*/
protected function exportBoardsRecursively($parentID = null) {
if (!isset($this->boardCache[$parentID])) return;
/**
* Exports threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportThreads($offset, $limit) {
// get thread ids
/**
* Exports posts.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPosts($offset, $limit) {
$sql = "SELECT *
/**
* Exports post attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPostAttachments($offset, $limit) {
$this->exportAttachments('com.woltlab.wbb.post', 'com.woltlab.wbb.attachment', $offset, $limit);
/**
* Exports watched threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportWatchedThreads($offset, $limit) {
$sql = "SELECT *
/**
* Exports polls.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPolls($offset, $limit) {
$sql = "SELECT *
/**
* Exports poll options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptions($offset, $limit) {
$sql = "SELECT *
/**
* Exports poll option votes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptionVotes($offset, $limit) {
$sql = "SELECT *
/**
* Exports likes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPostLikes($offset, $limit) {
$this->exportLikes('com.woltlab.wbb.likeablePost', 'com.woltlab.wbb.like', $offset, $limit);
/**
* Exports labels.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportLabels($offset, $limit) {
// get labels array($this->getObjectTypeID('com.woltlab.wcf.label.object', 'com.woltlab.wbb.thread'))
/**
* Exports ACLs.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportACLs($offset, $limit) {
$objectTypeID = $this->getObjectTypeID('com.woltlab.wcf.acl', 'com.woltlab.wbb.board');
/**
* Exports smilies.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportSmilies($offset, $limit) {
$sql = "SELECT *
/**
* Exports smiley categories.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportSmileyCategories($offset, $limit) {
$sql = "SELECT *
FROM wcf".$this->dbNo."_category
- WHERE objectTypeID = ?
+ WHERE objectTypeID = ?
ORDER BY categoryID";
$statement = $this->database->prepareStatement($sql, $limit, $offset);
$statement->execute([$this->getObjectTypeID('com.woltlab.wcf.category', 'com.woltlab.wcf.bbcode.smiley')]);
/**
* Exports blogs.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogs($offset, $limit) {
$sql = "SELECT blog.*, language.languageCode
/**
* Exports blog categories.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogCategories($offset, $limit) {
$this->exportCategories('com.woltlab.blog.category', 'com.woltlab.blog.category', $offset, $limit);
/**
* Exports blog entries.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogEntries($offset, $limit) {
$sourceVersion21 = version_compare($this->getPackageVersion('com.woltlab.blog'), '2.1.0 Alpha 1', '>=');
/**
* Exports blog attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogAttachments($offset, $limit) {
$this->exportAttachments('om.woltlab.blog.entry', 'com.woltlab.blog.entry.attachment', $offset, $limit);
/**
* Exports blog comments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogComments($offset, $limit) {
$this->exportComments('com.woltlab.blog.entryComment', 'com.woltlab.blog.entry.comment', $offset, $limit);
/**
* Exports blog comment responses.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogCommentResponses($offset, $limit) {
$this->exportCommentResponses('com.woltlab.blog.entryComment', 'com.woltlab.blog.entry.comment.response', $offset, $limit);
/**
* Exports blog entry likes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogEntryLikes($offset, $limit) {
$this->exportLikes('com.woltlab.blog.likeableEntry', 'com.woltlab.blog.entry.like', $offset, $limit);
/**
* Exports gallery categories.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportGalleryCategories($offset, $limit) {
$this->exportCategories('com.woltlab.gallery.category', 'com.woltlab.gallery.category', $offset, $limit);
/**
* Exports gallery images.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportGalleryImages($offset, $limit) {
$sourceVersion21 = version_compare($this->getPackageVersion('com.woltlab.gallery'), '2.1.0 Alpha 1', '>=');
/**
* Exports gallery image markers.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportGalleryImageMarkers($offset, $limit) {
$sql = "SELECT *
/**
* Exports gallery comments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportGalleryComments($offset, $limit) {
$this->exportComments('com.woltlab.gallery.imageComment', 'com.woltlab.gallery.image.comment', $offset, $limit);
/**
* Exports gallery comment responses.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportGalleryCommentResponses($offset, $limit) {
$this->exportCommentResponses('com.woltlab.gallery.imageComment', 'com.woltlab.gallery.image.comment.response', $offset, $limit);
/**
* Exports gallery image likes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportGalleryImageLikes($offset, $limit) {
$this->exportLikes('com.woltlab.gallery.likeableImage', 'com.woltlab.gallery.image.like', $offset, $limit);
/**
* Exports calendar events.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportCalendarEvents($offset, $limit) {
// get event ids
/**
* Exports calendar event dates.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportCalendarEventDates($offset, $limit) {
$sql = "SELECT *
/**
* Exports calendar event date participations.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportCalendarEventDateParticipation($offset, $limit) {
$sql = "SELECT *
/**
* Exports calendar categories.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportCalendarCategories($offset, $limit) {
$this->exportCategories('com.woltlab.calendar.category', 'com.woltlab.calendar.category', $offset, $limit);
/**
* Exports calendar attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportCalendarAttachments($offset, $limit) {
$this->exportAttachments('com.woltlab.calendar.event', 'com.woltlab.calendar.event.attachment', $offset, $limit);
/**
* Exports calendar event comments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportCalendarEventDateComments($offset, $limit) {
$this->exportComments('com.woltlab.calendar.eventDateComment', 'com.woltlab.calendar.event.date.comment', $offset, $limit);
/**
* Exports calendar event comment responses.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportCalendarEventDateCommentResponses($offset, $limit) {
$this->exportCommentResponses('com.woltlab.calendar.eventDateComment', 'com.woltlab.calendar.event.date.comment.response', $offset, $limit);
/**
* Exports gallery image likes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportCalendarEventLikes($offset, $limit) {
$this->exportLikes('com.woltlab.calendar.likeableEvent', 'com.woltlab.calendar.event.like', $offset, $limit);
/**
* Counts comments.
+ *
+ * @param integer $objectType
*/
private function countComments($objectType) {
$sql = "SELECT COUNT(*) AS count
/**
* Exports comments.
+ *
+ * @param string $objectType
+ * @param string $importer
+ * @param integer $offset
+ * @param integer $limit
*/
private function exportComments($objectType, $importer, $offset, $limit) {
$sql = "SELECT *
/**
* Counts comment responses.
+ *
+ * @param string $objectType
*/
private function countCommentResponses($objectType) {
$sql = "SELECT COUNT(*) AS count
/**
* Exports profile Comment responses.
+ *
+ * @param string $objectType
+ * @param string $importer
+ * @param integer $offset
+ * @param integer $limit
*/
private function exportCommentResponses($objectType, $importer, $offset, $limit) {
$sql = "SELECT *
/**
* Counts likes.
+ *
+ * @param string $objectType
*/
private function countLikes($objectType) {
$sql = "SELECT COUNT(*) AS count
/**
* Exports likes.
+ *
+ * @param string $objectType
+ * @param string $importer
+ * @param integer $offset
+ * @param integer $limit
*/
private function exportLikes($objectType, $importer, $offset, $limit) {
$sql = "SELECT *
}
}
+ /**
+ * Returns the number of attachments.
+ *
+ * @param string $objectType
+ * @return integer
+ */
private function countAttachments($objectType) {
$sql = "SELECT COUNT(*) AS count
FROM wcf".$this->dbNo."_attachment
return $row['count'];
}
+ /**
+ * Exports attachments.
+ *
+ * @param string $objectType
+ * @param string $importer
+ * @param integer $offset
+ * @param integer $limit
+ */
private function exportAttachments($objectType, $importer, $offset, $limit) {
$sql = "SELECT *
FROM wcf".$this->dbNo."_attachment
return $optionsNames;
}
+ /**
+ * Returns the version of a package in the imported system or `false` if the package is
+ * not installed in the imported system.
+ *
+ * @param string $name
+ * @return string|boolean
+ */
private function getPackageVersion($name) {
$sql = "SELECT packageVersion
FROM wcf".$this->dbNo."_package
return false;
}
+ /**
+ * Returns tags to import.
+ *
+ * @param string $objectType
+ * @param integer[] $objectIDs
+ * @return string[][]
+ */
private function getTags($objectType, array $objectIDs) {
$tags = [];
$conditionBuilder = new PreparedStatementConditionBuilder();
return $tags;
}
+ /**
+ * Returns the ids of labels to import.
+ *
+ * @param string $objectType
+ * @param integer[] $objectIDs
+ * @return integer[][]
+ */
private function getLabels($objectType, array $objectIDs) {
$labels = [];
$conditionBuilder = new PreparedStatementConditionBuilder();
return $labels;
}
+ /**
+ * Returns the id of an object type in the imported system or null if no such
+ * object type exists.
+ *
+ * @param string $definitionName
+ * @param string $objectTypeName
+ * @return integer|null
+ */
private function getObjectTypeID($definitionName, $objectTypeName) {
$sql = "SELECT objectTypeID
FROM wcf".$this->dbNo."_object_type
return null;
}
+ /**
+ * Returns the number of categories.
+ *
+ * @param string $objectType
+ * @return integer
+ */
private function countCategories($objectType) {
$sql = "SELECT COUNT(*)
FROM wcf".$this->dbNo."_category
return $statement->fetchColumn();
}
+ /**
+ * Exports categories.
+ *
+ * @param string $objectType
+ * @param string $importer
+ * @param integer $offset
+ * @param integer $limit
+ */
private function exportCategories($objectType, $importer, $offset, $limit) {
$sql = "SELECT *
FROM wcf".$this->dbNo."_category
/**
* Exports users.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUsers($offset, $limit) {
// prepare password update
/**
* Exports categories.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogCategories($offset, $limit) {
$sql = "SELECT term_taxonomy.*, term.name
/**
* Exports the categories recursively.
+ *
+ * @param integer $parentID
*/
protected function exportBlogCategoriesRecursively($parentID = 0) {
if (!isset($this->categoryCache[$parentID])) return;
/**
* Exports blog entries.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogEntries($offset, $limit) {
// get entry ids
/**
* Exports blog comments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogComments($offset, $limit) {
$sql = "SELECT comment_ID, comment_parent
/**
* Exports blog attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogAttachments($offset, $limit) {
$sql = "SELECT posts.*, postmeta.*
}
}
+ /**
+ * Returns message with fixed syntax as used in WCF.
+ *
+ * @param string $string
+ * @return string
+ */
private static function fixMessage($string) {
$string = str_replace("\n", "<br />\n", StringUtil::unifyNewlines($string));
/**
* Exports user groups.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserGroups($offset, $limit) {
$sql = "SELECT *
/**
* Exports users.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUsers($offset, $limit) {
// prepare password update
/**
* Exports user options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserOptions($offset, $limit) {
$condition = new PreparedStatementConditionBuilder();
/**
* Exports user ranks.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserRanks($offset, $limit) {
try {
/**
* Exports followers.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportFollowers($offset, $limit) {
$sql = "SELECT *
/**
* Exports wall entries.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportWallEntries($offset, $limit) {
$sql = "SELECT *
/**
* Exports wall responses.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportWallResponses($offset, $limit) {
$sql = "SELECT *
/**
* Exports user avatars.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportUserAvatars($offset, $limit) {
$sql = "SELECT user_id
/**
* Exports conversation folders.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationFolders($offset, $limit) {
$sql = "SELECT user_id
/**
* Exports conversations.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversations($offset, $limit) {
$sql = "SELECT *
/**
* Exports conversation messages.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationMessages($offset, $limit) {
$sql = "SELECT message_table.*, INET_NTOA(ip_table.ip) AS ip
/**
* Exports conversation recipients.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportConversationUsers($offset, $limit) {
$sql = "SELECT recipient_table.*, user_table.username, cuser_table.is_starred
/**
* Exports boards.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBoards($offset, $limit) {
$sql = "SELECT node.node_id AS nodeID, node.*, forum.*, link_forum.*
/**
* Exports threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportThreads($offset, $limit) {
$sql = "SELECT *
/**
* Exports posts.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPosts($offset, $limit) {
$sql = "SELECT post.*, user.username AS editor, INET_NTOA(ip.ip) AS ip, thread.title
/**
* Exports post attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPostAttachments($offset, $limit) {
$this->exportAttachments('post', 'com.woltlab.wbb.attachment', $offset, $limit);
/**
* Exports watched threads.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportWatchedThreads($offset, $limit) {
$sql = "SELECT *
/**
* Exports polls.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPolls($offset, $limit) {
$sql = "SELECT poll.*, thread.first_post_id,
/**
* Exports poll options.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptions($offset, $limit) {
$sql = "SELECT *
/**
* Exports poll option votes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportPollOptionVotes($offset, $limit) {
$sql = "SELECT *
/**
* Exports labels.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportLabels($offset, $limit) {
$objectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.label.objectType', 'com.woltlab.wbb.board');
/**
* Exports ACLs.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportACLs($offset, $limit) {
static $mapping = [
/**
* Exports blog categories.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogCategories($offset, $limit) {
$sql = "SELECT *
/**
* Exports blog entries.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogEntries($offset, $limit) {
$sql = "(
/**
* Exports blog comments.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogComments($offset, $limit) {
$sql = "SELECT comment.*, user.username
/**
* Exports blog entry likes.
+ *
+ * @param integer $offset
+ * @param integer $limit
*/
public function exportBlogEntryLikes($offset, $limit) {
$sql = "SELECT *
}
}
+ /**
+ * Returns the number of blog attachments.
+ *
+ * @return integer
+ */
public function countBlogAttachments() {
return $this->countAttachments('xfa_blog_entry');
}
+ /**
+ * Exports blog attachments.
+ *
+ * @param integer $offset
+ * @param integer $limit
+ */
public function exportBlogAttachments($offset, $limit) {
$this->exportAttachments('xfa_blog_entry', 'com.woltlab.blog.entry.attachment', $offset, $limit);
}
+ /**
+ * Returns the number of attachments.
+ *
+ * @param string $type
+ * @return integer
+ */
public function countAttachments($type) {
$sql = "SELECT COUNT(*) AS count
FROM xf_attachment
return $row['count'];
}
+ /**
+ * Exports attachments.
+ *
+ * @param string $type
+ * @param string $objectType
+ * @param integer $offset
+ * @param integer $limit
+ */
public function exportAttachments($type, $objectType, $offset, $limit) {
$sql = "SELECT attachment.*, data.*
FROM xf_attachment attachment
}
}
+ /**
+ * Returns the configuration data of the imported board.
+ *
+ * @return array
+ */
public function getConfig() {
$config = [
'db' => [
return $config;
}
+ /**
+ * Returns message with fixed BBCodes as used in WCF.
+ *
+ * @param string $message
+ * @return string
+ */
private static function fixBBCodes($message) {
static $mediaRegex = null;
static $mediaCallback = null;
return $message;
}
+ /**
+ * Returns comment text with fixed formatting as used in WCF.
+ *
+ * @param string $message
+ * @return string
+ */
private static function fixComment($message) {
static $mentionRegex = null;
if ($mentionRegex === null) {