Fix code formatting
authorMatthias Schmidt <gravatronics@live.com>
Thu, 25 Dec 2014 09:54:08 +0000 (10:54 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Thu, 25 Dec 2014 09:54:08 +0000 (10:54 +0100)
files/lib/system/exporter/IPB3xExporter.class.php
files/lib/system/exporter/Kunena3xExporter.class.php
files/lib/system/exporter/MyBB16xExporter.class.php
files/lib/system/exporter/PhpBB3xExporter.class.php
files/lib/system/exporter/SMF2xExporter.class.php
files/lib/system/exporter/VB3or4xExporter.class.php
files/lib/system/exporter/WBB3xExporter.class.php
files/lib/system/exporter/WBB4xExporter.class.php
files/lib/system/exporter/WordPress3xExporter.class.php
files/lib/system/exporter/XF12xExporter.class.php

index dbd2affca6e3334e8436df5620a2ba972e8cdf8f..31caf9d7b3c5c33d1626b2d32bd46b1c924f9445 100644 (file)
@@ -83,7 +83,7 @@ class IPB3xExporter extends AbstractExporter {
         */
        public function validateDatabaseAccess() {
                parent::validateDatabaseAccess();
-       
+               
                $sql = "SELECT COUNT(*) FROM ".$this->databasePrefix."core_like";
                $statement = $this->database->prepareStatement($sql);
                $statement->execute();
@@ -96,7 +96,7 @@ class IPB3xExporter extends AbstractExporter {
                if (in_array('com.woltlab.wcf.user.avatar', $this->selectedData) || in_array('com.woltlab.wbb.attachment', $this->selectedData) || in_array('com.woltlab.wcf.conversation.attachment', $this->selectedData)) {
                        if (empty($this->fileSystemPath) || !@file_exists($this->fileSystemPath . 'conf_global.php')) return false;
                }
-       
+               
                return true;
        }
        
@@ -105,7 +105,7 @@ class IPB3xExporter extends AbstractExporter {
         */
        public function getQueue() {
                $queue = array();
-       
+               
                // user
                if (in_array('com.woltlab.wcf.user', $this->selectedData)) {
                        if (in_array('com.woltlab.wcf.user.group', $this->selectedData)) {
@@ -127,14 +127,14 @@ class IPB3xExporter extends AbstractExporter {
                                $queue[] = 'com.woltlab.wcf.conversation';
                                $queue[] = 'com.woltlab.wcf.conversation.message';
                                $queue[] = 'com.woltlab.wcf.conversation.user';
-                                       
+                               
                                if (in_array('com.woltlab.wcf.conversation.attachment', $this->selectedData)) $queue[] = 'com.woltlab.wcf.conversation.attachment';
                        }
                }
                
                // board
                if (in_array('com.woltlab.wbb.board', $this->selectedData)) {
-                       $queue[] = 'com.woltlab.wbb.board';                     
+                       $queue[] = 'com.woltlab.wbb.board';
                        $queue[] = 'com.woltlab.wbb.thread';
                        $queue[] = 'com.woltlab.wbb.post';
                        
@@ -146,7 +146,7 @@ class IPB3xExporter extends AbstractExporter {
                        }
                        if (in_array('com.woltlab.wbb.like', $this->selectedData)) $queue[] = 'com.woltlab.wbb.like';
                }
-       
+               
                return $queue;
        }
        
@@ -175,13 +175,13 @@ class IPB3xExporter extends AbstractExporter {
                                $profileFields[] = $row;
                        }
                }
-       
+               
                // prepare password update
                $sql = "UPDATE  wcf".WCF_N."_user
                        SET     password = ?
                        WHERE   userID = ?";
                $passwordUpdateStatement = WCF::getDB()->prepareStatement($sql);
-       
+               
                // get users
                $sql = "SELECT          pfields_content.*, members.*, profile_portal.*
                        FROM            ".$this->databasePrefix."members members
@@ -599,7 +599,7 @@ class IPB3xExporter extends AbstractExporter {
                while ($row = $statement->fetchArray()) {
                        $this->boardCache[$row['parent_id']][] = $row;
                }
-       
+               
                $this->exportBoardsRecursively();
        }
        
@@ -608,7 +608,7 @@ class IPB3xExporter extends AbstractExporter {
         */
        protected function exportBoardsRecursively($parentID = -1) {
                if (!isset($this->boardCache[$parentID])) return;
-       
+               
                foreach ($this->boardCache[$parentID] as $board) {
                        ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($board['id'], array(
                                'parentID' => ($board['parent_id'] != -1 ? $board['parent_id'] : null),
@@ -649,14 +649,14 @@ class IPB3xExporter extends AbstractExporter {
                while ($row = $statement->fetchArray()) {
                        $threadIDs[] = $row['tid'];
                }
-       
+               
                // get tags
                $tags = $this->getTags('forums', 'topics', $threadIDs);
-       
+               
                // get threads
                $conditionBuilder = new PreparedStatementConditionBuilder();
                $conditionBuilder->add('topics.tid IN (?)', array($threadIDs));
-       
+               
                $sql = "SELECT          topics.*
                        FROM            ".$this->databasePrefix."topics topics
                        ".$conditionBuilder;
@@ -925,7 +925,7 @@ class IPB3xExporter extends AbstractExporter {
                $conditionBuilder->add('tag_meta_app = ?', array($app));
                $conditionBuilder->add('tag_meta_area = ?', array($area));
                $conditionBuilder->add('tag_meta_id IN (?)', array($objectIDs));
-       
+               
                // get taggable id
                $sql = "SELECT          tag_meta_id, tag_text
                        FROM            ".$this->databasePrefix."core_tags
@@ -1002,7 +1002,7 @@ class IPB3xExporter extends AbstractExporter {
                $string = preg_replace('~<a.*?href=(?:"|\')([^"]*)(?:"|\')>(.*?)</a>~is', '[url=\'\\1\']\\2[/url]', $string);
                
                // smileys
-               $string = preg_replace('~<img src=\'[^\']+\' class=\'bbc_emoticon\' alt=\'([^\']+)\' ?/?>~is', '\\1', $string);         
+               $string = preg_replace('~<img src=\'[^\']+\' class=\'bbc_emoticon\' alt=\'([^\']+)\' ?/?>~is', '\\1', $string);
                
                // images
                $string = preg_replace('~<img[^>]+src=["\']([^"\']+)["\'][^>]*/?>~is', '[img]\\1[/img]', $string);
index f019fddf760b8f9713b7a3da868cef1bc2538541..64fa3fd5b0fe89904e53eb709374c4c743c95586 100644 (file)
@@ -72,7 +72,7 @@ class Kunena3xExporter extends AbstractExporter {
         */
        public function getQueue() {
                $queue = array();
-       
+               
                // user
                if (in_array('com.woltlab.wcf.user', $this->selectedData)) {
                        if (in_array('com.woltlab.wcf.user.group', $this->selectedData)) {
@@ -82,7 +82,7 @@ class Kunena3xExporter extends AbstractExporter {
                        $queue[] = 'com.woltlab.wcf.user';
                        if (in_array('com.woltlab.wcf.user.avatar', $this->selectedData)) $queue[] = 'com.woltlab.wcf.user.avatar';
                }
-       
+               
                // board
                if (in_array('com.woltlab.wbb.board', $this->selectedData)) {
                        $queue[] = 'com.woltlab.wbb.board';
@@ -91,7 +91,7 @@ class Kunena3xExporter extends AbstractExporter {
                                
                        if (in_array('com.woltlab.wbb.attachment', $this->selectedData)) $queue[] = 'com.woltlab.wbb.attachment';
                }
-       
+               
                return $queue;
        }
        
@@ -100,7 +100,7 @@ class Kunena3xExporter extends AbstractExporter {
         */
        public function validateDatabaseAccess() {
                parent::validateDatabaseAccess();
-       
+               
                $sql = "SELECT COUNT(*) FROM ".$this->databasePrefix."kunena_users";
                $statement = $this->database->prepareStatement($sql);
                $statement->execute();
@@ -113,7 +113,7 @@ class Kunena3xExporter extends AbstractExporter {
                if (in_array('com.woltlab.wcf.user.avatar', $this->selectedData) || in_array('com.woltlab.wbb.attachment', $this->selectedData)) {
                        if (empty($this->fileSystemPath) || !@file_exists($this->fileSystemPath . 'libraries/kunena/model.php')) return false;
                }
-       
+               
                return true;
        }
        
@@ -180,7 +180,7 @@ class Kunena3xExporter extends AbstractExporter {
                        SET     password = ?
                        WHERE   userID = ?";
                $passwordUpdateStatement = WCF::getDB()->prepareStatement($sql);
-       
+               
                // get users
                $sql = "SELECT          kunena_users.*, users.*,
                                        (
@@ -335,7 +335,7 @@ class Kunena3xExporter extends AbstractExporter {
                while ($row = $statement->fetchArray()) {
                        $this->boardCache[$row['parent_id']][] = $row;
                }
-       
+               
                $this->exportBoardsRecursively();
        }
        
@@ -344,7 +344,7 @@ class Kunena3xExporter extends AbstractExporter {
         */
        protected function exportBoardsRecursively($parentID = 0) {
                if (!isset($this->boardCache[$parentID])) return;
-       
+               
                foreach ($this->boardCache[$parentID] as $board) {
                        ImportHandler::getInstance()->getImporter('com.woltlab.wbb.board')->import($board['id'], array(
                                'parentID' => ($board['parent_id'] ?: null),
@@ -354,7 +354,7 @@ class Kunena3xExporter extends AbstractExporter {
                                'description' => $board['description'],
                                'isClosed' => $board['locked'] ? 1 : 0
                        ));
-                               
+                       
                        $this->exportBoardsRecursively($board['id']);
                }
        }
@@ -471,14 +471,14 @@ class Kunena3xExporter extends AbstractExporter {
                        $quoteCallback = new Callback(function ($matches) {
                                $username = str_replace(array("\\", "'"), array("\\\\", "\'"), $matches[1]);
                                $postID = $matches[2];
-               
+                               
                                $postLink = LinkHandler::getInstance()->getLink('Thread', array(
                                        'application' => 'wbb',
                                        'postID' => $postID,
                                        'forceFrontend' => true
                                )).'#post'.$postID;
                                $postLink = str_replace(array("\\", "'"), array("\\\\", "\'"), $postLink);
-               
+                               
                                return "[quote='".$username."','".$postLink."']";
                        });
                }
index f4c59edb5265eca4d875d89293b398704683979c..f6ee5ac8f1fedbcf28af25cd1bd0aac736496235 100644 (file)
@@ -364,7 +364,7 @@ class MyBB16xExporter extends AbstractExporter {
        public function exportUserOptions($offset, $limit) {
                $conditionBuilder = new PreparedStatementConditionBuilder();
                $conditionBuilder->add('name NOT IN (?)', array(self::$knownProfileFields));
-       
+               
                $sql = "SELECT          *
                        FROM            ".$this->databasePrefix."profilefields
                        ".$conditionBuilder."
index 26f5993012ed40fec2c6e921bd74eb6ec8c870ab..0cc5825594d0ff7ecafb1830b85079a016386ff3 100644 (file)
@@ -726,7 +726,7 @@ class PhpBB3xExporter extends AbstractExporter {
                                'message' => self::fixBBCodes(StringUtil::decodeHTML($row['message_text']), $row['bbcode_uid']),
                                'time' => $row['message_time'],
                                'attachments' => $row['attachments'],
-                               'enableSmilies' =>  $row['enable_smilies'],
+                               'enableSmilies' => $row['enable_smilies'],
                                'enableHtml' => 0,
                                'enableBBCodes' => $row['enable_bbcode'],
                                'showSignature' => $row['enable_sig']
index b77bf58dfbbdd888c3caca23a1d25fac831599ef..0171d0155c9e93c73a4d656c8671f281f0b8b36d 100644 (file)
@@ -352,7 +352,7 @@ class SMF2xExporter extends AbstractExporter {
                        }
                }
        }
-
+       
        /**
         * Counts user options.
         */
index e2508b72692e3585b84b4f0a237545676bbbb97a..688c8f4dab3fd7746f12d9fa56eda470bddf42b4 100644 (file)
@@ -785,7 +785,7 @@ class VB3or4xExporter extends AbstractExporter {
                while ($row = $statement->fetchArray()) {
                        $this->boardCache[$row['parentid']][] = $row;
                }
-       
+               
                $this->exportBoardsRecursively();
        }
        
@@ -1041,7 +1041,7 @@ class VB3or4xExporter extends AbstractExporter {
                        }
                        catch (\Exception $e) {
                                if ($this->readOption('attachfile') == self::ATTACHFILE_DATABASE && $file) @unlink($file);
-                       
+                               
                                throw $e;
                        }
                }
index 45131814542519f6486ed8591feee0316ffa118f..4e3db9f9bec98663cefe68e9be2a6a6cab154905 100644 (file)
@@ -104,7 +104,7 @@ class WBB3xExporter extends AbstractExporter {
        
        /**
         * valid thread sort fields
-        * @var array<string>
+        * @var array<string>
         */
        protected static $availableThreadSortFields = array('topic', 'username', 'time', 'views', 'replies', 'lastPostTime', 'cumulativeLikes');
        
@@ -1969,10 +1969,10 @@ class WBB3xExporter extends AbstractExporter {
                while ($row = $statement->fetchArray()) {
                        $imageIDs[] = $row['photoID'];
                }
-       
+               
                // get tags
                $tags = $this->getTags('com.woltlab.wcf.user.gallery.photo', $imageIDs);
-       
+               
                // get categories
                $categories = array();
                $conditionBuilder = new PreparedStatementConditionBuilder();
@@ -1990,11 +1990,11 @@ class WBB3xExporter extends AbstractExporter {
                        if (!isset($categories[$row['objectID']])) $categories[$row['objectID']] = array();
                        $categories[$row['objectID']][] = $row['categoryID'];
                }
-       
+               
                // get images
                $conditionBuilder = new PreparedStatementConditionBuilder();
                $conditionBuilder->add('user_gallery.photoID IN (?)', array($imageIDs));
-       
+               
                $sql = "SELECT          user_gallery.*
                        FROM            wcf".$this->dbNo."_user_gallery user_gallery
                        ".$conditionBuilder;
@@ -2383,7 +2383,7 @@ class WBB3xExporter extends AbstractExporter {
                        WHERE           eventID = ?
                        ORDER BY        startTime";
                $firstEventDateStatement = $this->database->prepareStatement($sql, 1);
-       
+               
                $sql = "SELECT          participation_to_user.*, participation.eventID
                        FROM            wcf".$this->dbNo."_calendar_event_participation_to_user participation_to_user
                        LEFT JOIN       wcf".$this->dbNo."_calendar_event_participation participation
index 78bbaf09dab05ccd6ddf343bbba73d290ae3906a..b52a4ffd38b04e76feb26a5ff49e32cc85466dfb 100644 (file)
@@ -1669,7 +1669,7 @@ class WBB4xExporter extends AbstractExporter {
                $conditionBuilder = new PreparedStatementConditionBuilder();
                $conditionBuilder->add('objectTypeID = ?', array($this->getObjectTypeID('com.woltlab.wcf.label.object', $objectType)));
                $conditionBuilder->add('objectID IN (?)', array($objectIDs));
-       
+               
                $sql = "SELECT          labelID, objectID
                        FROM            wcf".$this->dbNo."_label_object
                        ".$conditionBuilder;
@@ -1679,7 +1679,7 @@ class WBB4xExporter extends AbstractExporter {
                        if (!isset($labels[$row['objectID']])) $labels[$row['objectID']] = array();
                        $labels[$row['objectID']][] = $row['labelID'];
                }
-       
+               
                return $labels;
        }
        
index 3394e2ae4817a65f41ea302d4f6d8a38e0c0ae98..63620b0af952c8b46855fdf324c72eb39fff3cf1 100644 (file)
@@ -53,7 +53,7 @@ class WordPress3xExporter extends AbstractExporter {
         */
        public function getQueue() {
                $queue = array();
-       
+               
                // user
                if (in_array('com.woltlab.wcf.user', $this->selectedData)) {
                        $queue[] = 'com.woltlab.wcf.user';
@@ -75,7 +75,7 @@ class WordPress3xExporter extends AbstractExporter {
         */
        public function validateDatabaseAccess() {
                parent::validateDatabaseAccess();
-       
+               
                $sql = "SELECT COUNT(*) FROM ".$this->databasePrefix."posts";
                $statement = $this->database->prepareStatement($sql);
                $statement->execute();
@@ -115,7 +115,7 @@ class WordPress3xExporter extends AbstractExporter {
                        SET     password = ?
                        WHERE   userID = ?";
                $passwordUpdateStatement = WCF::getDB()->prepareStatement($sql);
-       
+               
                // get users
                $sql = "SELECT          *
                        FROM            ".$this->databasePrefix."users
@@ -169,7 +169,7 @@ class WordPress3xExporter extends AbstractExporter {
                while ($row = $statement->fetchArray()) {
                        $this->categoryCache[$row['parent']][] = $row;
                }
-       
+               
                $this->exportBlogCategoriesRecursively();
        }
        
@@ -178,7 +178,7 @@ class WordPress3xExporter extends AbstractExporter {
         */
        protected function exportBlogCategoriesRecursively($parentID = 0) {
                if (!isset($this->categoryCache[$parentID])) return;
-       
+               
                foreach ($this->categoryCache[$parentID] as $category) {
                        ImportHandler::getInstance()->getImporter('com.woltlab.blog.category')->import($category['term_id'], array(
                                'title' => StringUtil::decodeHTML($category['name']),
@@ -219,7 +219,7 @@ class WordPress3xExporter extends AbstractExporter {
                while ($row = $statement->fetchArray()) {
                        $entryIDs[] = $row['ID'];
                }
-       
+               
                // get tags
                $tags = array();
                $conditionBuilder = new PreparedStatementConditionBuilder();
@@ -256,11 +256,11 @@ class WordPress3xExporter extends AbstractExporter {
                        if (!isset($categories[$row['object_id']])) $categories[$row['object_id']] = array();
                        $categories[$row['object_id']][] = $row['term_id'];
                }
-       
+               
                // get entries
                $conditionBuilder = new PreparedStatementConditionBuilder();
                $conditionBuilder->add('post.ID IN (?)', array($entryIDs));
-       
+               
                $sql = "SELECT          post.*, user.user_login
                        FROM            ".$this->databasePrefix."posts post
                        LEFT JOIN       ".$this->databasePrefix."users user
@@ -389,7 +389,7 @@ class WordPress3xExporter extends AbstractExporter {
                                                WHERE   post_type = ?
                                                        AND post_status IN (?, ?, ?, ?, ?, ?)
                                        )
-                       ORDER BY        ID";
+                       ORDER BY        ID";
                $statement = $this->database->prepareStatement($sql, $offset, $limit);
                $statement->execute(array('_wp_attached_file', 'attachment', 'post', 'publish', 'pending', 'draft', 'future', 'private', 'trash'));
                while ($row = $statement->fetchArray()) {
index c210ca779a61bf1e2f0c376afdf2332a2f77ae94..ad309a5527da8e1c519ffa4dd6a22310c8922ad5 100644 (file)
@@ -116,7 +116,7 @@ class XF12xExporter extends AbstractExporter {
         */
        public function validateDatabaseAccess() {
                parent::validateDatabaseAccess();
-       
+               
                $sql = "SELECT COUNT(*) FROM xf_template_compiled";
                $statement = $this->database->prepareStatement($sql);
                $statement->execute();
@@ -749,7 +749,7 @@ class XF12xExporter extends AbstractExporter {
                        ));
                }
        }
-
+       
        /**
         * Counts threads.
         */
@@ -1015,7 +1015,7 @@ class XF12xExporter extends AbstractExporter {
                        ));
                }
        }
-
+       
        /**
         * Counts labels.
         */